Public report of caddyserver/caddy, published 23 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 23 October 2026, 22:21 UTC · Survey ID cd_49232169b29249898cb19a0e7ce77d5c

caddyserver/caddy

Measured 23 October 2026, 22:12 UTC, at code version 2b47a18

No regression since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 51out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 66,510 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Accessibility, 33

Findings by how serious they are

39 critical 731 serious 73 minor

27 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
23 October 2026, 22:12 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

55of 58 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
807of 843 findings point to an exact file and line, so you can open each one in the code. The other 36 concern the repository as a whole, such as missing documentation.
58dimensions across 7 lenses, read from 66,510 lines of product code in 1 project.
Chapters

Executive summary

caddyserver/caddy scores 51 out of 100 and is rated Adequate, while three of its seven lenses score higher still: Performance at 78 rated Strong, Architecture at 89 rated Adequate, and Security and Compliance at 76 rated Adequate.

The score is lower than those three because the weakest lens counts most, and here that is Accessibility, which scores 33 and is rated Weak. The project has no text alternatives for images or video and no keyboard semantics for custom controls, so its Text alternatives and Keyboard semantics dimensions both score 1 out of 10, and until those reach 4, Accessibility can't be rated higher than Adequate. Adding text alternatives to images, svg, canvas, and video, and making custom controls keyboard-operable are therefore the first actions, and if Accessibility rose to 70, the score would rise from 51 to about 65.

Thirty-nine findings are critical: nine links with no accessible name, six secrets in the code's history, four shell injection risks in static analysis, three leaked secrets in secret scanning, three unpinned package installs, three untrusted context laundered through step output, two github script injections, one image without a text alternative, one input without a programmatic label, one html without a lang attribute, one missing dependabot cooldown, one backtick-only escape, one fixed delimiter untrusted workflow output, one insecure skip verify in go, one optional mac key in go, and one boundary-crossing change coupling.

Watchdog couldn't measure code coverage because the test suite is not readable by the collector, internal api consistency because no csharp or vb projects were loaded, navigability because too few call sites were resolved for the go language, and data protection, access controls, audit trail, data retention, and data-subject rights because the source model for these controls was not loaded for this repository. The product code is 66,510 lines, which would take an estimated 0.9 person-years, around €130,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Accessibility 33 · counts for 46%Production Readiness 62 · counts for 25%Maturity 63 · counts for 14%Code Health 69 · counts for 8%Security and Compliance 76 · counts for 4%Performance 78 · counts for 2%Architecture 89 · counts for 1%

If Accessibility rose from 33 to 70, the lowest score rated Strong, the score would rise from 51 to about 65.

Code composition: what the lines of code are
Product code 58%Tests 42%
New since the last survey: 18 findings

These 18 critical or serious findings weren't in the previous survey, on 9 October 2026.

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 18 findings

These 18 critical or serious findings were in the previous survey, on 9 October 2026, and are gone from this one.

  • Cognitive Complexity · SRVUpstreams.GetUpstreams (cognitive 24) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) modules/caddyhttp/matchers.go
  • Churn × Complexity Hotspots · Hotspot: modules/caddyhttp/staticresp.go modules/caddyhttp/staticresp.go
  • Explicit Debt · TodoComment modules/caddyhttp/reverseproxy/reverseproxy.go
  • Explicit Debt · TodoComment modules/caddyhttp/reverseproxy/reverseproxy.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/reverseproxy/reverseproxy.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/reverseproxy/reverseproxy.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/reverseproxy/healthchecks.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/reverseproxy/addresses.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/rewrite/rewrite.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/templates/tplcontext.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/caddyhttp/templates/frontmatter_fuzz.go
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) modules/logging/filters.go
  • Exception handling · Swallowed exception (caught, then discarded) modules/logging/filters.go
Rebuild cost: about €130,000 · Estimate
Cost to rebuild€43,000 to €220,000, for 723 to 2,292 hours of work, about 0.9 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 51. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 66,510 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 6 points · Medium effort · Text alternatives
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 6 points · Medium effort · Keyboard semantics
3
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 2 points · Low effort · REDACTED Scanning

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €130,000 to build again, about 0.9 person-years of work. Its weakest lens is Accessibility, at 33 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 33,810 lines over the last 90 days, which is about 137,118 lines a year. At that pace, the extra work comes to an estimated 19.6 to 117.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

47 modules, with 128 dependencies between them. One loop runs through 12 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 7 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 com/caddyserver/caddy/v2/caddyconfig/warning2 com/caddyserver/caddy/v2/caddyconfig3 com/caddyserver/caddy/v2/modules/caddyevents4 com/caddyserver/caddy/v2/caddyconfig/caddyfile5 com/caddyserver/caddy/v2/cmd6 com/caddyserver/caddy/v2/modules/caddyevents/eventsconfig7 com/caddyserver/caddy/v2/modules/caddypki8 com/caddyserver/caddy/v2/modules/caddytls9 com/caddyserver/caddy/v2/modules/caddyhttp10 com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile11 com/caddyserver/caddy/v2/modules/caddyhttp/headers12 com/caddyserver/caddy/v2/modules/caddyhttp/rewrite13 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy14 com/caddyserver/caddy/v215 com/caddyserver/caddy/v2/internal/filesystems16 com/caddyserver/caddy/v2/internal/testmocks17 com/caddyserver/caddy/v2/modules/caddyfs18 com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth19 com/caddyserver/caddy/v2/modules/caddyhttp/encode20 com/caddyserver/caddy/v2/modules/caddyhttp/intercept21 com/caddyserver/caddy/v2/modules/caddyhttp/logging22 com/caddyserver/caddy/v2/modules/caddyhttp/map23 com/caddyserver/caddy/v2/modules/caddyhttp/proxyprotocol24 com/caddyserver/caddy/v2/modules/caddyhttp/push25 com/caddyserver/caddy/v2/modules/caddyhttp/requestbody26 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi27 com/caddyserver/caddy/v2/modules/caddyhttp/templates28 com/caddyserver/caddy/v2/modules/caddyhttp/timeouts29 com/caddyserver/caddy/v2/modules/caddyhttp/tracing30 com/caddyserver/caddy/v2/modules/caddypki/acmeserver31 com/caddyserver/caddy/v2/modules/caddytls/distributedstek32 com/caddyserver/caddy/v2/modules/caddytls/standardstek33 com/caddyserver/caddy/v2/modules/filestorage34 com/caddyserver/caddy/v2/modules/internal/network35 com/caddyserver/caddy/v2/modules/logging36 com/caddyserver/caddy/v2/modules/metrics37 com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli38 com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip39 com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd40 com/caddyserver/caddy/v2/modules/caddyhttp/fileserver
1 com/caddyserver/caddy/v2/caddyconfig/warning
2 com/caddyserver/caddy/v2/caddyconfig18
3 com/caddyserver/caddy/v2/modules/caddyevents8
4 com/caddyserver/caddy/v2/caddyconfig/caddyfile112
5 com/caddyserver/caddy/v2/cmd1
6 com/caddyserver/caddy/v2/modules/caddyevents/eventsconfig1
7 com/caddyserver/caddy/v2/modules/caddypki112
8 com/caddyserver/caddy/v2/modules/caddytls1503120
9 com/caddyserver/caddy/v2/modules/caddyhttp14315383
10 com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile381997
11 com/caddyserver/caddy/v2/modules/caddyhttp/headers4216
12 com/caddyserver/caddy/v2/modules/caddyhttp/rewrite328
13 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy12911424166
14 com/caddyserver/caddy/v211
15 com/caddyserver/caddy/v2/internal/filesystems1
16 com/caddyserver/caddy/v2/internal/testmocks212
17 com/caddyserver/caddy/v2/modules/caddyfs23
18 com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth131110
19 com/caddyserver/caddy/v2/modules/caddyhttp/encode24115
20 com/caddyserver/caddy/v2/modules/caddyhttp/intercept27214
21 com/caddyserver/caddy/v2/modules/caddyhttp/logging2311
22 com/caddyserver/caddy/v2/modules/caddyhttp/map314
23 com/caddyserver/caddy/v2/modules/caddyhttp/proxyprotocol26
24 com/caddyserver/caddy/v2/modules/caddyhttp/push3114
25 com/caddyserver/caddy/v2/modules/caddyhttp/requestbody311
26 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi1224
27 com/caddyserver/caddy/v2/modules/caddyhttp/templates4115
28 com/caddyserver/caddy/v2/modules/caddyhttp/timeouts313
29 com/caddyserver/caddy/v2/modules/caddyhttp/tracing2514
30 com/caddyserver/caddy/v2/modules/caddypki/acmeserver226
31 com/caddyserver/caddy/v2/modules/caddytls/distributedstek22
32 com/caddyserver/caddy/v2/modules/caddytls/standardstek21
33 com/caddyserver/caddy/v2/modules/filestorage22
34 com/caddyserver/caddy/v2/modules/internal/network49
35 com/caddyserver/caddy/v2/modules/logging3749
36 com/caddyserver/caddy/v2/modules/metrics2318
37 com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli11
38 com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip254
39 com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd244
40 com/caddyserver/caddy/v2/modules/caddyhttp/fileserver31631101
Uses a module listed above itPart of a loopThe module itself
1 com/caddyserver/caddy/v2/caddyconfig/warning2 com/caddyserver/caddy/v2/caddyconfig3 com/caddyserver/caddy/v2/modules/caddyevents4 com/caddyserver/caddy/v2/caddyconfig/caddyfile5 com/caddyserver/caddy/v2/cmd6 com/caddyserver/caddy/v2/modules/caddyevents/eventsconfig7 com/caddyserver/caddy/v2/modules/caddypki8 com/caddyserver/caddy/v2/modules/caddytls9 com/caddyserver/caddy/v2/modules/caddyhttp10 com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile11 com/caddyserver/caddy/v2/modules/caddyhttp/headers12 com/caddyserver/caddy/v2/modules/caddyhttp/rewrite13 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy14 com/caddyserver/caddy/v215 com/caddyserver/caddy/v2/internal/filesystems16 com/caddyserver/caddy/v2/internal/testmocks17 com/caddyserver/caddy/v2/modules/caddyfs18 com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth19 com/caddyserver/caddy/v2/modules/caddyhttp/encode20 com/caddyserver/caddy/v2/modules/caddyhttp/intercept21 com/caddyserver/caddy/v2/modules/caddyhttp/logging22 com/caddyserver/caddy/v2/modules/caddyhttp/map23 com/caddyserver/caddy/v2/modules/caddyhttp/proxyprotocol24 com/caddyserver/caddy/v2/modules/caddyhttp/push25 com/caddyserver/caddy/v2/modules/caddyhttp/requestbody26 com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi27 com/caddyserver/caddy/v2/modules/caddyhttp/templates28 com/caddyserver/caddy/v2/modules/caddyhttp/timeouts29 com/caddyserver/caddy/v2/modules/caddyhttp/tracing30 com/caddyserver/caddy/v2/modules/caddypki/acmeserver31 com/caddyserver/caddy/v2/modules/caddytls/distributedstek32 com/caddyserver/caddy/v2/modules/caddytls/standardstek33 com/caddyserver/caddy/v2/modules/filestorage34 com/caddyserver/caddy/v2/modules/internal/network35 com/caddyserver/caddy/v2/modules/logging36 com/caddyserver/caddy/v2/modules/metrics37 com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli38 com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip39 com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd40 com/caddyserver/caddy/v2/modules/caddyhttp/fileservercom/caddyserver/caddy/v2/caddyconfig/warning1com/caddyserver/caddy/v2/caddyconfig2com/caddyserver/caddy/v2/modules/caddyevents3com/caddyserver/caddy/v2/caddyconfig/caddyfile4com/caddyserver/caddy/v2/cmd5com/caddyserver/caddy/v2/modules/caddyevents/eventsconfig6com/caddyserver/caddy/v2/modules/caddypki7com/caddyserver/caddy/v2/modules/caddytls8com/caddyserver/caddy/v2/modules/caddyhttp9com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile10com/caddyserver/caddy/v2/modules/caddyhttp/headers11com/caddyserver/caddy/v2/modules/caddyhttp/rewrite12com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy13com/caddyserver/caddy/v214com/caddyserver/caddy/v2/internal/filesystems15com/caddyserver/caddy/v2/internal/testmocks16com/caddyserver/caddy/v2/modules/caddyfs17com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth18com/caddyserver/caddy/v2/modules/caddyhttp/encode19com/caddyserver/caddy/v2/modules/caddyhttp/intercept20com/caddyserver/caddy/v2/modules/caddyhttp/logging21com/caddyserver/caddy/v2/modules/caddyhttp/map22com/caddyserver/caddy/v2/modules/caddyhttp/proxyprotocol23com/caddyserver/caddy/v2/modules/caddyhttp/push24com/caddyserver/caddy/v2/modules/caddyhttp/requestbody25com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi26com/caddyserver/caddy/v2/modules/caddyhttp/templates27com/caddyserver/caddy/v2/modules/caddyhttp/timeouts28com/caddyserver/caddy/v2/modules/caddyhttp/tracing29com/caddyserver/caddy/v2/modules/caddypki/acmeserver30com/caddyserver/caddy/v2/modules/caddytls/distributedstek31com/caddyserver/caddy/v2/modules/caddytls/standardstek32com/caddyserver/caddy/v2/modules/filestorage33com/caddyserver/caddy/v2/modules/internal/network34com/caddyserver/caddy/v2/modules/logging35com/caddyserver/caddy/v2/modules/metrics36com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli37com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip38com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd39com/caddyserver/caddy/v2/modules/caddyhttp/fileserver4018811211112150312014315383381997421632812911424166111212231311102411527214231131426311431112244115313251422622212249374923181125424431631101+7 more modules (most-connected shown)

At a glance — Code Health · 69% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 89% · Adequate · gated by D26 ·

At a glance — Maturity · 63% · Adequate · gated by M2 ·

At a glance — Readiness · 62% · Adequate · gated by D13, P7 ·

At a glance — Security · 76% · Adequate · gated by D29 ·

At a glance — Accessibility · 33% · Weak · gated by AC1, AC4 ·

At a glance — Performance · 78% · Strong ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection71High / Critical
A07:2025 — Authentication Failures10High / Critical
A03:2025 — Software Supply Chain Failures5Medium

Roadmap

Begin by adding descriptive text alternatives to all media elements and ensuring custom controls are fully keyboard-operable with proper semantic roles. Next, provide explicit programmatic labels for every form control and button to replace placeholders, and immediately resolve the three identified secret leaks in the codebase. Finally, integrate automated accessibility checks into the existing test suite and CI pipeline to enforce these standards and prevent future regressions.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+5.7 ptsMediumText alternatives
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+5.7 ptsMediumKeyboard semantics
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+2.0 ptsLowREDACTED Scanning
Resolve the 1 No ADRs found finding(s) in ADR Quality.+1.7 ptsLowADR Quality
Resolve the 2 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+1.6 ptsLowDependency Hygiene
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.+2.7 ptsMediumA11y enforcement
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.6 ptsMediumForms & labels
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+2.0 ptsMediumPage structure

File quality

Per-file score 0–10 — a quality signature. Of 135 files carrying findings, judged against the Production bar: 2% slop · 74% mixed · 24% near-clean.

FileScoreBandWorst signal
caddyconfig/httpcaddyfile/directives.go1.2SlopChange Coupling: Boundary-crossing change coupling: directives.go ↔ imports.go
REDACTED1.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 39

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 731

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 73

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 27

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 55 of 58 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 58 dimensions across the health lenses
D1D2D3D4D6D9D11D12D13D14D15D16D17D19D20D21D26D28D29D30D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX2AX3AX5AX9M1M2M3M4P1P2P3P4P6P7PF1PF2S1X14X15X2X26X28X3X30

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 807 of 843 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a16ad2-3b72-7afd-aabb-3b19047b14fd.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`go test -coverprofile`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.go), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (.). `go` is not on PATH — this repository boots from its toolchain's own run entry point ('github.com/go-chi/chi' required by REDACTED, and cmd/caddy is the module's only package main), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

130 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Handler.UnmarshalCaddyfile at 255. A further 2 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being caddy.ToString at 18 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: REDACTED (caddy.RegisterNetwork at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

Handler.UnmarshalCaddyfile (cyclomatic 255)modules/caddyhttp/reverseproxy/caddyfile.go:152
ServerType.serversFromPairings (cyclomatic 131)REDACTED:566
ServerType.buildTLSApp (cyclomatic 124)caddyconfig/httpcaddyfile/tlsapp.go:36
httpcaddyfile.parseTLS (cyclomatic 121)caddyconfig/httpcaddyfile/builtins.go:119
HTTPTransport.UnmarshalCaddyfile (cyclomatic 104)modules/caddyhttp/reverseproxy/caddyfile.go:1079

+ 125 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 15 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Handler.UnmarshalCaddyfile (cyclomatic 255), ServerType.serversFromPairings (cyclomatic 131), ServerType.buildTLSApp (cyclomatic 124). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 15 together lifts Cyclomatic Complexity from 2.0 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

216 method(s) exceeded the cognitive complexity threshold of 15; the worst was Handler.UnmarshalCaddyfile at 559.

Handler.UnmarshalCaddyfile (cognitive 559)modules/caddyhttp/reverseproxy/caddyfile.go:152
ServerType.serversFromPairings (cognitive 356)REDACTED:566
ServerType.buildTLSApp (cognitive 311)caddyconfig/httpcaddyfile/tlsapp.go:36
httpcaddyfile.unmarshalCaddyfileServerOptions (cognitive 240)caddyconfig/httpcaddyfile/serveroptions.go:73
lexer.next (cognitive 227)caddyconfig/caddyfile/lexer.go:173

+ 211 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 216 bodies over 15 down to 15 or less in Cognitive Complexity — start with Handler.UnmarshalCaddyfile (cognitive 559), ServerType.serversFromPairings (cognitive 356), ServerType.buildTLSApp (cognitive 311). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 216 together lifts Cognitive Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.5 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Prevented

57 god class(es) detected.

MethodTooLong: Handler.UnmarshalCaddyfile · ×20modules/caddyhttp/reverseproxy/caddyfile.go:152
FileTooLong: reverseproxy/caddyfile.go · ×16modules/caddyhttp/reverseproxy/caddyfile.go
FunctionTooLong: httpcaddyfile.parseTLS · ×9caddyconfig/httpcaddyfile/builtins.go:119
TooManyMethods: Server · ×5modules/caddyhttp/server.go:49
ClassTooLong: Handler · ×4modules/caddyhttp/reverseproxy/reverseproxy.go:107

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 20 MethodTooLong finding(s) in God Classes — start with caddyfile.go (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (20 warning-level).
  2. Resolve the 16 FileTooLong finding(s) in God Classes — start with caddyfile.go, reverseproxy.go, REDACTED. — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 9 FunctionTooLong finding(s) in God Classes — start with builtins.go (2), caddyfile.go (2), serveroptions.go. — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.1 / 10Stronggated by 129 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Verified

127 duplicated block group(s) detected. A further 2 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (11 lines × 2) · ×14caddyconfig/caddyfile/formatter.go:468
Duplicated block (10 lines × 2) · ×13modules/caddyhttp/reverseproxy/caddyfile.go:1343
Duplicated block (8 lines × 2) · ×10REDACTED:576
Duplicated block (12 lines × 2) · ×8REDACTED:771
Duplicated block (9 lines × 2) · ×6modules/caddyhttp/reverseproxy/command.go:186

+ 44 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 14 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with caddyfile.go (4), builtins.go (2), matchers.go (2). — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 13 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with caddyfile.go (3), healthchecks.go (2), acmeissuer.go (2). — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 10 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with caddyfile.go (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

3 of 177 classes have LCOM4 above 3.

Low cohesion: Server (LCOM4 6) · ×3modules/caddyhttp/server.go:49

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with server.go, tplcontext.go, directives.go. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

922 test methods: 789 unit, 133 integration, 0 BDD, 0 e2e. The Go suite contributes 922 test case(s) across 158 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 2 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). Go (github.com/caddyserver/caddy/v2): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene8.4 7.8 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 93% · ceiling Verified

22 outdated, 0 author-deprecated direct Go module(s), 2 pinning or checksum defect(s). 55 of 55 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Dependency pinned to a stale untagged commit: github.com/aryann/difflib · ×2
Outdated: github.com/DeRuina/timberjack · ×22

What to do

  1. Resolve the 2 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

3 secret(s) detected.

REDACTED

What to do

  1. Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 166 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included. 1 of them carry no licence file that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.4 / 10Strong✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: modules/caddyhttp/reverseproxy/reverseproxy.go (15×49=735); modules/caddyhttp/server.go (14×47=658); REDACTED (5×131=655)

Hotspot: modules/caddyhttp/reverseproxy/reverseproxy.go · ×20modules/caddyhttp/reverseproxy/reverseproxy.go:308

What to do

  1. Resolve the 20 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), reverseproxy.go, server.go. — One of this dimension's main actionable groups (20 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

9 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is modules/caddytls/sessiontickets.go. Counted over 162 of the 227 production source files in this repository: 62 are under the ~2,400-byte size floor this dimension measures over, and the remaining 3 have no attributable history left to measure.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 79 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

79 deducted task-comment markers across 66510 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×79REDACTED:491

What to do

  1. Resolve the 79 TodoComment finding(s) in Explicit Debt — start with REDACTED (8), server.go (7), REDACTED (7). — One of this dimension's main actionable groups (79 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityAdequate◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Adequate / 10 · rule-coverage 100% · ceiling Documented

The repository's root README is a well-designed landing page with branding, links to releases, documentation, and community, plus an overview of the project (Every site on HTTPS). It also includes a clipped architecture/design docs section. The modules/caddyhttp/encode/testdata/README documents only its own directory, not the repository.

What to do

  1. Improve Documentation Quality — currently 5.0/10. — The repository's root README is a well-designed landing page with branding, links to releases, documentation, and community, plus an overview of the project (Every site on HTTPS). It also includes a clipped architecture/design docs section. The modules/caddyhttp/encode/testdata/README documents only its own directory, not the repository.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Go) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)4.0 / 10Weak✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 4.0 / 10 · rule-coverage 100% · ceiling Documented

6 finding(s): 0 critical, 6 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 6 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.1 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.1 / 10 · rule-coverage 100% · ceiling Documented

72 finding(s): 0 critical, 17 high, 41 medium, 14 low. semgrep hit a parse error in 1 file(s) — `REDACTED` (lines 1–935, line 1091, lines 1097–1101, …) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 15 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities9.4 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

3 finding(s): 0 critical, 0 high, 3 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.3 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

12 of 165 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is modules/caddyhttp/caddyauth/argon2id.go. Counted over 165 of the 227 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×12modules/caddyhttp/caddyauth/argon2id.go:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.9 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: directives.go↔imports.go 54%

Boundary-crossing change coupling: directives.go ↔ imports.gocaddyconfig/httpcaddyfile/directives.go:1

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with directives.go. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

3/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (.github/SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. — REDACTED:31

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels4.2 / 10Weak✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×9) — REDACTED:861, REDACTED:871, REDACTED:881, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — REDACTED:991

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure5.2 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — REDACTED:0

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×2) — REDACTED:814, REDACTED:822

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy9.6 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README.md changes into `caddy/cmd/caddy/`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:116

What to do

  • Reconcile the README with reality: README.md changes into `caddy/cmd/caddy/`, but no such folder exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P2 · Observability9.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — cmd/commandfuncs.go:1007
  • `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:298

What to do

  • Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF2 · Allocation hygiene6.6 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 86 use(s) across 74,826 production line(s) (~1.1/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `issue_7557_invalid_subdirective_snippet.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — caddytest/integration/testdata/issue_7557_invalid_subdirective_snippet.conf:4

What to do

  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation7.5 / 10Strong✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 7/12 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `reuseUnixSocket` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — listen_reuseUnixSocket_windows.go:32
  • `downloadBuild` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:292
  • `cmdRun` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — cmd/commandfuncs.go:189
  • `AdminAPIRequest` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — cmd/commandfuncs.go:950
  • `dial` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — modules/logging/netwriter.go:217

What to do

  • Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.1 / 10Strong✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×39) — listeners_fuzz.go:21, duration_fuzz.go:21, REDACTED:352, …
  • `if err := ctx.Err(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — modules/caddyhttp/fileserver/browsetplcontext.go:54

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health69%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture89%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity63%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness62%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security76%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility33%Weak — gated by AC1, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance78%StrongStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 55 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — `go` is not on PATH — this repository boots from its toolchain's own run entry point ('github.com/go-chi/chi' required by REDACTED, and cmd/caddy is the module's only package main), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~48382 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.go), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Not applicable — this Go build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 strongly-typed id(s); 4 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 CQRS handler(s))
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X13 Undrained process stream — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X19 Unrestored process-global state — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Go's `++`, `--` and assignments are STATEMENTS, not expressions, so none of them can appear in a `case` expression or anywhere else in a condition, and a type switch's cases are types. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X23 Unguarded diagnostic materialisation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — Not applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Go's type system has no nullable and non-nullable types — every pointer, map, slice and interface is nil-able at every position, there is no switch that turns null checking on, and the compiler produces no nullability warning for an operator to silence. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 39 finding(s)
AC2 · Forms & labels · Link with no accessible name · ×9
  • Link with no accessible name REDACTED:861 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:871 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:881 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:892 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:902 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:912 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:941 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:948 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:955 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
D28 · Secrets (history) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
AC1 · Text alternatives · <img> without a text alternative · ×1
  • <img> without a text alternative REDACTED:31 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC2 · Forms & labels · <input> without a programmatic label · ×1
  • <input> without a programmatic label REDACTED:991 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang REDACTED — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: directives.go ↔ imports.go caddyconfig/httpcaddyfile/directives.go:1 — `caddyconfig/httpcaddyfile/directives.go` (context caddyconfig) and `modules/caddyhttp/standard/imports.go` (context caddyhttp) sit in DIFFERENT parts of the tree yet change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `0cf03d32` caddyhttp: mitigate slowloris via idle read/write deadlines (#7913); `fb63e2e4` caddyhttp: New experimental handler for intercepting responses (#6232); `0d44e3ec` logging: Implement `log_append` handler (#6066) — run `git show` on any of them.
Serious — 731 finding(s)
D17 · Explicit Debt · TodoComment · ×79
  • TodoComment REDACTED:491 — // TODO: make tunable? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:516 — // TODO: figure out when to close the listener and the transport — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment listen_unix.go:180 — // TODO: Not 100% sure this is necessary, but we do this for net.UnixListener, so... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddy.go:470 — // TODO: This event is experimental and subject to change. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddy.go:727 — // TODO: This event is experimental and subject to change. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/caddyfile/importargs.go:101 — // TODO: Remove the deprecated {args.*} placeholder — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/caddyfile/adapter.go:68 — // TODO: also perform this check on imported files — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/httpcaddyfile/serveroptions.go:67 — // TODO: EXPERIMENTAL — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/httpcaddyfile/serveroptions.go:484 — // TODO: THIS IS EXPERIMENTAL (MAY 2024) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:689 — // TODO: we could pre-process the specificities for efficiency, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:1105 — // TODO: maybe a smarter way to handle this might be to just make the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/httpcaddyfile/directives.go:56 — // TODO: deprecated, renamed to log_skip — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddyconfig/httpcaddyfile/directives.go:75 — // TODO: deprecated, renamed to basic_auth — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment caddytest/integration/caddyfile_test.go:524 — // TODO: Test each http version separately (especially http/3) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:166 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:184 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:213 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:243 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:1547 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:114 — // TODO: This is an EXPERIMENTAL feature. Subject to change or removal. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:452 — // TODO: Experimental (Nov. 2023) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/server.go:1008 — // TODO: support port ranges — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:259 — // TODO: Update this comment, it seems we've moved the copy into the handler? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:463 — // TODO: Is this used? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment modules/caddyhttp/replacer_test.go:227 — // not ideal, but also most correct, given that files can have dots (example: index.<SHA>.html) TODO: maybe this isn't right.. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 54 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×40
  • Swallowed exception (caught, then discarded) listeners_fuzz.go:21 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) duration_fuzz.go:21 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:352 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:800 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:984 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) caddyconfig/caddyfile/lexer_fuzz.go:21 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:995 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:1854 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:1859 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:234 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:239 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:244 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:436 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/bindcap_linux.go:88 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:988 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1004 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1013 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1161 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1360 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1864 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1872 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1924 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1933 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1954 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) modules/caddyhttp/server.go:1963 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 15 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×20
  • Hotspot: modules/caddyhttp/reverseproxy/reverseproxy.go modules/caddyhttp/reverseproxy/reverseproxy.go:308 — modules/caddyhttp/reverseproxy/reverseproxy.go changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in Handler.Provision at line 308. 2 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/reverseproxy/reverseproxy.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/server.go modules/caddyhttp/server.go:598 — modules/caddyhttp/server.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in Server.ServeHTTP at line 598. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/server.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:566 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 131 in ServerType.serversFromPairings at line 566. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/reverseproxy/caddyfile.go modules/caddyhttp/reverseproxy/caddyfile.go:152 — modules/caddyhttp/reverseproxy/caddyfile.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 255 in Handler.UnmarshalCaddyfile at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/reverseproxy/caddyfile.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:188 — REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in App.Provision at line 188. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:322 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in FileServer.ServeHTTP at line 322. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/httpcaddyfile/serveroptions.go caddyconfig/httpcaddyfile/serveroptions.go:73 — caddyconfig/httpcaddyfile/serveroptions.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in httpcaddyfile.unmarshalCaddyfileServerOptions at line 73. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/httpcaddyfile/serveroptions.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/replacer.go modules/caddyhttp/replacer.go:59 — modules/caddyhttp/replacer.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in caddyhttp.addHTTPVarsToReplacer at line 59. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/replacer.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/caddyfile/lexer.go caddyconfig/caddyfile/lexer.go:173 — caddyconfig/caddyfile/lexer.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in lexer.next at line 173. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/caddyfile/lexer.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/httpcaddyfile/tlsapp.go caddyconfig/httpcaddyfile/tlsapp.go:36 — caddyconfig/httpcaddyfile/tlsapp.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in ServerType.buildTLSApp at line 36. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/httpcaddyfile/tlsapp.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:207 — REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in HTTPTransport.NewTransport at line 207. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/caddyfile/formatter.go caddyconfig/caddyfile/formatter.go:486 — caddyconfig/caddyfile/formatter.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in caddyfile.formatTokens at line 486. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/caddyfile/formatter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/rewrite/rewrite.go modules/caddyhttp/rewrite/rewrite.go:158 — modules/caddyhttp/rewrite/rewrite.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Rewrite.Rewrite at line 158. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/rewrite/rewrite.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/caddyfile/parse.go caddyconfig/caddyfile/parse.go:375 — caddyconfig/caddyfile/parse.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in parser.doImport at line 375. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/caddyfile/parse.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/reverseproxy/healthchecks.go modules/caddyhttp/reverseproxy/healthchecks.go:391 — modules/caddyhttp/reverseproxy/healthchecks.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Handler.doActiveHealthCheck at line 391. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/reverseproxy/healthchecks.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:265 — modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Transport.buildEnv at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/caddyhttp/fileserver/browsetplcontext.go modules/caddyhttp/fileserver/browsetplcontext.go:229 — modules/caddyhttp/fileserver/browsetplcontext.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in browseTemplateContext.applySortAndLimit at line 229. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/caddyhttp/fileserver/browsetplcontext.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: caddyconfig/httpcaddyfile/directives.go caddyconfig/httpcaddyfile/directives.go:456 — caddyconfig/httpcaddyfile/directives.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in httpcaddyfile.sortRoutes at line 456. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- caddyconfig/httpcaddyfile/directives.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: modules/logging/filewriter.go modules/logging/filewriter.go:187 — modules/logging/filewriter.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in FileWriter.OpenWriter at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- modules/logging/filewriter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:219 — REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in App.Emit at line 219. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 16:28:55 +10:00' --until='2026-10-23 16:28:55 +10:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D29 · Static Analysis (SAST) · REDACTED · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · MethodTooLong · ×20
  • MethodTooLong: Handler.UnmarshalCaddyfile modules/caddyhttp/reverseproxy/caddyfile.go:152 — MethodTooLong — UnmarshalCaddyfile runs 544 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 444 over it, 5.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ServerType.serversFromPairings REDACTED:566 — MethodTooLong — serversFromPairings runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HTTPTransport.UnmarshalCaddyfile modules/caddyhttp/reverseproxy/caddyfile.go:1079 — MethodTooLong — UnmarshalCaddyfile runs 246 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ServerType.buildTLSApp caddyconfig/httpcaddyfile/tlsapp.go:36 — MethodTooLong — buildTLSApp runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HTTPTransport.NewTransport REDACTED:207 — MethodTooLong — NewTransport runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.automaticHTTPSPhase1 modules/caddyhttp/autohttps.go:77 — MethodTooLong — automaticHTTPSPhase1 runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: lexer.next caddyconfig/caddyfile/lexer.go:173 — MethodTooLong — next runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ServerType.Setup REDACTED:59 — MethodTooLong — Setup runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ACMEIssuer.UnmarshalCaddyfile modules/caddytls/acmeissuer.go:448 — MethodTooLong — UnmarshalCaddyfile runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FileServer.ServeHTTP REDACTED:322 — MethodTooLong — ServeHTTP runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.ServeHTTP modules/caddyhttp/server.go:598 — MethodTooLong — ServeHTTP runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MatchFile.selectFile modules/caddyhttp/fileserver/matcher.go:333 — MethodTooLong — selectFile runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TLS.Provision REDACTED:166 — MethodTooLong — Provision runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.Provision REDACTED:188 — MethodTooLong — Provision runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FileWriter.UnmarshalCaddyfile modules/logging/filewriter.go:387 — MethodTooLong — UnmarshalCaddyfile runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TLS.publishECHConfigs REDACTED:333 — MethodTooLong — publishECHConfigs runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Handler.Provision modules/caddyhttp/reverseproxy/reverseproxy.go:308 — MethodTooLong — Provision runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.Start REDACTED:480 — MethodTooLong — Start runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Handler.doActiveHealthCheck modules/caddyhttp/reverseproxy/healthchecks.go:391 — MethodTooLong — doActiveHealthCheck runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Handler.reverseProxy modules/caddyhttp/reverseproxy/reverseproxy.go:1176 — MethodTooLong — reverseProxy runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D3 · God Classes · FileTooLong · ×16
  • FileTooLong: reverseproxy/caddyfile.go modules/caddyhttp/reverseproxy/caddyfile.go — FileTooLong — 1054 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 554 over it, 2.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: reverseproxy/reverseproxy.go modules/caddyhttp/reverseproxy/reverseproxy.go — FileTooLong — 1032 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: Handler (20 blocks, 107-2219). The bar is 500 significant lines; this is 532 over it, 2.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: ServerType (5 blocks, 59-1699). The bar is 500 significant lines; this is 519 over it, 2.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: caddyhttp/server.go modules/caddyhttp/server.go — FileTooLong — 894 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: Server (40 blocks, 49-1781). The bar is 500 significant lines; this is 394 over it, 1.79× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: caddyhttp/matchers.go modules/caddyhttp/matchers.go — FileTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 369 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ./REDACTED REDACTED — FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 264 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: httpcaddyfile/builtins.go caddyconfig/httpcaddyfile/builtins.go — FileTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 232 over it, 1.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: httpcaddyfile/tlsapp.go caddyconfig/httpcaddyfile/tlsapp.go — FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 164 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: cmd/commandfuncs.go cmd/commandfuncs.go — FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 140 over it, 1.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 125 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ./caddy.go caddy.go — FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 124 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 83 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: TLS (22 blocks, 54-1090). The bar is 500 significant lines; this is 60 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: logging/filters.go modules/logging/filters.go — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 52 over it, 1.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9 over it, 1.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×14
  • Duplicated block (11 lines × 2) caddyconfig/caddyfile/formatter.go:468 — caddyconfig/caddyfile/formatter.go:468-478 | caddyconfig/caddyfile/lexer.go:636-649 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) caddyconfig/httpcaddyfile/builtins.go:348 — caddyconfig/httpcaddyfile/builtins.go:348-358 | caddyconfig/httpcaddyfile/builtins.go:437-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/builtins.go:348` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:694 — REDACTED:694-704 | REDACTED:705-715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) cmd/commandfuncs.go:747 — cmd/commandfuncs.go:747-757 | cmd/commandfuncs.go:789-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/commandfuncs.go:747` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/caddyhttp/matchers.go:1536 — modules/caddyhttp/matchers.go:1536-1546 | REDACTED:445-455 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/matchers.go:1536` it does not close everything it opens, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (11 lines × 2) modules/caddyhttp/matchers.go:1713 — modules/caddyhttp/matchers.go:1713-1723 | REDACTED:1129-1139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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.
  • Duplicated block (11 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:452 — modules/caddyhttp/reverseproxy/caddyfile.go:452-462 | modules/caddyhttp/reverseproxy/caddyfile.go:468-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:528 — modules/caddyhttp/reverseproxy/caddyfile.go:528-538 | modules/caddyhttp/reverseproxy/caddyfile.go:544-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:560 — modules/caddyhttp/reverseproxy/caddyfile.go:560-570 | modules/caddyhttp/reverseproxy/caddyfile.go:592-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) modules/caddypki/acmeserver/caddyfile.go:93 — modules/caddypki/acmeserver/caddyfile.go:93-103 | modules/caddypki/acmeserver/caddyfile.go:112-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddypki/acmeserver/caddyfile.go:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:543 — REDACTED:543-553 | REDACTED:914-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) context.go:429 — context.go:429-440 | context.go:444-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `context.go:429` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) caddyconfig/httpcaddyfile/builtins.go:1111 — caddyconfig/httpcaddyfile/builtins.go:1111-1121 | caddyconfig/httpcaddyfile/builtins.go:1130-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/builtins.go:1111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (11 lines × 2) modules/caddyhttp/ip_matchers.go:83 — modules/caddyhttp/ip_matchers.go:83-93 | modules/caddyhttp/ip_matchers.go:196-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/ip_matchers.go:83` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×13
  • Duplicated block (10 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:1343 — modules/caddyhttp/reverseproxy/caddyfile.go:1343-1352 | modules/caddyhttp/reverseproxy/caddyfile.go:1356-1365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) modules/caddyhttp/reverseproxy/healthchecks.go:272 — modules/caddyhttp/reverseproxy/healthchecks.go:272-281 | modules/caddyhttp/reverseproxy/healthchecks.go:300-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — 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.
  • Duplicated block (10 lines × 2) modules/caddyhttp/staticerror.go:63 — modules/caddyhttp/staticerror.go:63-72 | modules/caddyhttp/staticresp.go:142-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/staticerror.go:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddytls/acmeissuer.go:547 — modules/caddytls/acmeissuer.go:547-556 | modules/caddytls/acmeissuer.go:563-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) modules/caddytls/matchers.go:334 — modules/caddytls/matchers.go:334-343 | modules/caddytls/matchers.go:458-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) REDACTED:419 — REDACTED:419-428 | REDACTED:954-963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:953` calls `keepStorageClean` and `REDACTED:417` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) modules/caddyhttp/proxyprotocol/module.go:46 — modules/caddyhttp/proxyprotocol/module.go:46-56 | modules/logging/netwriter.go:126-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/proxyprotocol/module.go:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddytls/acmeissuer.go:605 — modules/caddytls/acmeissuer.go:605-614 | modules/caddytls/acmeissuer.go:657-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/acmeissuer.go:605` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddytls/zerosslissuer.go:188 — modules/caddytls/zerosslissuer.go:188-197 | modules/caddytls/zerosslissuer.go:231-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/zerosslissuer.go:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:467 — modules/caddyhttp/reverseproxy/caddyfile.go:467-476 | modules/caddyhttp/reverseproxy/caddyfile.go:483-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:427 — modules/caddyhttp/reverseproxy/caddyfile.go:427-436 | modules/caddyhttp/reverseproxy/caddyfile.go:503-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:427` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) modules/caddyhttp/reverseproxy/healthchecks.go:510 — modules/caddyhttp/reverseproxy/healthchecks.go:510-519 | modules/caddyhttp/reverseproxy/healthchecks.go:556-565 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (10 lines × 2) REDACTED:425 — REDACTED:425-434 | REDACTED:439-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×10
  • Duplicated block (8 lines × 2) REDACTED:576 — REDACTED:576-583 | REDACTED:1167-1174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:1111 — modules/caddyhttp/reverseproxy/caddyfile.go:1111-1118 | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:100-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:1111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/caddytls/fileloader.go:35 — modules/caddytls/fileloader.go:35-42 | modules/caddytls/pemloader.go:35-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/fileloader.go:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:1028 — REDACTED:1028-1037 | REDACTED:1046-1053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1028` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:274 — modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:274-281 | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:285-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:442 — REDACTED:442-449 | REDACTED:965-972 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — 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 `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — 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.
  • Duplicated block (8 lines × 2) modules/caddyhttp/reverseproxy/healthchecks.go:274 — modules/caddyhttp/reverseproxy/healthchecks.go:274-281 | modules/caddyhttp/reverseproxy/healthchecks.go:614-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/healthchecks.go:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/caddyhttp/server.go:902 — modules/caddyhttp/server.go:902-909 | modules/caddyhttp/server.go:917-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/server.go:902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:1182 — modules/caddyhttp/reverseproxy/caddyfile.go:1182-1189 | modules/caddyhttp/reverseproxy/caddyfile.go:1594-1601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:1182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:1103 — modules/caddyhttp/reverseproxy/caddyfile.go:1103-1110 | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:92-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:1103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×9
  • FunctionTooLong: httpcaddyfile.parseTLS caddyconfig/httpcaddyfile/builtins.go:119 — FunctionTooLong — parseTLS runs 321 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: httpcaddyfile.unmarshalCaddyfileServerOptions caddyconfig/httpcaddyfile/serveroptions.go:73 — FunctionTooLong — unmarshalCaddyfileServerOptions runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: caddyhttp.addHTTPVarsToReplacer modules/caddyhttp/replacer.go:59 — FunctionTooLong — addHTTPVarsToReplacer runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: caddycmd.init cmd/commands.go:95 — FunctionTooLong — init runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: httpcaddyfile.parseLogHelper caddyconfig/httpcaddyfile/builtins.go:942 — FunctionTooLong — parseLogHelper runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: fastcgi.parsePHPFastCGI modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:172 — FunctionTooLong — parsePHPFastCGI runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: reverseproxy.cmdReverseProxy modules/caddyhttp/reverseproxy/command.go:87 — FunctionTooLong — cmdReverseProxy runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: caddy.unsyncedConfigAccess REDACTED:1180 — FunctionTooLong — unsyncedConfigAccess runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: forwardauth.parseCaddyfile modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go:64 — FunctionTooLong — parseCaddyfile runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) REDACTED:771 — REDACTED:771-782 | modules/caddyhttp/fileserver/matcher.go:676-687 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) modules/caddyhttp/matchers.go:1322 — modules/caddyhttp/matchers.go:1322-1333 | modules/caddyhttp/vars.go:396-407 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/matchers.go:1322` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) modules/caddyhttp/matchers.go:1349 — modules/caddyhttp/matchers.go:1349-1360 | modules/caddyhttp/vars.go:423-434 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/matchers.go:1349` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) modules/caddyhttp/replacer.go:337 — modules/caddyhttp/replacer.go:337-348 | modules/caddyhttp/replacer.go:358-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/replacer.go:337` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/caddyhttp/replacer.go:357` calls `Context`, `Value` and `modules/caddyhttp/replacer.go:336` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) modules/caddytls/acmeissuer.go:652 — modules/caddytls/acmeissuer.go:652-663 | modules/caddytls/zerosslissuer.go:226-237 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/acmeissuer.go:652` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (12 lines × 2) REDACTED:237 — REDACTED:237-248 | REDACTED:322-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:432 — REDACTED:432-443 | REDACTED:694-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) caddyconfig/httpcaddyfile/options.go:205 — caddyconfig/httpcaddyfile/options.go:205-216 | caddyconfig/httpcaddyfile/options.go:467-478 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/options.go:205` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×6
  • Duplicated block (9 lines × 2) modules/caddyhttp/reverseproxy/command.go:186 — modules/caddyhttp/reverseproxy/command.go:186-194 | modules/caddyhttp/reverseproxy/command.go:208-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/command.go:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) modules/caddytls/leafpemloader.go:38 — modules/caddytls/leafpemloader.go:38-46 | modules/caddytls/leafstorageloader.go:74-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/leafstorageloader.go:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) modules/caddytls/matchers.go:360 — modules/caddytls/matchers.go:360-368 | modules/caddytls/matchers.go:476-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/matchers.go:360` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:311 — modules/caddyhttp/reverseproxy/caddyfile.go:311-319 | modules/caddyhttp/reverseproxy/caddyfile.go:324-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (9 lines × 2) caddyconfig/httpcaddyfile/builtins.go:363 — caddyconfig/httpcaddyfile/builtins.go:363-371 | caddyconfig/httpcaddyfile/builtins.go:413-421 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (9 lines × 2) modules/caddyhttp/reverseproxy/healthchecks.go:467 — modules/caddyhttp/reverseproxy/healthchecks.go:467-475 | modules/caddyhttp/reverseproxy/healthchecks.go:488-496 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) context.go:509 — context.go:509-515 | context.go:537-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `context.go:507` calls `App` and `context.go:535` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:494 — modules/caddyhttp/reverseproxy/caddyfile.go:494-500 | modules/caddyhttp/reverseproxy/caddyfile.go:619-625 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (7 lines × 2) modules/caddyhttp/rewrite/rewrite.go:718 — modules/caddyhttp/rewrite/rewrite.go:718-724 | modules/caddyhttp/rewrite/rewrite.go:733-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/rewrite/rewrite.go:718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/caddyhttp/rewrite/rewrite.go:742` calls `ReplaceAll` and `modules/caddyhttp/rewrite/rewrite.go:725` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) caddyconfig/httpcaddyfile/serveroptions.go:147 — caddyconfig/httpcaddyfile/serveroptions.go:147-153 | caddyconfig/httpcaddyfile/serveroptions.go:185-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/serveroptions.go:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) modules/caddyhttp/timeouts/caddyfile.go:41 — modules/caddyhttp/timeouts/caddyfile.go:41-47 | modules/caddyhttp/timeouts/caddyfile.go:59-65 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (7 lines × 2) REDACTED:793 — REDACTED:793-799 | REDACTED:838-844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:793` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · TooManyMethods · ×5
  • TooManyMethods: Server modules/caddyhttp/server.go:49 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dispenser caddyconfig/caddyfile/dispenser.go:29 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Handler modules/caddyhttp/reverseproxy/reverseproxy.go:107 — TooManyMethods — 32 methods, declared across 5 files: reverseproxy/reverseproxy.go (20), REDACTED (5), reverseproxy/healthchecks.go (4), reverseproxy/caddyfile.go (2), +1 more file(s). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FilterEncoder REDACTED:40 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppendEncoder modules/logging/appendencoder.go:44 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) caddyconfig/httpcaddyfile/options.go:76 — caddyconfig/httpcaddyfile/options.go:76-88 | caddyconfig/httpcaddyfile/options.go:91-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) REDACTED:77 — REDACTED:77-89 | REDACTED:105-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:515 — REDACTED:515-527 | REDACTED:538-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:515` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:576 — modules/caddyhttp/reverseproxy/caddyfile.go:576-588 | modules/caddyhttp/reverseproxy/caddyfile.go:630-642 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (13 lines × 2) REDACTED:1012 — REDACTED:1012-1024 | REDACTED:1030-1042 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×5
  • Duplicated block (10 lines × 3) modules/caddyhttp/matchers.go:880 — modules/caddyhttp/matchers.go:880-889 | modules/caddyhttp/matchers.go:1353-1362 | modules/caddyhttp/vars.go:427-436 — there are 3 copies across 2 file(s) — 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 `modules/caddyhttp/matchers.go:880` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) REDACTED:501 — REDACTED:501-510 | REDACTED:582-591 | REDACTED:666-675 — 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 — 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 `REDACTED:501` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (10 lines × 3) modules/caddyhttp/reverseproxy/caddyfile.go:357 — modules/caddyhttp/reverseproxy/caddyfile.go:357-366 | modules/caddyhttp/reverseproxy/caddyfile.go:439-448 | modules/caddyhttp/reverseproxy/caddyfile.go:451-460 — 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 — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/caddyhttp/reverseproxy/caddyfile.go:368` calls `Log`, `Named`, `Warn` and `modules/caddyhttp/reverseproxy/caddyfile.go:451` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) modules/caddyhttp/reverseproxy/caddyfile.go:1204 — modules/caddyhttp/reverseproxy/caddyfile.go:1204-1213 | modules/caddyhttp/reverseproxy/caddyfile.go:1567-1576 | modules/caddyhttp/reverseproxy/caddyfile.go:1667-1676 — 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 — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:1204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) modules/caddyhttp/reverseproxy/caddyfile.go:345 — modules/caddyhttp/reverseproxy/caddyfile.go:345-354 | modules/caddyhttp/reverseproxy/caddyfile.go:357-366 | modules/caddyhttp/reverseproxy/caddyfile.go:439-448 — 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 — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/caddyhttp/reverseproxy/caddyfile.go:368` calls `Log`, `Named`, `Warn` and `modules/caddyhttp/reverseproxy/caddyfile.go:357` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X2 · Cancellation propagation · Function without context.Context · ×5
  • Function without context.Context: reuseUnixSocket listen_reuseUnixSocket_windows.go:32 — `reuseUnixSocket` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: downloadBuild REDACTED:292 — `downloadBuild` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: cmdRun cmd/commandfuncs.go:189 — `cmdRun` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: AdminAPIRequest cmd/commandfuncs.go:950 — `AdminAPIRequest` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: dial modules/logging/netwriter.go:217 — `dial` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: Handler modules/caddyhttp/reverseproxy/reverseproxy.go:107 — ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, 20 blocks, lines 107-2219. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Server modules/caddyhttp/server.go:49 — ClassTooLong — 684 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods, 40 blocks, lines 49-1781. The bar is 400 significant lines; this is 284 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ServerType REDACTED:56 — ClassTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods, 5 blocks, lines 59-1699. The bar is 400 significant lines; this is 210 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TLS REDACTED:54 — ClassTooLong — 486 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods, 22 blocks, lines 54-1090. The bar is 400 significant lines; this is 86 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) caddyconfig/httpcaddyfile/builtins.go:69 — caddyconfig/httpcaddyfile/builtins.go:69-85 | caddyconfig/httpcaddyfile/options.go:350-366 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/builtins.go:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (17 lines × 2) modules/caddytls/matchers.go:374 — modules/caddytls/matchers.go:374-390 | modules/caddytls/matchers.go:489-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) modules/logging/appendencoder.go:77 — modules/logging/appendencoder.go:77-93 | REDACTED:83-99 — before extracting anything, compare `modules/logging/appendencoder.go` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/logging/appendencoder.go:75` calls `NewReplacer` and `REDACTED:81` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) modules/logging/appendencoder.go:103 — modules/logging/appendencoder.go:103-119 | REDACTED:121-137 — before extracting anything, compare `modules/logging/appendencoder.go` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFields · ×3
  • TooManyFields: Server modules/caddyhttp/server.go:49 — TooManyFields — 71 stored fields beside 41 methods. The bar is 30 stored fields; this is 41 over it, 2.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Handler modules/caddyhttp/reverseproxy/reverseproxy.go:107 — TooManyFields — 35 stored fields beside 32 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: serverOptions caddyconfig/httpcaddyfile/serveroptions.go:32 — TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) modules/caddypki/command.go:109 — modules/caddypki/command.go:109-123 | modules/caddypki/command.go:178-192 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
  • Duplicated block (15 lines × 2) modules/caddytls/acmeissuer.go:620 — modules/caddytls/acmeissuer.go:620-634 | modules/caddytls/zerosslissuer.go:200-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/acmeissuer.go:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) REDACTED:270 — REDACTED:270-284 | REDACTED:355-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) REDACTED:537 — REDACTED:537-550 | REDACTED:617-630 | REDACTED:754-767 — 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 — 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 `REDACTED:537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:535` calls `Val` and `REDACTED:753` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 3) modules/caddypki/ca.go:111 — modules/caddypki/ca.go:111-124 | REDACTED:407-420 | modules/caddytls/leafstorageloader.go:58-71 — 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 — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (14 lines × 3) modules/logging/appendencoder.go:152 — modules/logging/appendencoder.go:152-165 | REDACTED:201-214 | modules/logging/journaldencoder.go:137-150 — before extracting anything, compare `modules/logging/appendencoder.go` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) context.go:233 — context.go:233-238 | context.go:251-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `context.go:233` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) modules/caddyhttp/matchers.go:1611 — modules/caddyhttp/matchers.go:1611-1616 | modules/caddytls/matchers.go:190-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) REDACTED:104 — REDACTED:104-109 | REDACTED:222-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) modules/caddyhttp/reverseproxy/command.go:190 — modules/caddyhttp/reverseproxy/command.go:190-194 | modules/caddyhttp/reverseproxy/command.go:212-216 | modules/caddyhttp/staticresp.go:375-379 — there are 3 copies across 2 file(s) — 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 `modules/caddyhttp/reverseproxy/command.go:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) REDACTED:271 — REDACTED:271-275 | REDACTED:109-113 | REDACTED:267-271 — there are 3 copies across 2 file(s) — 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 `REDACTED:271` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) modules/caddyhttp/server.go:896 — modules/caddyhttp/server.go:896-900 | modules/caddyhttp/server.go:911-915 | modules/caddyhttp/server.go:926-930 — 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 — resolving only two of them leaves the rest to drift apart the first time one is edited.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: Server (LCOM4 6) modules/caddyhttp/server.go:49 — Server's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: TemplateContext (LCOM4 6) modules/caddyhttp/templates/tplcontext.go:50 — TemplateContext's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Helper (LCOM4 4) caddyconfig/httpcaddyfile/directives.go:212 — Helper's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AC4 · Keyboard semantics · Anchor without href · ×2
  • Anchor without href REDACTED:814 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href REDACTED:822 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×2
  • Dependency pinned to a stale untagged commit: github.com/aryann/difflib — Direct dependency `github.com/aryann/difflib` is required at `v0.0.0-20210328193216-ff5ff6dc229b` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2021-03-28, 5.6 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/aryann/difflib` and has not moved this requirement in 5.6 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/aryann/difflib` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/yuin/goldmark-highlighting/v2 — Direct dependency `github.com/yuin/goldmark-highlighting/v2` is required at `v2.0.0-20230729083705-37449abec8cc` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-29, 3.2 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/yuin/goldmark-highlighting/v2` and has not moved this requirement in 3.2 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/yuin/goldmark-highlighting/v2` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/caddyhttp/intercept/intercept.go:232 — modules/caddyhttp/intercept/intercept.go:232-294 | modules/caddyhttp/intercept/intercept.go:300-362 | modules/caddyhttp/reverseproxy/caddyfile.go:152-977 | modules/caddyhttp/reverseproxy/caddyfile.go:981-1043 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) modules/caddyhttp/matchers.go:843 — modules/caddyhttp/matchers.go:843-890 | modules/caddyhttp/matchers.go:1309-1363 | modules/caddyhttp/urlpatternmatcher.go:156-199 | modules/caddyhttp/vars.go:383-437 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) modules/caddyhttp/matchers.go:1215 — modules/caddyhttp/matchers.go:1215-1238 | modules/caddyhttp/vars.go:275-298 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/matchers.go:1215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/caddyhttp/matchers.go:1243` calls `Errf` and `modules/caddyhttp/vars.go:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (24 lines × 2) REDACTED:96 — REDACTED:96-119 | REDACTED:254-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) REDACTED:801 — REDACTED:801-820 | modules/caddyhttp/fileserver/matcher.go:706-725 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:537 — REDACTED:537-556 | REDACTED:617-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:537` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) REDACTED:825 — REDACTED:825-838 | modules/caddyhttp/fileserver/matcher.go:730-743 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) REDACTED:876 — REDACTED:876-889 | REDACTED:605-618 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `REDACTED:876` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) modules/caddyhttp/matchers.go:865 — modules/caddyhttp/matchers.go:865-875 | modules/caddyhttp/matchers.go:1337-1347 | modules/caddyhttp/vars.go:411-421 — there are 3 copies across 2 file(s) — 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 `modules/caddyhttp/matchers.go:865` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) REDACTED:156 — REDACTED:156-166 | REDACTED:433-443 | REDACTED:695-705 — 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 — 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 `REDACTED:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) modules/caddyhttp/matchers.go:882 — modules/caddyhttp/matchers.go:882-890 | modules/caddyhttp/matchers.go:1355-1363 | modules/caddyhttp/urlpatternmatcher.go:190-199 | modules/caddyhttp/vars.go:429-437 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/matchers.go:882` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
  • Duplicated block (9 lines × 4) caddyconfig/httpcaddyfile/builtins.go:290 — caddyconfig/httpcaddyfile/builtins.go:290-298 | caddyconfig/httpcaddyfile/builtins.go:306-314 | caddyconfig/httpcaddyfile/builtins.go:1113-1121 | caddyconfig/httpcaddyfile/builtins.go:1132-1140 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) modules/caddyhttp/matchers.go:864 — modules/caddyhttp/matchers.go:864-871 | modules/caddyhttp/matchers.go:1313-1320 | modules/caddyhttp/vars.go:387-394 — there are 3 copies across 2 file(s) — 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 `modules/caddyhttp/matchers.go:864` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) modules/logging/appendencoder.go:81 — modules/logging/appendencoder.go:81-89 | REDACTED:87-95 | modules/logging/journaldencoder.go:71-78 — before extracting anything, compare `modules/logging/appendencoder.go` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/logging/appendencoder.go:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) REDACTED:1776 — REDACTED:1776-1780 | REDACTED:1122-1127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `REDACTED:1776` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) caddyconfig/caddyfile/importargs.go:71 — caddyconfig/caddyfile/importargs.go:71-75 | caddyconfig/caddyfile/importargs.go:80-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/caddyfile/importargs.go:71` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) REDACTED:1432 — REDACTED:1432-1438 | REDACTED:967-976 | REDACTED:936-942 — 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 — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) REDACTED:215 — REDACTED:215-221 | modules/caddyhttp/ip_matchers.go:146-152 | modules/caddyhttp/ip_matchers.go:253-259 — there are 3 copies across 2 file(s) — 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) modules/caddyhttp/reverseproxy/caddyfile.go:1172 — modules/caddyhttp/reverseproxy/caddyfile.go:1172-1179 | modules/caddyhttp/reverseproxy/caddyfile.go:1584-1591 | modules/caddyhttp/reverseproxy/caddyfile.go:1684-1691 | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:90-97 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:1172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) modules/caddyhttp/reverseproxy/caddyfile.go:1164 — modules/caddyhttp/reverseproxy/caddyfile.go:1164-1171 | modules/caddyhttp/reverseproxy/caddyfile.go:1576-1583 | modules/caddyhttp/reverseproxy/caddyfile.go:1676-1683 | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:82-89 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:1164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×2
  • Outbound HTTP without resilience cmd/commandfuncs.go:1007 — `http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:298 — `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · Handler.UnmarshalCaddyfile (cyclomatic 255) · ×1
  • Handler.UnmarshalCaddyfile (cyclomatic 255) modules/caddyhttp/reverseproxy/caddyfile.go:152 — Handler.UnmarshalCaddyfile has cyclomatic complexity 255 (threshold 15). Of this number, 244 points are the body's 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.
D1 · Cyclomatic Complexity · ServerType.serversFromPairings (cyclomatic 131) · ×1
  • ServerType.serversFromPairings (cyclomatic 131) REDACTED:566 — ServerType.serversFromPairings has cyclomatic complexity 131 (threshold 15). Of this number, 114 points are the body's own statements and 17 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerType.buildTLSApp (cyclomatic 124) · ×1
  • ServerType.buildTLSApp (cyclomatic 124) caddyconfig/httpcaddyfile/tlsapp.go:36 — ServerType.buildTLSApp has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · httpcaddyfile.parseTLS (cyclomatic 121) · ×1
  • httpcaddyfile.parseTLS (cyclomatic 121) caddyconfig/httpcaddyfile/builtins.go:119 — 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.
D1 · Cyclomatic Complexity · HTTPTransport.UnmarshalCaddyfile (cyclomatic 104) · ×1
  • HTTPTransport.UnmarshalCaddyfile (cyclomatic 104) modules/caddyhttp/reverseproxy/caddyfile.go:1079 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.unmarshalCaddyfileServerOptions (cyclomatic 100) · ×1
  • httpcaddyfile.unmarshalCaddyfileServerOptions (cyclomatic 100) caddyconfig/httpcaddyfile/serveroptions.go:73 — httpcaddyfile.unmarshalCaddyfileServerOptions has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · caddyhttp.addHTTPVarsToReplacer (cyclomatic 94) · ×1
  • caddyhttp.addHTTPVarsToReplacer (cyclomatic 94) modules/caddyhttp/replacer.go:59 — caddyhttp.addHTTPVarsToReplacer has cyclomatic complexity 94 (threshold 15). Most of this is not in the body itself: 1 of the 94 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's 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.
D1 · Cyclomatic Complexity · lexer.next (cyclomatic 93) · ×1
  • lexer.next (cyclomatic 93) caddyconfig/caddyfile/lexer.go:173 — lexer.next has cyclomatic complexity 93 (threshold 15). Of this number, 92 points are the body's 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.
D1 · Cyclomatic Complexity · App.automaticHTTPSPhase1 (cyclomatic 78) · ×1
  • App.automaticHTTPSPhase1 (cyclomatic 78) modules/caddyhttp/autohttps.go:77 — App.automaticHTTPSPhase1 has cyclomatic complexity 78 (threshold 15). Of this number, 65 points are the body's 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.
D1 · Cyclomatic Complexity · ACMEIssuer.UnmarshalCaddyfile (cyclomatic 77) · ×1
  • ACMEIssuer.UnmarshalCaddyfile (cyclomatic 77) modules/caddytls/acmeissuer.go:448 — 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.
D1 · Cyclomatic Complexity · FileServer.ServeHTTP (cyclomatic 70) · ×1
  • FileServer.ServeHTTP (cyclomatic 70) REDACTED:322 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.consolidateConnPolicies (cyclomatic 68) · ×1
  • httpcaddyfile.consolidateConnPolicies (cyclomatic 68) REDACTED:1226 — httpcaddyfile.consolidateConnPolicies has cyclomatic complexity 68 (threshold 15). Of this number, 67 points are the body's 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.
D1 · Cyclomatic Complexity · ServerType.Setup (cyclomatic 68) · ×1
  • ServerType.Setup (cyclomatic 68) REDACTED:59 — ServerType.Setup has cyclomatic complexity 68 (threshold 15). Of this number, 63 points are the body's 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.
D1 · Cyclomatic Complexity · HTTPTransport.NewTransport (cyclomatic 64) · ×1
  • HTTPTransport.NewTransport (cyclomatic 64) REDACTED:207 — HTTPTransport.NewTransport has cyclomatic complexity 64 (threshold 15). Of this number, 38 points are the body's own statements and 26 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.
D1 · Cyclomatic Complexity · httpcaddyfile.parseLogHelper (cyclomatic 63) · ×1
  • httpcaddyfile.parseLogHelper (cyclomatic 63) caddyconfig/httpcaddyfile/builtins.go:942 — httpcaddyfile.parseLogHelper has cyclomatic complexity 63 (threshold 15). Of this number, 62 points are the body's 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.
D1 · Cyclomatic Complexity · caddyfile.formatTokens (cyclomatic 60) · ×1
  • caddyfile.formatTokens (cyclomatic 60) caddyconfig/caddyfile/formatter.go:486 — caddyfile.formatTokens has cyclomatic complexity 60 (threshold 15). Of this number, 59 points are the body's 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.
D1 · Cyclomatic Complexity · httpcaddyfile.fillInGlobalACMEDefaults (cyclomatic 55) · ×1
  • httpcaddyfile.fillInGlobalACMEDefaults (cyclomatic 55) caddyconfig/httpcaddyfile/tlsapp.go:570 — 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.
D1 · Cyclomatic Complexity · parser.doImport (cyclomatic 50) · ×1
  • parser.doImport (cyclomatic 50) caddyconfig/caddyfile/parse.go:375 — parser.doImport has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · App.Provision (cyclomatic 49) · ×1
  • App.Provision (cyclomatic 49) REDACTED:188 — App.Provision 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.
D1 · Cyclomatic Complexity · Handler.Provision (cyclomatic 49) · ×1
  • Handler.Provision (cyclomatic 49) modules/caddyhttp/reverseproxy/reverseproxy.go:308 — Handler.Provision 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.
D1 · Cyclomatic Complexity · reverseproxy.cmdReverseProxy (cyclomatic 48) · ×1
  • reverseproxy.cmdReverseProxy (cyclomatic 48) modules/caddyhttp/reverseproxy/command.go:87 — 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.
D1 · Cyclomatic Complexity · Server.ServeHTTP (cyclomatic 47) · ×1
  • Server.ServeHTTP (cyclomatic 47) modules/caddyhttp/server.go:598 — Server.ServeHTTP has cyclomatic complexity 47 (threshold 15). Of this number, 41 points are the body's 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.
D1 · Cyclomatic Complexity · FileWriter.UnmarshalCaddyfile (cyclomatic 46) · ×1
  • FileWriter.UnmarshalCaddyfile (cyclomatic 46) modules/logging/filewriter.go:387 — 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.
D1 · Cyclomatic Complexity · MatchFile.selectFile (cyclomatic 45) · ×1
  • MatchFile.selectFile (cyclomatic 45) modules/caddyhttp/fileserver/matcher.go:333 — MatchFile.selectFile has cyclomatic complexity 45 (threshold 15). Of this number, 32 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TLS.publishECHConfigs (cyclomatic 45) · ×1
  • TLS.publishECHConfigs (cyclomatic 45) REDACTED:333 — TLS.publishECHConfigs has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body's 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.
D1 · Cyclomatic Complexity · TLS.Provision (cyclomatic 45) · ×1
  • TLS.Provision (cyclomatic 45) REDACTED:166 — 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.
D1 · Cyclomatic Complexity · caddy.unsyncedConfigAccess (cyclomatic 44) · ×1
  • caddy.unsyncedConfigAccess (cyclomatic 44) REDACTED:1180 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.parsePKIApp (cyclomatic 42) · ×1
  • httpcaddyfile.parsePKIApp (cyclomatic 42) caddyconfig/httpcaddyfile/pkiapp.go:56 — 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.
D1 · Cyclomatic Complexity · FileServer.UnmarshalCaddyfile (cyclomatic 40) · ×1
  • FileServer.UnmarshalCaddyfile (cyclomatic 40) modules/caddyhttp/fileserver/caddyfile.go:67 — FileServer.UnmarshalCaddyfile has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Rewrite.Rewrite (cyclomatic 40) · ×1
  • Rewrite.Rewrite (cyclomatic 40) modules/caddyhttp/rewrite/rewrite.go:158 — Rewrite.Rewrite has cyclomatic complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · App.createAutomationPolicies (cyclomatic 39) · ×1
  • App.createAutomationPolicies (cyclomatic 39) modules/caddyhttp/autohttps.go:597 — 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.
D1 · Cyclomatic Complexity · HeaderOps.ApplyTo (cyclomatic 39) · ×1
  • HeaderOps.ApplyTo (cyclomatic 39) modules/caddyhttp/headers/headers.go:234 — HeaderOps.ApplyTo 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.
D1 · Cyclomatic Complexity · caddyhttp.getTLSReplacement (cyclomatic 37) · ×1
  • caddyhttp.getTLSReplacement (cyclomatic 37) modules/caddyhttp/replacer.go:491 — caddyhttp.getTLSReplacement has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · App.Start (cyclomatic 37) · ×1
  • App.Start (cyclomatic 37) REDACTED:480 — App.Start has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's 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.
D1 · Cyclomatic Complexity · fastcgi.parsePHPFastCGI (cyclomatic 36) · ×1
  • fastcgi.parsePHPFastCGI (cyclomatic 36) modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:172 — 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.
D1 · Cyclomatic Complexity · caddycmd.cmdFmt (cyclomatic 35) · ×1
  • caddycmd.cmdFmt (cyclomatic 35) cmd/commandfuncs.go:681 — caddycmd.cmdFmt 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.
D1 · Cyclomatic Complexity · ConnectionPolicy.UnmarshalCaddyfile (cyclomatic 35) · ×1
  • ConnectionPolicy.UnmarshalCaddyfile (cyclomatic 35) REDACTED:491 — 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.
D1 · Cyclomatic Complexity · Handler.doActiveHealthCheck (cyclomatic 34) · ×1
  • Handler.doActiveHealthCheck (cyclomatic 34) modules/caddyhttp/reverseproxy/healthchecks.go:391 — Handler.doActiveHealthCheck has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's 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.
D1 · Cyclomatic Complexity · Handler.proxyLoopIteration (cyclomatic 32) · ×1
  • Handler.proxyLoopIteration (cyclomatic 32) modules/caddyhttp/reverseproxy/reverseproxy.go:749 — Handler.proxyLoopIteration has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · caddyhttp.cmdRespond (cyclomatic 31) · ×1
  • caddyhttp.cmdRespond (cyclomatic 31) modules/caddyhttp/staticresp.go:316 — 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.
D1 · Cyclomatic Complexity · TLSConfig.MakeTLSClientConfig (cyclomatic 31) · ×1
  • TLSConfig.MakeTLSClientConfig (cyclomatic 31) REDACTED:798 — TLSConfig.MakeTLSClientConfig has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's 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.
D1 · Cyclomatic Complexity · ACMEIssuer.Provision (cyclomatic 31) · ×1
  • ACMEIssuer.Provision (cyclomatic 31) modules/caddytls/acmeissuer.go:129 — 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.
D1 · Cyclomatic Complexity · caddycmd.cmdRun (cyclomatic 30) · ×1
  • caddycmd.cmdRun (cyclomatic 30) cmd/commandfuncs.go:189 — caddycmd.cmdRun has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's 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.
D1 · Cyclomatic Complexity · acmeserver.parseACMEServer (cyclomatic 30) · ×1
  • acmeserver.parseACMEServer (cyclomatic 30) modules/caddypki/acmeserver/caddyfile.go:45 — 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.
D1 · Cyclomatic Complexity · ZeroSSLIssuer.UnmarshalCaddyfile (cyclomatic 30) · ×1
  • ZeroSSLIssuer.UnmarshalCaddyfile (cyclomatic 30) modules/caddytls/zerosslissuer.go:138 — 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.
D1 · Cyclomatic Complexity · App.stop (cyclomatic 29) · ×1
  • App.stop (cyclomatic 29) REDACTED:723 — App.stop has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 801, 783, 891). 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' 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.
D1 · Cyclomatic Complexity · AUpstreams.UnmarshalCaddyfile (cyclomatic 29) · ×1
  • AUpstreams.UnmarshalCaddyfile (cyclomatic 29) modules/caddyhttp/reverseproxy/caddyfile.go:1623 — 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.
D1 · Cyclomatic Complexity · Server.serveHTTP (cyclomatic 29) · ×1
  • Server.serveHTTP (cyclomatic 29) modules/caddyhttp/server.go:846 — Server.serveHTTP 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.
D1 · Cyclomatic Complexity · TLS.Start (cyclomatic 29) · ×1
  • TLS.Start (cyclomatic 29) REDACTED:406 — TLS.Start has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 443). 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's 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.
D1 · Cyclomatic Complexity · FileWriter.OpenWriter (cyclomatic 29) · ×1
  • FileWriter.OpenWriter (cyclomatic 29) modules/logging/filewriter.go:187 — FileWriter.OpenWriter has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's 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.
D1 · Cyclomatic Complexity · reverseproxy.parseUpstreamDialAddress (cyclomatic 28) · ×1
  • reverseproxy.parseUpstreamDialAddress (cyclomatic 28) modules/caddyhttp/reverseproxy/addresses.go:65 — 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.
D1 · Cyclomatic Complexity · Handler.prepareRequest (cyclomatic 28) · ×1
  • Handler.prepareRequest (cyclomatic 28) modules/caddyhttp/reverseproxy/reverseproxy.go:920 — Handler.prepareRequest has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SRVUpstreams.UnmarshalCaddyfile (cyclomatic 28) · ×1
  • SRVUpstreams.UnmarshalCaddyfile (cyclomatic 28) modules/caddyhttp/reverseproxy/caddyfile.go:1517 — 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.
D1 · Cyclomatic Complexity · ClientAuthentication.UnmarshalCaddyfile (cyclomatic 28) · ×1
  • ClientAuthentication.UnmarshalCaddyfile (cyclomatic 28) REDACTED:664 — 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.
D1 · Cyclomatic Complexity · Handler.finalizeResponse (cyclomatic 27) · ×1
  • Handler.finalizeResponse (cyclomatic 27) modules/caddyhttp/reverseproxy/reverseproxy.go:1396 — Handler.finalizeResponse has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConnectionPolicy.buildStandardTLSConfig (cyclomatic 27) · ×1
  • ConnectionPolicy.buildStandardTLSConfig (cyclomatic 27) REDACTED:279 — ConnectionPolicy.buildStandardTLSConfig has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's 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.
D1 · Cyclomatic Complexity · LogEncoderConfig.ZapcoreEncoderConfig (cyclomatic 27) · ×1
  • LogEncoderConfig.ZapcoreEncoderConfig (cyclomatic 27) modules/logging/encoders.go:203 — LogEncoderConfig.ZapcoreEncoderConfig has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's 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 — the same kind of value, with no behaviour of its own — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.consolidateAutomationPolicies (cyclomatic 26) · ×1
  • httpcaddyfile.consolidateAutomationPolicies (cyclomatic 26) caddyconfig/httpcaddyfile/tlsapp.go:1067 — httpcaddyfile.consolidateAutomationPolicies has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's 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.
D1 · Cyclomatic Complexity · caddycmd.cmdListModules (cyclomatic 26) · ×1
  • caddycmd.cmdListModules (cyclomatic 26) cmd/commandfuncs.go:434 — caddycmd.cmdListModules has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's 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.
D1 · Cyclomatic Complexity · caddy.Version (cyclomatic 25) · ×1
  • caddy.Version (cyclomatic 25) caddy.go:1001 — 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.
D1 · Cyclomatic Complexity · FileServer.Provision (cyclomatic 25) · ×1
  • FileServer.Provision (cyclomatic 25) REDACTED:196 — 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.
D1 · Cyclomatic Complexity · Transport.buildEnv (cyclomatic 25) · ×1
  • Transport.buildEnv (cyclomatic 25) modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:265 — Transport.buildEnv has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Handler.reverseProxy (cyclomatic 25) · ×1
  • Handler.reverseProxy (cyclomatic 25) modules/caddyhttp/reverseproxy/reverseproxy.go:1176 — Handler.reverseProxy has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's 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.
D1 · Cyclomatic Complexity · AutomationPolicy.makeCertMagicConfig (cyclomatic 25) · ×1
  • AutomationPolicy.makeCertMagicConfig (cyclomatic 25) REDACTED:272 — AutomationPolicy.makeCertMagicConfig has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's 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.
D1 · Cyclomatic Complexity · CustomLog.loggerAllowed (cyclomatic 24) · ×1
  • CustomLog.loggerAllowed (cyclomatic 24) logging.go:533 — CustomLog.loggerAllowed 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.
D1 · Cyclomatic Complexity · App.Emit (cyclomatic 24) · ×1
  • App.Emit (cyclomatic 24) REDACTED:219 — App.Emit has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's 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.
D1 · Cyclomatic Complexity · FileServer.serveBrowse (cyclomatic 24) · ×1
  • FileServer.serveBrowse (cyclomatic 24) REDACTED:78 — 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.
D1 · Cyclomatic Complexity · echConfig.UnmarshalBinary (cyclomatic 24) · ×1
  • echConfig.UnmarshalBinary (cyclomatic 24) REDACTED:998 — 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.
D1 · Cyclomatic Complexity · ServerType.listenersForServerBlockAddress (cyclomatic 23) · ×1
  • ServerType.listenersForServerBlockAddress (cyclomatic 23) caddyconfig/httpcaddyfile/addresses.go:270 — 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.
D1 · Cyclomatic Complexity · caddycmd.loadConfigWithLogger (cyclomatic 23) · ×1
  • caddycmd.loadConfigWithLogger (cyclomatic 23) cmd/main.go:145 — 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.
D1 · Cyclomatic Complexity · Context.LoadModule (cyclomatic 23) · ×1
  • Context.LoadModule (cyclomatic 23) context.go:188 — 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.
D1 · Cyclomatic Complexity · headers.parseCaddyfile (cyclomatic 23) · ×1
  • headers.parseCaddyfile (cyclomatic 23) modules/caddyhttp/headers/caddyfile.go:49 — headers.parseCaddyfile has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's 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.
D1 · Cyclomatic Complexity · ECH.rotateECHKeys (cyclomatic 23) · ×1
  • ECH.rotateECHKeys (cyclomatic 23) REDACTED:192 — ECH.rotateECHKeys has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's 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.
D1 · Cyclomatic Complexity · Replacer.replace (cyclomatic 23) · ×1
  • Replacer.replace (cyclomatic 23) replacer.go:175 — 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.
D1 · Cyclomatic Complexity · caddy.replaceRemoteAdminServer (cyclomatic 22) · ×1
  • caddy.replaceRemoteAdminServer (cyclomatic 22) REDACTED:511 — caddy.replaceRemoteAdminServer has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · httpcaddyfile.newBaseAutomationPolicy (cyclomatic 22) · ×1
  • httpcaddyfile.newBaseAutomationPolicy (cyclomatic 22) caddyconfig/httpcaddyfile/tlsapp.go:1001 — 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.
D1 · Cyclomatic Complexity · Transport.UnmarshalCaddyfile (cyclomatic 22) · ×1
  • Transport.UnmarshalCaddyfile (cyclomatic 22) modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:50 — 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.
D1 · Cyclomatic Complexity · Handler.addForwardedHeaders (cyclomatic 22) · ×1
  • Handler.addForwardedHeaders (cyclomatic 22) modules/caddyhttp/reverseproxy/reverseproxy.go:1074 — 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.
D1 · Cyclomatic Complexity · StaticResponse.ServeHTTP (cyclomatic 22) · ×1
  • StaticResponse.ServeHTTP (cyclomatic 22) modules/caddyhttp/staticresp.go:181 — 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.
D1 · Cyclomatic Complexity · ConnectionPolicies.TLSConfig (cyclomatic 22) · ×1
  • ConnectionPolicies.TLSConfig (cyclomatic 22) REDACTED:98 — ConnectionPolicies.TLSConfig has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's 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.
D1 · Cyclomatic Complexity · caddyfile.isSingleUnbracedSite (cyclomatic 21) · ×1
  • caddyfile.isSingleUnbracedSite (cyclomatic 21) caddyconfig/caddyfile/formatter.go:151 — caddyfile.isSingleUnbracedSite 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.
D1 · Cyclomatic Complexity · ServerType.buildPKIApp (cyclomatic 21) · ×1
  • ServerType.buildPKIApp (cyclomatic 21) caddyconfig/httpcaddyfile/pkiapp.go:198 — ServerType.buildPKIApp 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.
D1 · Cyclomatic Complexity · forwardauth.parseCaddyfile (cyclomatic 21) · ×1
  • forwardauth.parseCaddyfile (cyclomatic 21) modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go:64 — 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.
D1 · Cyclomatic Complexity · Handler.ServeHTTP (cyclomatic 21) · ×1
  • Handler.ServeHTTP (cyclomatic 21) modules/caddyhttp/reverseproxy/reverseproxy.go:627 — Handler.ServeHTTP 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.
D1 · Cyclomatic Complexity · LoadBalancing.tryAgain (cyclomatic 21) · ×1
  • LoadBalancing.tryAgain (cyclomatic 21) modules/caddyhttp/reverseproxy/reverseproxy.go:1544 — 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.
D1 · Cyclomatic Complexity · CA.Provision (cyclomatic 21) · ×1
  • CA.Provision (cyclomatic 21) modules/caddypki/ca.go:99 — 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.
D1 · Cyclomatic Complexity · FilterEncoder.UnmarshalCaddyfile (cyclomatic 21) · ×1
  • FilterEncoder.UnmarshalCaddyfile (cyclomatic 21) REDACTED:152 — FilterEncoder.UnmarshalCaddyfile has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's 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.
D1 · Cyclomatic Complexity · ServerType.compileEncodedMatcherSets (cyclomatic 20) · ×1
  • ServerType.compileEncodedMatcherSets (cyclomatic 20) REDACTED:1625 — 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.
D1 · Cyclomatic Complexity · caddycmd.cmdExportStorage (cyclomatic 20) · ×1
  • caddycmd.cmdExportStorage (cyclomatic 20) cmd/storagefuncs.go:135 — 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.
D1 · Cyclomatic Complexity · rewrite.parseCaddyfileURI (cyclomatic 20) · ×1
  • rewrite.parseCaddyfileURI (cyclomatic 20) modules/caddyhttp/rewrite/caddyfile.go:97 — 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.
D1 · Cyclomatic Complexity · queryOps.do (cyclomatic 20) · ×1
  • queryOps.do (cyclomatic 20) modules/caddyhttp/rewrite/rewrite.go:672 — 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.
D1 · Cyclomatic Complexity · caddy.changeConfig (cyclomatic 19) · ×1
  • caddy.changeConfig (cyclomatic 19) caddy.go:158 — 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.
D1 · Cyclomatic Complexity · caddy.finishSettingUp (cyclomatic 19) · ×1
  • caddy.finishSettingUp (cyclomatic 19) caddy.go:594 — caddy.finishSettingUp has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's 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.
D1 · Cyclomatic Complexity · parser.addresses (cyclomatic 19) · ×1
  • parser.addresses (cyclomatic 19) caddyconfig/caddyfile/parse.go:229 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.detectConflictingSchemes (cyclomatic 19) · ×1
  • httpcaddyfile.detectConflictingSchemes (cyclomatic 19) REDACTED:1166 — httpcaddyfile.detectConflictingSchemes has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's 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.
D1 · Cyclomatic Complexity · Context.LoadModuleByID (cyclomatic 19) · ×1
  • Context.LoadModuleByID (cyclomatic 19) context.go:366 — Context.LoadModuleByID has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's 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.
D1 · Cyclomatic Complexity · browseTemplateContext.applySortAndLimit (cyclomatic 19) · ×1
  • browseTemplateContext.applySortAndLimit (cyclomatic 19) modules/caddyhttp/fileserver/browsetplcontext.go:229 — browseTemplateContext.applySortAndLimit has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Handler.doActiveHealthCheckForAllHosts (cyclomatic 19) · ×1
  • Handler.doActiveHealthCheckForAllHosts (cyclomatic 19) modules/caddyhttp/reverseproxy/healthchecks.go:297 — 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's 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.
D1 · Cyclomatic Complexity · caddytls.tlsCertFromCertAndKeyPEMBundle (cyclomatic 19) · ×1
  • caddytls.tlsCertFromCertAndKeyPEMBundle (cyclomatic 19) modules/caddytls/folderloader.go:106 — 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.
D1 · Cyclomatic Complexity · AutomationPolicy.Provision (cyclomatic 19) · ×1
  • AutomationPolicy.Provision (cyclomatic 19) REDACTED:182 — 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.
D1 · Cyclomatic Complexity · TLS.cleanStorageUnits (cyclomatic 19) · ×1
  • TLS.cleanStorageUnits (cyclomatic 19) REDACTED:985 — TLS.cleanStorageUnits 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.
D1 · Cyclomatic Complexity · parser.directive (cyclomatic 18) · ×1
  • parser.directive (cyclomatic 18) caddyconfig/caddyfile/parse.go:700 — 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.
D1 · Cyclomatic Complexity · ServerType.evaluateGlobalOptionsBlock (cyclomatic 18) · ×1
  • ServerType.evaluateGlobalOptionsBlock (cyclomatic 18) REDACTED:385 — 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.
D1 · Cyclomatic Complexity · caddycmd.cmdStart (cyclomatic 18) · ×1
  • caddycmd.cmdStart (cyclomatic 18) cmd/commandfuncs.go:46 — caddycmd.cmdStart has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's 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.
D1 · Cyclomatic Complexity · caddycmd.atomicReplaceFormattedFile (cyclomatic 18) · ×1
  • caddycmd.atomicReplaceFormattedFile (cyclomatic 18) cmd/commandfuncs.go:869 — caddycmd.atomicReplaceFormattedFile has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's 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.
D1 · Cyclomatic Complexity · fileserver.cmdFileServer (cyclomatic 18) · ×1
  • fileserver.cmdFileServer (cyclomatic 18) modules/caddyhttp/fileserver/command.go:86 — 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.
D1 · Cyclomatic Complexity · FileServer.directoryListing (cyclomatic 18) · ×1
  • FileServer.directoryListing (cyclomatic 18) modules/caddyhttp/fileserver/browsetplcontext.go:37 — 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.
D1 · Cyclomatic Complexity · Intercept.ServeHTTP (cyclomatic 18) · ×1
  • Intercept.ServeHTTP (cyclomatic 18) modules/caddyhttp/intercept/intercept.go:115 — Intercept.ServeHTTP has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's 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.
D1 · Cyclomatic Complexity · MatchPath.matchPatternWithEscapeSequence (cyclomatic 18) · ×1
  • MatchPath.matchPatternWithEscapeSequence (cyclomatic 18) modules/caddyhttp/matchers.go:537 — 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.
D1 · Cyclomatic Complexity · ActiveHealthChecks.Provision (cyclomatic 18) · ×1
  • ActiveHealthChecks.Provision (cyclomatic 18) modules/caddyhttp/reverseproxy/healthchecks.go:137 — ActiveHealthChecks.Provision has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's 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.
D1 · Cyclomatic Complexity · rewrite.buildQueryString (cyclomatic 18) · ×1
  • rewrite.buildQueryString (cyclomatic 18) modules/caddyhttp/rewrite/rewrite.go:366 — rewrite.buildQueryString has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's 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.
D1 · Cyclomatic Complexity · Server.logRequest (cyclomatic 18) · ×1
  • Server.logRequest (cyclomatic 18) modules/caddyhttp/server.go:1392 — Server.logRequest 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.
D1 · Cyclomatic Complexity · CustomCertSelectionPolicy.UnmarshalCaddyfile (cyclomatic 18) · ×1
  • CustomCertSelectionPolicy.UnmarshalCaddyfile (cyclomatic 18) modules/caddytls/certselection.go:125 — 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.
D1 · Cyclomatic Complexity · caddy.unsyncedDecodeAndRun (cyclomatic 17) · ×1
  • caddy.unsyncedDecodeAndRun (cyclomatic 17) caddy.go:337 — 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.
D1 · Cyclomatic Complexity · caddyhttp.matchHeaders (cyclomatic 17) · ×1
  • caddyhttp.matchHeaders (cyclomatic 17) modules/caddyhttp/matchers.go:1162 — 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.
D1 · Cyclomatic Complexity · caddyauth.cmdHashPassword (cyclomatic 17) · ×1
  • caddyauth.cmdHashPassword (cyclomatic 17) modules/caddyhttp/caddyauth/command.go:91 — caddyauth.cmdHashPassword 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.
D1 · Cyclomatic Complexity · headers.applyHeaderOp (cyclomatic 17) · ×1
  • headers.applyHeaderOp (cyclomatic 17) modules/caddyhttp/headers/caddyfile.go:239 — 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.
D1 · Cyclomatic Complexity · timeouts.parseCaddyfile (cyclomatic 17) · ×1
  • timeouts.parseCaddyfile (cyclomatic 17) modules/caddyhttp/timeouts/caddyfile.go:31 — timeouts.parseCaddyfile 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.
D1 · Cyclomatic Complexity · httpcaddyfile.sortRoutes (cyclomatic 16) · ×1
  • httpcaddyfile.sortRoutes (cyclomatic 16) caddyconfig/httpcaddyfile/directives.go:456 — httpcaddyfile.sortRoutes has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 462). 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's 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.
D1 · Cyclomatic Complexity · httpcaddyfile.appendSubrouteToRouteList (cyclomatic 16) · ×1
  • httpcaddyfile.appendSubrouteToRouteList (cyclomatic 16) REDACTED:1389 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.buildSubroute (cyclomatic 16) · ×1
  • httpcaddyfile.buildSubroute (cyclomatic 16) REDACTED:1454 — 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.
D1 · Cyclomatic Complexity · httpcaddyfile.parseOptOnDemand (cyclomatic 16) · ×1
  • httpcaddyfile.parseOptOnDemand (cyclomatic 16) caddyconfig/httpcaddyfile/options.go:404 — 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.
D1 · Cyclomatic Complexity · caddycmd.cmdAdaptConfig (cyclomatic 16) · ×1
  • caddycmd.cmdAdaptConfig (cyclomatic 16) cmd/commandfuncs.go:548 — 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.
D1 · Cyclomatic Complexity · caddycmd.parseEnvFile (cyclomatic 16) · ×1
  • caddycmd.parseEnvFile (cyclomatic 16) cmd/main.go:384 — 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.
D1 · Cyclomatic Complexity · caddyhttp.CELMatcherDecorator (cyclomatic 16) · ×1
  • caddyhttp.CELMatcherDecorator (cyclomatic 16) REDACTED:484 — 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 485). 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's 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.
D1 · Cyclomatic Complexity · caddyhttp.CELValueToMapStrList (cyclomatic 16) · ×1
  • caddyhttp.CELValueToMapStrList (cyclomatic 16) REDACTED:684 — 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.
D1 · Cyclomatic Complexity · Encode.UnmarshalCaddyfile (cyclomatic 16) · ×1
  • Encode.UnmarshalCaddyfile (cyclomatic 16) modules/caddyhttp/encode/caddyfile.go:59 — 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.
D1 · Cyclomatic Complexity · MatchPath.MatchWithError (cyclomatic 16) · ×1
  • MatchPath.MatchWithError (cyclomatic 16) modules/caddyhttp/matchers.go:429 — 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.
D1 · Cyclomatic Complexity · CustomCertSelectionPolicy.SelectCertificate (cyclomatic 16) · ×1
  • CustomCertSelectionPolicy.SelectCertificate (cyclomatic 16) modules/caddytls/certselection.go:56 — 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.
D1 · Cyclomatic Complexity · ClientAuthentication.ConfigureTLSConfig (cyclomatic 16) · ×1
  • ClientAuthentication.ConfigureTLSConfig (cyclomatic 16) REDACTED:844 — 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.
D2 · Cognitive Complexity · Handler.UnmarshalCaddyfile (cognitive 559) · ×1
  • Handler.UnmarshalCaddyfile (cognitive 559) modules/caddyhttp/reverseproxy/caddyfile.go:152 — Handler.UnmarshalCaddyfile has cognitive complexity 559 (threshold 15). Drivers by points: if/else 170 (505 pts), boolean chains 19, loops 8 (19 pts), match/switch 6 (16 pts) (nesting depth added 356). Of this number, 548 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ServerType.serversFromPairings (cognitive 356) · ×1
  • ServerType.serversFromPairings (cognitive 356) REDACTED:566 — ServerType.serversFromPairings has cognitive complexity 356 (threshold 15). Drivers by points: if/else 68 (233 pts), loops 34 (98 pts), boolean chains 22, match/switch 1 (3 pts) (nesting depth added 231). Of this number, 321 points are the body's own statements and 35 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.
D2 · Cognitive Complexity · ServerType.buildTLSApp (cognitive 311) · ×1
  • ServerType.buildTLSApp (cognitive 311) caddyconfig/httpcaddyfile/tlsapp.go:36 — ServerType.buildTLSApp has cognitive complexity 311 (threshold 15). Drivers by points: if/else 83 (219 pts), loops 27 (78 pts), boolean chains 14 (nesting depth added 187). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · httpcaddyfile.unmarshalCaddyfileServerOptions (cognitive 240) · ×1
  • httpcaddyfile.unmarshalCaddyfileServerOptions (cognitive 240) caddyconfig/httpcaddyfile/serveroptions.go:73 — httpcaddyfile.unmarshalCaddyfileServerOptions has cognitive complexity 240 (threshold 15). Drivers by points: if/else 54 (204 pts), loops 8 (22 pts), match/switch 3 (10 pts), boolean chains 4 (nesting depth added 171). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexer.next (cognitive 227) · ×1
  • lexer.next (cognitive 227) caddyconfig/caddyfile/lexer.go:173 — lexer.next has cognitive complexity 227 (threshold 15). Drivers by points: if/else 62 (190 pts), boolean chains 24, loops 4 (13 pts) (nesting depth added 137). Of this number, 226 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · httpcaddyfile.parseTLS (cognitive 226) · ×1
  • httpcaddyfile.parseTLS (cognitive 226) caddyconfig/httpcaddyfile/builtins.go:119 — httpcaddyfile.parseTLS has cognitive complexity 226 (threshold 15). Drivers by points: if/else 78 (202 pts), loops 6 (12 pts), boolean chains 8, match/switch 3 (4 pts) (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.
D2 · Cognitive Complexity · HTTPTransport.UnmarshalCaddyfile (cognitive 214) · ×1
  • HTTPTransport.UnmarshalCaddyfile (cognitive 214) modules/caddyhttp/reverseproxy/caddyfile.go:1079 — HTTPTransport.UnmarshalCaddyfile has cognitive complexity 214 (threshold 15). Drivers by points: if/else 67 (202 pts), match/switch 4 (11 pts), 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.
D2 · Cognitive Complexity · App.automaticHTTPSPhase1 (cognitive 179) · ×1
  • App.automaticHTTPSPhase1 (cognitive 179) modules/caddyhttp/autohttps.go:77 — App.automaticHTTPSPhase1 has cognitive complexity 179 (threshold 15). Drivers by points: if/else 40 (115 pts), loops 21 (46 pts), boolean chains 16, jumps 2 (nesting depth added 100). Of this number, 162 points are the body's own statements and 17 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ACMEIssuer.UnmarshalCaddyfile (cognitive 168) · ×1
  • ACMEIssuer.UnmarshalCaddyfile (cognitive 168) modules/caddytls/acmeissuer.go:448 — ACMEIssuer.UnmarshalCaddyfile has cognitive complexity 168 (threshold 15). Drivers by points: if/else 56 (165 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · httpcaddyfile.consolidateConnPolicies (cognitive 165) · ×1
  • httpcaddyfile.consolidateConnPolicies (cognitive 165) REDACTED:1226 — httpcaddyfile.consolidateConnPolicies has cognitive complexity 165 (threshold 15). Drivers by points: if/else 31 (135 pts), boolean chains 22, loops 3 (8 pts) (nesting depth added 109). Of this number, 164 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · httpcaddyfile.parseLogHelper (cognitive 151) · ×1
  • httpcaddyfile.parseLogHelper (cognitive 151) caddyconfig/httpcaddyfile/builtins.go:942 — httpcaddyfile.parseLogHelper has cognitive complexity 151 (threshold 15). Drivers by points: if/else 45 (129 pts), loops 5 (13 pts), match/switch 3 (9 pts) (nesting depth added 98). Of this number, 150 points are the body's 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.
D2 · Cognitive Complexity · caddyhttp.addHTTPVarsToReplacer (cognitive 142) · ×1
  • caddyhttp.addHTTPVarsToReplacer (cognitive 142) modules/caddyhttp/replacer.go:59 — caddyhttp.addHTTPVarsToReplacer has cognitive complexity 142 (threshold 15). Drivers by points: if/else 48 (130 pts), boolean chains 6, loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 85). None of this is in the body itself: all 142 points belong 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's 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.
D2 · Cognitive Complexity · httpcaddyfile.parsePKIApp (cognitive 140) · ×1
  • httpcaddyfile.parsePKIApp (cognitive 140) caddyconfig/httpcaddyfile/pkiapp.go:56 — httpcaddyfile.parsePKIApp has cognitive complexity 140 (threshold 15). Drivers by points: if/else 20 (107 pts), match/switch 4 (18 pts), loops 4 (14 pts), 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.
D2 · Cognitive Complexity · TLS.publishECHConfigs (cognitive 136) · ×1
  • TLS.publishECHConfigs (cognitive 136) REDACTED:333 — TLS.publishECHConfigs has cognitive complexity 136 (threshold 15). Drivers by points: if/else 29 (80 pts), loops 15 (53 pts), boolean chains 3 (nesting depth added 89). Of this number, 132 points are the body's 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.
D2 · Cognitive Complexity · FileServer.ServeHTTP (cognitive 125) · ×1
  • FileServer.ServeHTTP (cognitive 125) REDACTED:322 — FileServer.ServeHTTP has cognitive complexity 125 (threshold 15). Drivers by points: if/else 57 (111 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerType.Setup (cognitive 120) · ×1
  • ServerType.Setup (cognitive 120) REDACTED:59 — ServerType.Setup has cognitive complexity 120 (threshold 15). Drivers by points: if/else 42 (81 pts), loops 16 (31 pts), boolean chains 8 (nesting depth added 54). Of this number, 116 points are the body's 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.
D2 · Cognitive Complexity · caddy.unsyncedConfigAccess (cognitive 114) · ×1
  • caddy.unsyncedConfigAccess (cognitive 114) REDACTED:1180 — caddy.unsyncedConfigAccess has cognitive complexity 114 (threshold 15). Drivers by points: if/else 28 (97 pts), match/switch 3 (10 pts), boolean chains 5, jumps 1, loops 1 (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · App.Provision (cognitive 111) · ×1
  • App.Provision (cognitive 111) REDACTED:188 — App.Provision has cognitive complexity 111 (threshold 15). Drivers by points: if/else 38 (92 pts), loops 7 (16 pts), boolean chains 3 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HeaderOps.ApplyTo (cognitive 101) · ×1
  • HeaderOps.ApplyTo (cognitive 101) modules/caddyhttp/headers/headers.go:234 — HeaderOps.ApplyTo has cognitive complexity 101 (threshold 15). Drivers by points: if/else 18 (55 pts), loops 17 (42 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileWriter.UnmarshalCaddyfile (cognitive 101) · ×1
  • FileWriter.UnmarshalCaddyfile (cognitive 101) modules/logging/filewriter.go:387 — FileWriter.UnmarshalCaddyfile has cognitive complexity 101 (threshold 15). Drivers by points: if/else 25 (78 pts), loops 5 (15 pts), match/switch 3 (8 pts) (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.
D2 · Cognitive Complexity · App.Start (cognitive 99) · ×1
  • App.Start (cognitive 99) REDACTED:480 — App.Start has cognitive complexity 99 (threshold 15). Drivers by points: if/else 20 (72 pts), loops 6 (19 pts), boolean chains 8 (nesting depth added 65). Of this number, 97 points are the body's 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.
D2 · Cognitive Complexity · HTTPTransport.NewTransport (cognitive 99) · ×1
  • HTTPTransport.NewTransport (cognitive 99) REDACTED:207 — HTTPTransport.NewTransport has cognitive complexity 99 (threshold 15). Drivers by points: if/else 47 (83 pts), boolean chains 8, match/switch 4 (8 pts) (nesting depth added 40). Of this number, 57 points are the body's own statements and 42 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.
D2 · Cognitive Complexity · parser.doImport (cognitive 95) · ×1
  • parser.doImport (cognitive 95) caddyconfig/caddyfile/parse.go:375 — parser.doImport has cognitive complexity 95 (threshold 15). Drivers by points: if/else 32 (65 pts), loops 7 (17 pts), boolean chains 9, match/switch 2 (4 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FileServer.UnmarshalCaddyfile (cognitive 92) · ×1
  • FileServer.UnmarshalCaddyfile (cognitive 92) modules/caddyhttp/fileserver/caddyfile.go:67 — FileServer.UnmarshalCaddyfile has cognitive complexity 92 (threshold 15). Drivers by points: if/else 19 (67 pts), match/switch 4 (13 pts), loops 4 (12 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.ServeHTTP (cognitive 89) · ×1
  • Server.ServeHTTP (cognitive 89) modules/caddyhttp/server.go:598 — Server.ServeHTTP has cognitive complexity 89 (threshold 15). Drivers by points: if/else 36 (73 pts), boolean chains 8, loops 3 (8 pts) (nesting depth added 42). Of this number, 83 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Handler.Provision (cognitive 82) · ×1
  • Handler.Provision (cognitive 82) modules/caddyhttp/reverseproxy/reverseproxy.go:308 — Handler.Provision has cognitive complexity 82 (threshold 15). Drivers by points: if/else 43 (76 pts), boolean chains 3, loops 3 (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.
D2 · Cognitive Complexity · MatchFile.selectFile (cognitive 81) · ×1
  • MatchFile.selectFile (cognitive 81) modules/caddyhttp/fileserver/matcher.go:333 — MatchFile.selectFile has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 9 (21 pts), boolean chains 6, match/switch 2 (nesting depth added 40). Of this number, 64 points are the body's own statements and 17 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TLS.Provision (cognitive 76) · ×1
  • TLS.Provision (cognitive 76) REDACTED:166 — TLS.Provision has cognitive complexity 76 (threshold 15). Drivers by points: if/else 33 (59 pts), loops 7 (12 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.createAutomationPolicies (cognitive 75) · ×1
  • App.createAutomationPolicies (cognitive 75) modules/caddyhttp/autohttps.go:597 — App.createAutomationPolicies has cognitive complexity 75 (threshold 15). Drivers by points: if/else 33 (66 pts), loops 5 (7 pts), 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.
D2 · Cognitive Complexity · caddyfile.formatTokens (cognitive 73) · ×1
  • caddyfile.formatTokens (cognitive 73) caddyconfig/caddyfile/formatter.go:486 — caddyfile.formatTokens has cognitive complexity 73 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 18, loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 29). Of this number, 72 points are the body's 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.
D2 · Cognitive Complexity · fastcgi.parsePHPFastCGI (cognitive 72) · ×1
  • fastcgi.parsePHPFastCGI (cognitive 72) modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:172 — fastcgi.parsePHPFastCGI has cognitive complexity 72 (threshold 15). Drivers by points: if/else 23 (65 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reverseproxy.cmdReverseProxy (cognitive 66) · ×1
  • reverseproxy.cmdReverseProxy (cognitive 66) modules/caddyhttp/reverseproxy/command.go:87 — reverseproxy.cmdReverseProxy has cognitive complexity 66 (threshold 15). Drivers by points: if/else 34 (48 pts), loops 5 (9 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Rewrite.Rewrite (cognitive 66) · ×1
  • Rewrite.Rewrite (cognitive 66) modules/caddyhttp/rewrite/rewrite.go:158 — Rewrite.Rewrite has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (49 pts), boolean chains 9, loops 3 (4 pts), match/switch 1 (3 pts), jumps 1 (nesting depth added 26). Of this number, 64 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionPolicy.UnmarshalCaddyfile (cognitive 64) · ×1
  • ConnectionPolicy.UnmarshalCaddyfile (cognitive 64) REDACTED:491 — ConnectionPolicy.UnmarshalCaddyfile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (60 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · ZeroSSLIssuer.UnmarshalCaddyfile (cognitive 64) · ×1
  • ZeroSSLIssuer.UnmarshalCaddyfile (cognitive 64) modules/caddytls/zerosslissuer.go:138 — ZeroSSLIssuer.UnmarshalCaddyfile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (61 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · httpcaddyfile.fillInGlobalACMEDefaults (cognitive 63) · ×1
  • httpcaddyfile.fillInGlobalACMEDefaults (cognitive 63) caddyconfig/httpcaddyfile/tlsapp.go:570 — httpcaddyfile.fillInGlobalACMEDefaults has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (40 pts), 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.
D2 · Cognitive Complexity · ConnectionPolicies.TLSConfig (cognitive 62) · ×1
  • ConnectionPolicies.TLSConfig (cognitive 62) REDACTED:98 — ConnectionPolicies.TLSConfig has cognitive complexity 62 (threshold 15). Drivers by points: loops 9 (32 pts), if/else 10 (27 pts), boolean chains 2, jumps 1 (nesting depth added 40). Of this number, 52 points are the body's 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.
D2 · Cognitive Complexity · TLS.Start (cognitive 62) · ×1
  • TLS.Start (cognitive 62) REDACTED:406 — TLS.Start has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (49 pts), boolean chains 6, loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 35). Of this number, 20 points are the body's own statements and 42 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.cmdFmt (cognitive 57) · ×1
  • caddycmd.cmdFmt (cognitive 57) cmd/commandfuncs.go:681 — caddycmd.cmdFmt has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (34 pts), loops 4 (10 pts), match/switch 2 (8 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · AUpstreams.UnmarshalCaddyfile (cognitive 56) · ×1
  • AUpstreams.UnmarshalCaddyfile (cognitive 56) modules/caddyhttp/reverseproxy/caddyfile.go:1623 — AUpstreams.UnmarshalCaddyfile has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (46 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientAuthentication.UnmarshalCaddyfile (cognitive 56) · ×1
  • ClientAuthentication.UnmarshalCaddyfile (cognitive 56) REDACTED:664 — ClientAuthentication.UnmarshalCaddyfile has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (52 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acmeserver.parseACMEServer (cognitive 55) · ×1
  • acmeserver.parseACMEServer (cognitive 55) modules/caddypki/acmeserver/caddyfile.go:45 — acmeserver.parseACMEServer has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 3 (10 pts), loops 3 (7 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.serveHTTP (cognitive 54) · ×1
  • Server.serveHTTP (cognitive 54) modules/caddyhttp/server.go:846 — Server.serveHTTP has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (46 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.doActiveHealthCheck (cognitive 53) · ×1
  • Handler.doActiveHealthCheck (cognitive 53) modules/caddyhttp/reverseproxy/healthchecks.go:391 — Handler.doActiveHealthCheck has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (49 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). Of this number, 38 points are the body's 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.
D2 · Cognitive Complexity · SRVUpstreams.UnmarshalCaddyfile (cognitive 53) · ×1
  • SRVUpstreams.UnmarshalCaddyfile (cognitive 53) modules/caddyhttp/reverseproxy/caddyfile.go:1517 — SRVUpstreams.UnmarshalCaddyfile has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (50 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · Handler.proxyLoopIteration (cognitive 51) · ×1
  • Handler.proxyLoopIteration (cognitive 51) modules/caddyhttp/reverseproxy/reverseproxy.go:749 — Handler.proxyLoopIteration has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (44 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Context.LoadModule (cognitive 50) · ×1
  • Context.LoadModule (cognitive 50) context.go:188 — Context.LoadModule has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 4 (13 pts), 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.
D2 · Cognitive Complexity · ACMEIssuer.Provision (cognitive 50) · ×1
  • ACMEIssuer.Provision (cognitive 50) modules/caddytls/acmeissuer.go:129 — ACMEIssuer.Provision has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (46 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpcaddyfile.consolidateAutomationPolicies (cognitive 48) · ×1
  • httpcaddyfile.consolidateAutomationPolicies (cognitive 48) caddyconfig/httpcaddyfile/tlsapp.go:1067 — httpcaddyfile.consolidateAutomationPolicies has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 4 (9 pts), boolean chains 4, jumps 2 (nesting depth added 26). Of this number, 46 points are the body's 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.
D2 · Cognitive Complexity · ServerType.buildPKIApp (cognitive 48) · ×1
  • ServerType.buildPKIApp (cognitive 48) caddyconfig/httpcaddyfile/pkiapp.go:198 — ServerType.buildPKIApp has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 7 (16 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reverseproxy.parseUpstreamDialAddress (cognitive 48) · ×1
  • reverseproxy.parseUpstreamDialAddress (cognitive 48) modules/caddyhttp/reverseproxy/addresses.go:65 — reverseproxy.parseUpstreamDialAddress has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RemoteAdmin.enforceAccessControls (cognitive 47) · ×1
  • RemoteAdmin.enforceAccessControls (cognitive 47) REDACTED:681 — RemoteAdmin.enforceAccessControls has cognitive complexity 47 (threshold 15). Drivers by points: if/else 4 (24 pts), loops 6 (21 pts), 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.
D2 · Cognitive Complexity · caddyhttp.getTLSReplacement (cognitive 47) · ×1
  • caddyhttp.getTLSReplacement (cognitive 47) modules/caddyhttp/replacer.go:491 — caddyhttp.getTLSReplacement has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.stop (cognitive 47) · ×1
  • App.stop (cognitive 47) REDACTED:723 — App.stop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 8 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 18). Of this number, 28 points are the body's own statements and 19 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · forwardauth.parseCaddyfile (cognitive 47) · ×1
  • forwardauth.parseCaddyfile (cognitive 47) modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go:64 — forwardauth.parseCaddyfile has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 6 (13 pts), match/switch 1 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyhttp.cmdRespond (cognitive 46) · ×1
  • caddyhttp.cmdRespond (cognitive 46) modules/caddyhttp/staticresp.go:316 — caddyhttp.cmdRespond has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 5 (8 pts), 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.
D2 · Cognitive Complexity · TLSConfig.MakeTLSClientConfig (cognitive 45) · ×1
  • TLSConfig.MakeTLSClientConfig (cognitive 45) REDACTED:798 — TLSConfig.MakeTLSClientConfig has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 4 (7 pts), boolean chains 5, match/switch 1 (nesting depth added 17). Of this number, 38 points are the body's 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.
D2 · Cognitive Complexity · caddy.Version (cognitive 44) · ×1
  • caddy.Version (cognitive 44) caddy.go:1001 — caddy.Version has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 2 (3 pts), match/switch 1 (3 pts), 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.
D2 · Cognitive Complexity · headers.parseCaddyfile (cognitive 44) · ×1
  • headers.parseCaddyfile (cognitive 44) modules/caddyhttp/headers/caddyfile.go:49 — headers.parseCaddyfile has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 4 (7 pts) (nesting depth added 22). Of this number, 43 points are the body's 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.
D2 · Cognitive Complexity · ECH.rotateECHKeys (cognitive 44) · ×1
  • ECH.rotateECHKeys (cognitive 44) REDACTED:192 — ECH.rotateECHKeys has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 22). Of this number, 38 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.finishSettingUp (cognitive 43) · ×1
  • caddy.finishSettingUp (cognitive 43) caddy.go:594 — caddy.finishSettingUp has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 1 (4 pts), loops 1 (3 pts), 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' 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.
D2 · Cognitive Complexity · AutomationPolicy.makeCertMagicConfig (cognitive 43) · ×1
  • AutomationPolicy.makeCertMagicConfig (cognitive 43) REDACTED:272 — AutomationPolicy.makeCertMagicConfig has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 6 (nesting depth added 20). Of this number, 16 points are the body's own statements and 27 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ServerType.mapAddressToProtocolToServerBlocks (cognitive 41) · ×1
  • ServerType.mapAddressToProtocolToServerBlocks (cognitive 41) caddyconfig/httpcaddyfile/addresses.go:80 — ServerType.mapAddressToProtocolToServerBlocks has cognitive complexity 41 (threshold 15). Drivers by points: loops 9 (24 pts), if/else 5 (17 pts) (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.
D2 · Cognitive Complexity · caddycmd.cmdRun (cognitive 41) · ×1
  • caddycmd.cmdRun (cognitive 41) cmd/commandfuncs.go:189 — caddycmd.cmdRun has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 4, match/switch 2 (nesting depth added 12). Of this number, 39 points are the body's 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.
D2 · Cognitive Complexity · Handler.reverseProxy (cognitive 41) · ×1
  • Handler.reverseProxy (cognitive 41) modules/caddyhttp/reverseproxy/reverseproxy.go:1176 — Handler.reverseProxy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 17). Of this number, 40 points are the body's 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.
D2 · Cognitive Complexity · queryOps.do (cognitive 41) · ×1
  • queryOps.do (cognitive 41) modules/caddyhttp/rewrite/rewrite.go:672 — queryOps.do has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 8 (14 pts), 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.
D2 · Cognitive Complexity · caddycmd.loadConfigWithLogger (cognitive 40) · ×1
  • caddycmd.loadConfigWithLogger (cognitive 40) cmd/main.go:145 — caddycmd.loadConfigWithLogger has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterEncoder.UnmarshalCaddyfile (cognitive 40) · ×1
  • FilterEncoder.UnmarshalCaddyfile (cognitive 40) REDACTED:152 — FilterEncoder.UnmarshalCaddyfile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 4 (8 pts), match/switch 1 (2 pts) (nesting depth added 20). Of this number, 33 points are the body's 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.
D2 · Cognitive Complexity · caddycmd.cmdListModules (cognitive 39) · ×1
  • caddycmd.cmdListModules (cognitive 39) cmd/commandfuncs.go:434 — caddycmd.cmdListModules has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 14). Of this number, 27 points are the body's 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.
D2 · Cognitive Complexity · App.Emit (cognitive 39) · ×1
  • App.Emit (cognitive 39) REDACTED:219 — App.Emit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (6 pts), match/switch 2 (5 pts) (nesting depth added 21). Of this number, 35 points are the body's 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.
D2 · Cognitive Complexity · Transport.UnmarshalCaddyfile (cognitive 39) · ×1
  • Transport.UnmarshalCaddyfile (cognitive 39) modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:50 — Transport.UnmarshalCaddyfile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (36 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddytls.tlsCertFromCertAndKeyPEMBundle (cognitive 39) · ×1
  • caddytls.tlsCertFromCertAndKeyPEMBundle (cognitive 39) modules/caddytls/folderloader.go:106 — caddytls.tlsCertFromCertAndKeyPEMBundle has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (36 pts), 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.
D2 · Cognitive Complexity · FileServer.Provision (cognitive 38) · ×1
  • FileServer.Provision (cognitive 38) REDACTED:196 — FileServer.Provision has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.doActiveHealthCheckForAllHosts (cognitive 38) · ×1
  • Handler.doActiveHealthCheckForAllHosts (cognitive 38) modules/caddyhttp/reverseproxy/healthchecks.go:297 — Handler.doActiveHealthCheckForAllHosts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (35 pts), 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's 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.
D2 · Cognitive Complexity · FileWriter.OpenWriter (cognitive 38) · ×1
  • FileWriter.OpenWriter (cognitive 38) modules/logging/filewriter.go:187 — FileWriter.OpenWriter has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 3, match/switch 1 (nesting depth added 11). Of this number, 37 points are the body's 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.
D2 · Cognitive Complexity · Replacer.replace (cognitive 38) · ×1
  • Replacer.replace (cognitive 38) replacer.go:175 — Replacer.replace has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 4, loops 2 (3 pts), 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.
D2 · Cognitive Complexity · parser.addresses (cognitive 37) · ×1
  • parser.addresses (cognitive 37) caddyconfig/caddyfile/parse.go:229 — parser.addresses has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), 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.
D2 · Cognitive Complexity · ServerType.evaluateGlobalOptionsBlock (cognitive 37) · ×1
  • ServerType.evaluateGlobalOptionsBlock (cognitive 37) REDACTED:385 — ServerType.evaluateGlobalOptionsBlock has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (3 pts), 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.
D2 · Cognitive Complexity · caddycmd.cmdExportStorage (cognitive 37) · ×1
  • caddycmd.cmdExportStorage (cognitive 37) cmd/storagefuncs.go:135 — caddycmd.cmdExportStorage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (35 pts), 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.
D2 · Cognitive Complexity · MatchPath.matchPatternWithEscapeSequence (cognitive 37) · ×1
  • MatchPath.matchPatternWithEscapeSequence (cognitive 37) modules/caddyhttp/matchers.go:537 — MatchPath.matchPatternWithEscapeSequence has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · timeouts.parseCaddyfile (cognitive 37) · ×1
  • timeouts.parseCaddyfile (cognitive 37) modules/caddyhttp/timeouts/caddyfile.go:31 — timeouts.parseCaddyfile has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomCertSelectionPolicy.SelectCertificate (cognitive 37) · ×1
  • CustomCertSelectionPolicy.SelectCertificate (cognitive 37) modules/caddytls/certselection.go:56 — CustomCertSelectionPolicy.SelectCertificate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 3 (7 pts), 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.
D2 · Cognitive Complexity · ServerType.consolidateAddrMappings (cognitive 36) · ×1
  • ServerType.consolidateAddrMappings (cognitive 36) caddyconfig/httpcaddyfile/addresses.go:195 — ServerType.consolidateAddrMappings has cognitive complexity 36 (threshold 15). Drivers by points: loops 9 (23 pts), if/else 2 (11 pts), 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.
D2 · Cognitive Complexity · FileServer.directoryListing (cognitive 36) · ×1
  • FileServer.directoryListing (cognitive 36) modules/caddyhttp/fileserver/browsetplcontext.go:37 — FileServer.directoryListing has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (32 pts), 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.
D2 · Cognitive Complexity · ConnectionPolicy.buildStandardTLSConfig (cognitive 36) · ×1
  • ConnectionPolicy.buildStandardTLSConfig (cognitive 36) REDACTED:279 — ConnectionPolicy.buildStandardTLSConfig has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 4, loops 2 (nesting depth added 10). Of this number, 32 points are the body's 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.
D2 · Cognitive Complexity · CustomLog.loggerAllowed (cognitive 35) · ×1
  • CustomLog.loggerAllowed (cognitive 35) logging.go:533 — CustomLog.loggerAllowed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 10, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchPath.MatchWithError (cognitive 35) · ×1
  • MatchPath.MatchWithError (cognitive 35) modules/caddyhttp/matchers.go:429 — MatchPath.MatchWithError has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TLS.cleanStorageUnits (cognitive 35) · ×1
  • TLS.cleanStorageUnits (cognitive 35) REDACTED:985 — TLS.cleanStorageUnits has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.replaceRemoteAdminServer (cognitive 34) · ×1
  • caddy.replaceRemoteAdminServer (cognitive 34) REDACTED:511 — caddy.replaceRemoteAdminServer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 13). Of this number, 30 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerType.listenersForServerBlockAddress (cognitive 34) · ×1
  • ServerType.listenersForServerBlockAddress (cognitive 34) caddyconfig/httpcaddyfile/addresses.go:270 — ServerType.listenersForServerBlockAddress has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (10 pts), 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.
D2 · Cognitive Complexity · FileServer.serveBrowse (cognitive 34) · ×1
  • FileServer.serveBrowse (cognitive 34) REDACTED:78 — FileServer.serveBrowse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 2, loops 1 (2 pts), 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.
D2 · Cognitive Complexity · Transport.buildEnv (cognitive 34) · ×1
  • Transport.buildEnv (cognitive 34) modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:265 — Transport.buildEnv has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (29 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · CustomCertSelectionPolicy.UnmarshalCaddyfile (cognitive 34) · ×1
  • CustomCertSelectionPolicy.UnmarshalCaddyfile (cognitive 34) modules/caddytls/certselection.go:125 — CustomCertSelectionPolicy.UnmarshalCaddyfile has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Context.LoadModuleByID (cognitive 33) · ×1
  • Context.LoadModuleByID (cognitive 33) context.go:366 — Context.LoadModuleByID has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (33 pts) (nesting depth added 15). Of this number, 31 points are the body's 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.
D2 · Cognitive Complexity · templates.parseCaddyfile (cognitive 33) · ×1
  • templates.parseCaddyfile (cognitive 33) modules/caddyhttp/templates/caddyfile.go:36 — templates.parseCaddyfile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerType.compileEncodedMatcherSets (cognitive 32) · ×1
  • ServerType.compileEncodedMatcherSets (cognitive 32) REDACTED:1625 — ServerType.compileEncodedMatcherSets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyauth.cmdHashPassword (cognitive 32) · ×1
  • caddyauth.cmdHashPassword (cognitive 32) modules/caddyhttp/caddyauth/command.go:91 — caddyauth.cmdHashPassword has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Metrics.scanConfigForHosts (cognitive 31) · ×1
  • Metrics.scanConfigForHosts (cognitive 31) modules/caddyhttp/metrics.go:232 — Metrics.scanConfigForHosts has cognitive complexity 31 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 4 (15 pts) (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.
D2 · Cognitive Complexity · Handler.prepareRequest (cognitive 31) · ×1
  • Handler.prepareRequest (cognitive 31) modules/caddyhttp/reverseproxy/reverseproxy.go:920 — Handler.prepareRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · Handler.addForwardedHeaders (cognitive 31) · ×1
  • Handler.addForwardedHeaders (cognitive 31) modules/caddyhttp/reverseproxy/reverseproxy.go:1074 — Handler.addForwardedHeaders has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.finalizeResponse (cognitive 31) · ×1
  • Handler.finalizeResponse (cognitive 31) modules/caddyhttp/reverseproxy/reverseproxy.go:1396 — Handler.finalizeResponse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · ECHDNSPublisher.PublishECHConfigList (cognitive 31) · ×1
  • ECHDNSPublisher.PublishECHConfigList (cognitive 31) REDACTED:851 — ECHDNSPublisher.PublishECHConfigList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts), 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.
D2 · Cognitive Complexity · httpcaddyfile.detectConflictingSchemes (cognitive 30) · ×1
  • httpcaddyfile.detectConflictingSchemes (cognitive 30) REDACTED:1166 — httpcaddyfile.detectConflictingSchemes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). Of this number, 24 points are the body's 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.
D2 · Cognitive Complexity · Encode.UnmarshalCaddyfile (cognitive 30) · ×1
  • Encode.UnmarshalCaddyfile (cognitive 30) modules/caddyhttp/encode/caddyfile.go:59 — Encode.UnmarshalCaddyfile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rewrite.parseCaddyfileURI (cognitive 30) · ×1
  • rewrite.parseCaddyfileURI (cognitive 30) modules/caddyhttp/rewrite/caddyfile.go:97 — rewrite.parseCaddyfileURI has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.changeConfig (cognitive 29) · ×1
  • caddy.changeConfig (cognitive 29) caddy.go:158 — caddy.changeConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (26 pts), 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.
D2 · Cognitive Complexity · httpcaddyfile.parseHandleErrors (cognitive 29) · ×1
  • httpcaddyfile.parseHandleErrors (cognitive 29) caddyconfig/httpcaddyfile/builtins.go:829 — httpcaddyfile.parseHandleErrors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpcaddyfile.appendSubrouteToRouteList (cognitive 29) · ×1
  • httpcaddyfile.appendSubrouteToRouteList (cognitive 29) REDACTED:1389 — httpcaddyfile.appendSubrouteToRouteList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (9 pts), 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.
D2 · Cognitive Complexity · httpcaddyfile.parseOptOnDemand (cognitive 29) · ×1
  • httpcaddyfile.parseOptOnDemand (cognitive 29) caddyconfig/httpcaddyfile/options.go:404 — httpcaddyfile.parseOptOnDemand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · caddyhttp.ParseNamedResponseMatcher (cognitive 29) · ×1
  • caddyhttp.ParseNamedResponseMatcher (cognitive 29) modules/caddyhttp/responsematchers.go:69 — caddyhttp.ParseNamedResponseMatcher has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fileserver.cmdFileServer (cognitive 29) · ×1
  • fileserver.cmdFileServer (cognitive 29) modules/caddyhttp/fileserver/command.go:86 — fileserver.cmdFileServer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 1 (2 pts), 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.
D2 · Cognitive Complexity · MatchHost.MatchWithError (cognitive 29) · ×1
  • MatchHost.MatchWithError (cognitive 29) modules/caddyhttp/matchers.go:307 — MatchHost.MatchWithError has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), boolean chains 2, jumps 1 (nesting depth added 14). Of this number, 27 points are the body's 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.
D2 · Cognitive Complexity · Tracing.UnmarshalCaddyfile (cognitive 29) · ×1
  • Tracing.UnmarshalCaddyfile (cognitive 29) modules/caddyhttp/tracing/module.go:80 — Tracing.UnmarshalCaddyfile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 16). Of this number, 26 points are the body's 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.
D2 · Cognitive Complexity · httpcaddyfile.buildSubroute (cognitive 28) · ×1
  • httpcaddyfile.buildSubroute (cognitive 28) REDACTED:1454 — httpcaddyfile.buildSubroute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyhttp.matchHeaders (cognitive 28) · ×1
  • caddyhttp.matchHeaders (cognitive 28) modules/caddyhttp/matchers.go:1162 — caddyhttp.matchHeaders has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), match/switch 1 (4 pts), 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.
D2 · Cognitive Complexity · Authentication.ServeHTTP (cognitive 28) · ×1
  • Authentication.ServeHTTP (cognitive 28) REDACTED:89 — Authentication.ServeHTTP has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Handler.ServeHTTP (cognitive 28) · ×1
  • Handler.ServeHTTP (cognitive 28) modules/caddyhttp/reverseproxy/reverseproxy.go:627 — Handler.ServeHTTP has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadBalancing.tryAgain (cognitive 28) · ×1
  • LoadBalancing.tryAgain (cognitive 28) modules/caddyhttp/reverseproxy/reverseproxy.go:1544 — LoadBalancing.tryAgain has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), 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.
D2 · Cognitive Complexity · CookieHashSelection.UnmarshalCaddyfile (cognitive 28) · ×1
  • CookieHashSelection.UnmarshalCaddyfile (cognitive 28) REDACTED:742 — CookieHashSelection.UnmarshalCaddyfile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (3 pts), 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.
D2 · Cognitive Complexity · caddyfile.isSingleUnbracedSite (cognitive 27) · ×1
  • caddyfile.isSingleUnbracedSite (cognitive 27) caddyconfig/caddyfile/formatter.go:151 — caddyfile.isSingleUnbracedSite has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.parseEnvFile (cognitive 27) · ×1
  • caddycmd.parseEnvFile (cognitive 27) cmd/main.go:384 — caddycmd.parseEnvFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Intercept.UnmarshalCaddyfile (cognitive 27) · ×1
  • Intercept.UnmarshalCaddyfile (cognitive 27) modules/caddyhttp/intercept/intercept.go:232 — Intercept.UnmarshalCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 1 (2 pts), 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.
D2 · Cognitive Complexity · maphandler.parseCaddyfile (cognitive 27) · ×1
  • maphandler.parseCaddyfile (cognitive 27) modules/caddyhttp/map/caddyfile.go:44 — maphandler.parseCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticResponse.ServeHTTP (cognitive 27) · ×1
  • StaticResponse.ServeHTTP (cognitive 27) modules/caddyhttp/staticresp.go:181 — StaticResponse.ServeHTTP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CA.Provision (cognitive 27) · ×1
  • CA.Provision (cognitive 27) modules/caddypki/ca.go:99 — CA.Provision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · caddytls.ParseCaddyfilePreferredChainsOptions (cognitive 27) · ×1
  • caddytls.ParseCaddyfilePreferredChainsOptions (cognitive 27) modules/caddytls/acmeissuer.go:699 — caddytls.ParseCaddyfilePreferredChainsOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutomationPolicy.Provision (cognitive 27) · ×1
  • AutomationPolicy.Provision (cognitive 27) REDACTED:182 — AutomationPolicy.Provision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TLSConfig.unmarshalCaddyfile (cognitive 27) · ×1
  • TLSConfig.unmarshalCaddyfile (cognitive 27) REDACTED:539 — TLSConfig.unmarshalCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 2 (5 pts), 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.
D2 · Cognitive Complexity · TLS.Cleanup (cognitive 27) · ×1
  • TLS.Cleanup (cognitive 27) REDACTED:522 — TLS.Cleanup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.directive (cognitive 26) · ×1
  • parser.directive (cognitive 26) caddyconfig/caddyfile/parse.go:700 — parser.directive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), 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.
D2 · Cognitive Complexity · caddyhttp.CELValueToMapStrList (cognitive 26) · ×1
  • caddyhttp.CELValueToMapStrList (cognitive 26) REDACTED:684 — caddyhttp.CELValueToMapStrList has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (9 pts), match/switch 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transport.splitPos (cognitive 26) · ×1
  • Transport.splitPos (cognitive 26) modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:468 — Transport.splitPos has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpcaddyfile.parseSegmentAsConfig (cognitive 25) · ×1
  • httpcaddyfile.parseSegmentAsConfig (cognitive 25) caddyconfig/httpcaddyfile/directives.go:366 — httpcaddyfile.parseSegmentAsConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (10 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Intercept.ServeHTTP (cognitive 25) · ×1
  • Intercept.ServeHTTP (cognitive 25) modules/caddyhttp/intercept/intercept.go:115 — Intercept.ServeHTTP has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 3, loops 2 (nesting depth added 6). Of this number, 15 points are the body's 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.
D2 · Cognitive Complexity · push.parseCaddyfile (cognitive 25) · ×1
  • push.parseCaddyfile (cognitive 25) modules/caddyhttp/push/caddyfile.go:46 — push.parseCaddyfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.logRequest (cognitive 25) · ×1
  • Server.logRequest (cognitive 25) modules/caddyhttp/server.go:1392 — Server.logRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppendEncoder.UnmarshalCaddyfile (cognitive 25) · ×1
  • AppendEncoder.UnmarshalCaddyfile (cognitive 25) modules/logging/appendencoder.go:130 — AppendEncoder.UnmarshalCaddyfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 14). Of this number, 22 points are the body's 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.
D2 · Cognitive Complexity · caddycmd.overwriteFormattedFiles (cognitive 24) · ×1
  • caddycmd.overwriteFormattedFiles (cognitive 24) cmd/commandfuncs.go:820 — caddycmd.overwriteFormattedFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rewrite.buildQueryString (cognitive 24) · ×1
  • rewrite.buildQueryString (cognitive 24) modules/caddyhttp/rewrite/rewrite.go:366 — rewrite.buildQueryString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 19 points are the body's 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.
D2 · Cognitive Complexity · HTTPCertPool.Provision (cognitive 24) · ×1
  • HTTPCertPool.Provision (cognitive 24) REDACTED:660 — HTTPCertPool.Provision has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TLS.HandleHTTPChallenge (cognitive 24) · ×1
  • TLS.HandleHTTPChallenge (cognitive 24) REDACTED:810 — TLS.HandleHTTPChallenge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IPMaskFilter.UnmarshalCaddyfile (cognitive 24) · ×1
  • IPMaskFilter.UnmarshalCaddyfile (cognitive 24) modules/logging/filters.go:173 — IPMaskFilter.UnmarshalCaddyfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpcaddyfile.applyServerOptions (cognitive 23) · ×1
  • httpcaddyfile.applyServerOptions (cognitive 23) caddyconfig/httpcaddyfile/serveroptions.go:412 — httpcaddyfile.applyServerOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3, boolean chains 1 (nesting depth added 10). Of this number, 22 points are the body's 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.
D2 · Cognitive Complexity · HTTPLoader.makeClient (cognitive 23) · ×1
  • HTTPLoader.makeClient (cognitive 23) REDACTED:170 — HTTPLoader.makeClient has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.cmdImportStorage (cognitive 23) · ×1
  • caddycmd.cmdImportStorage (cognitive 23) cmd/storagefuncs.go:63 — caddycmd.cmdImportStorage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionPolicies.Provision (cognitive 23) · ×1
  • ConnectionPolicies.Provision (cognitive 23) REDACTED:52 — ConnectionPolicies.Provision has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.indexConfigObjects (cognitive 22) · ×1
  • caddy.indexConfigObjects (cognitive 22) caddy.go:290 — caddy.indexConfigObjects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — 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.
D2 · Cognitive Complexity · caddy.listenReusable (cognitive 22) · ×1
  • caddy.listenReusable (cognitive 22) listen_unix.go:108 — caddy.listenReusable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 pts) (nesting depth added 8). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 43, 67, 88). 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' 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.
D2 · Cognitive Complexity · caddyfile.hasUnformattableToken (cognitive 22) · ×1
  • caddyfile.hasUnformattableToken (cognitive 22) caddyconfig/caddyfile/formatter.go:373 — caddyfile.hasUnformattableToken has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · App.Validate (cognitive 22) · ×1
  • App.Validate (cognitive 22) REDACTED:426 — App.Validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (9 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchFile.UnmarshalCaddyfile (cognitive 22) · ×1
  • MatchFile.UnmarshalCaddyfile (cognitive 22) modules/caddyhttp/fileserver/matcher.go:132 — MatchFile.UnmarshalCaddyfile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · headers.applyHeaderOp (cognitive 22) · ×1
  • headers.applyHeaderOp (cognitive 22) modules/caddyhttp/headers/caddyfile.go:239 — headers.applyHeaderOp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — 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.
D2 · Cognitive Complexity · TLS.Manage (cognitive 22) · ×1
  • TLS.Manage (cognitive 22) REDACTED:605 — TLS.Manage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · network.SRV (cognitive 22) · ×1
  • network.SRV (cognitive 22) modules/internal/network/dynamicupstreams.go:59 — network.SRV has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyhttp.CELMatcherDecorator (cognitive 21) · ×1
  • caddyhttp.CELMatcherDecorator (cognitive 21) REDACTED:484 — caddyhttp.CELMatcherDecorator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 485). 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's 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.
D2 · Cognitive Complexity · Zstd.UnmarshalCaddyfile (cognitive 21) · ×1
  • Zstd.UnmarshalCaddyfile (cognitive 21) modules/caddyhttp/encode/zstd/zstd.go:53 — Zstd.UnmarshalCaddyfile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 pts), 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.
D2 · Cognitive Complexity · fileserver.parseTryFiles (cognitive 21) · ×1
  • fileserver.parseTryFiles (cognitive 21) modules/caddyhttp/fileserver/caddyfile.go:262 — fileserver.parseTryFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (5 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fileserver.fileHidden (cognitive 21) · ×1
  • fileserver.fileHidden (cognitive 21) REDACTED:743 — fileserver.fileHidden has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActiveHealthChecks.Provision (cognitive 21) · ×1
  • ActiveHealthChecks.Provision (cognitive 21) modules/caddyhttp/reverseproxy/healthchecks.go:137 — ActiveHealthChecks.Provision has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 3 (4 pts) (nesting depth added 4). Of this number, 20 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · templates.extractFrontMatter (cognitive 21) · ×1
  • templates.extractFrontMatter (cognitive 21) modules/caddyhttp/templates/frontmatter.go:13 — templates.extractFrontMatter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StoragePool.Provision (cognitive 21) · ×1
  • StoragePool.Provision (cognitive 21) REDACTED:406 — StoragePool.Provision has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerType.extractNamedRoutes (cognitive 20) · ×1
  • ServerType.extractNamedRoutes (cognitive 20) REDACTED:475 — ServerType.extractNamedRoutes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.cmdStart (cognitive 20) · ×1
  • caddycmd.cmdStart (cognitive 20) cmd/commandfuncs.go:46 — caddycmd.cmdStart has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2, match/switch 1 (nesting depth added 4). Of this number, 12 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · caddycmd.cmdAdaptConfig (cognitive 20) · ×1
  • caddycmd.cmdAdaptConfig (cognitive 20) cmd/commandfuncs.go:548 — caddycmd.cmdAdaptConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · NetworkAddress.listen (cognitive 20) · ×1
  • NetworkAddress.listen (cognitive 20) REDACTED:150 — NetworkAddress.listen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logging.Logger (cognitive 20) · ×1
  • Logging.Logger (cognitive 20) logging.go:219 — Logging.Logger has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TLS.Validate (cognitive 20) · ×1
  • TLS.Validate (cognitive 20) REDACTED:374 — TLS.Validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.provisionContext (cognitive 19) · ×1
  • caddy.provisionContext (cognitive 19) caddy.go:484 — caddy.provisionContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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' 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.
D2 · Cognitive Complexity · httpcaddyfile.newBaseAutomationPolicy (cognitive 19) · ×1
  • httpcaddyfile.newBaseAutomationPolicy (cognitive 19) caddyconfig/httpcaddyfile/tlsapp.go:1001 — httpcaddyfile.newBaseAutomationPolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · caddycmd.getModules (cognitive 19) · ×1
  • caddycmd.getModules (cognitive 19) REDACTED:224 — caddycmd.getModules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomLog.provision (cognitive 19) · ×1
  • CustomLog.provision (cognitive 19) logging.go:490 — CustomLog.provision has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), 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.
D2 · Cognitive Complexity · Intercept.FinalizeUnmarshalCaddyfile (cognitive 19) · ×1
  • Intercept.FinalizeUnmarshalCaddyfile (cognitive 19) modules/caddyhttp/intercept/intercept.go:300 — Intercept.FinalizeUnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), 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.
D2 · Cognitive Complexity · Handler.FinalizeUnmarshalCaddyfile (cognitive 19) · ×1
  • Handler.FinalizeUnmarshalCaddyfile (cognitive 19) modules/caddyhttp/reverseproxy/caddyfile.go:981 — Handler.FinalizeUnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), 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.
D2 · Cognitive Complexity · StaticResponse.UnmarshalCaddyfile (cognitive 19) · ×1
  • StaticResponse.UnmarshalCaddyfile (cognitive 19) modules/caddyhttp/staticresp.go:141 — StaticResponse.UnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddytls.loadECHConfig (cognitive 19) · ×1
  • caddytls.loadECHConfig (cognitive 19) REDACTED:559 — caddytls.loadECHConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ACMEIssuer.makeIssuerTemplate (cognitive 19) · ×1
  • ACMEIssuer.makeIssuerTemplate (cognitive 19) modules/caddytls/acmeissuer.go:254 — ACMEIssuer.makeIssuerTemplate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). Of this number, 17 points are the body's 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.
D2 · Cognitive Complexity · ECH.Provision (cognitive 19) · ×1
  • ECH.Provision (cognitive 19) REDACTED:80 — ECH.Provision has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 15 points are the body's 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.
D2 · Cognitive Complexity · MultiRegexpFilter.UnmarshalCaddyfile (cognitive 19) · ×1
  • MultiRegexpFilter.UnmarshalCaddyfile (cognitive 19) modules/logging/filters.go:871 — MultiRegexpFilter.UnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.DetermineAdminAPIAddress (cognitive 18) · ×1
  • caddycmd.DetermineAdminAPIAddress (cognitive 18) cmd/commandfuncs.go:1038 — caddycmd.DetermineAdminAPIAddress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (18 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddycmd.upgradeBuild (cognitive 18) · ×1
  • caddycmd.upgradeBuild (cognitive 18) REDACTED:132 — caddycmd.upgradeBuild has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). Of this number, 15 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · BaseLog.provisionCommon (cognitive 18) · ×1
  • BaseLog.provisionCommon (cognitive 18) logging.go:342 — BaseLog.provisionCommon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyhttp.ParseCaddyfileNestedMatcherSet (cognitive 18) · ×1
  • caddyhttp.ParseCaddyfileNestedMatcherSet (cognitive 18) modules/caddyhttp/matchers.go:1690 — caddyhttp.ParseCaddyfileNestedMatcherSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fileserver.hasWindowsShortName (cognitive 18) · ×1
  • fileserver.hasWindowsShortName (cognitive 18) REDACTED:293 — fileserver.hasWindowsShortName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 6). Of this number, 17 points are the body's 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.
D2 · Cognitive Complexity · HeaderOps.Provision (cognitive 18) · ×1
  • HeaderOps.Provision (cognitive 18) modules/caddyhttp/headers/headers.go:136 — HeaderOps.Provision has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchHeader.UnmarshalCaddyfile (cognitive 18) · ×1
  • MatchHeader.UnmarshalCaddyfile (cognitive 18) modules/caddyhttp/matchers.go:1069 — MatchHeader.UnmarshalCaddyfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · echConfig.UnmarshalBinary (cognitive 18) · ×1
  • echConfig.UnmarshalBinary (cognitive 18) REDACTED:998 — echConfig.UnmarshalBinary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · MatchRemoteIP.UnmarshalCaddyfile (cognitive 18) · ×1
  • MatchRemoteIP.UnmarshalCaddyfile (cognitive 18) modules/caddytls/matchers.go:403 — MatchRemoteIP.UnmarshalCaddyfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.exitProcess (cognitive 17) · ×1
  • caddy.exitProcess (cognitive 17) caddy.go:758 — caddy.exitProcess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (nesting depth added 3). Of this number, 9 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · parser.begin (cognitive 17) · ×1
  • parser.begin (cognitive 17) caddyconfig/caddyfile/parse.go:158 — parser.begin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpcaddyfile.sortRoutes (cognitive 17) · ×1
  • httpcaddyfile.sortRoutes (cognitive 17) caddyconfig/httpcaddyfile/directives.go:456 — httpcaddyfile.sortRoutes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 462). 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's 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.
D2 · Cognitive Complexity · httpcaddyfile.parseMatcherDefinitions (cognitive 17) · ×1
  • httpcaddyfile.parseMatcherDefinitions (cognitive 17) REDACTED:1701 — httpcaddyfile.parseMatcherDefinitions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, boolean chains 1 (nesting depth added 4). Of this number, 12 points are the body's 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.
D2 · Cognitive Complexity · Tester.initServer (cognitive 17) · ×1
  • Tester.initServer (cognitive 17) REDACTED:131 — Tester.initServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · HTTPBasicAuth.Provision (cognitive 17) · ×1
  • HTTPBasicAuth.Provision (cognitive 17) REDACTED:79 — HTTPBasicAuth.Provision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fileserver.isCELTryFilesLiteral (cognitive 17) · ×1
  • fileserver.isCELTryFilesLiteral (cognitive 17) modules/caddyhttp/fileserver/matcher.go:637 — fileserver.isCELTryFilesLiteral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — 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.
D2 · Cognitive Complexity · browseTemplateContext.applySortAndLimit (cognitive 17) · ×1
  • browseTemplateContext.applySortAndLimit (cognitive 17) modules/caddyhttp/fileserver/browsetplcontext.go:229 — browseTemplateContext.applySortAndLimit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · FolderLoader.LoadCertificates (cognitive 17) · ×1
  • FolderLoader.LoadCertificates (cognitive 17) modules/caddytls/folderloader.go:63 — FolderLoader.LoadCertificates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), 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's 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.
D2 · Cognitive Complexity · NetWriter.UnmarshalCaddyfile (cognitive 17) · ×1
  • NetWriter.UnmarshalCaddyfile (cognitive 17) modules/logging/netwriter.go:119 — NetWriter.UnmarshalCaddyfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddy.handleConfig (cognitive 16) · ×1
  • caddy.handleConfig (cognitive 16) REDACTED:1027 — caddy.handleConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — 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.
D2 · Cognitive Complexity · caddy.run (cognitive 16) · ×1
  • caddy.run (cognitive 16) caddy.go:419 — caddy.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (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' 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.
D2 · Cognitive Complexity · caddy.ParseNetworkAddressWithDefaults (cognitive 16) · ×1
  • caddy.ParseNetworkAddressWithDefaults (cognitive 16) REDACTED:324 — caddy.ParseNetworkAddressWithDefaults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caddyfile.makeArgsReplacer (cognitive 16) · ×1
  • caddyfile.makeArgsReplacer (cognitive 16) caddyconfig/caddyfile/importargs.go:98 — caddyfile.makeArgsReplacer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). None of this is in the body itself: all 16 points belong 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's 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.
D2 · Cognitive Complexity · ListenerWrapper.Provision (cognitive 16) · ×1
  • ListenerWrapper.Provision (cognitive 16) modules/caddyhttp/proxyprotocol/listenerwrapper.go:89 — ListenerWrapper.Provision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), 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's 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.
D2 · Cognitive Complexity · ListenerWrapper.UnmarshalCaddyfile (cognitive 16) · ×1
  • ListenerWrapper.UnmarshalCaddyfile (cognitive 16) modules/caddyhttp/proxyprotocol/module.go:41 — ListenerWrapper.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CookieHashSelection.Select (cognitive 16) · ×1
  • CookieHashSelection.Select (cognitive 16) REDACTED:678 — CookieHashSelection.Select has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (nesting depth added 2). Of this number, 8 points are the body's 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 — checks laid out side by side rather than stacked — 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.
D2 · Cognitive Complexity · MatcherSet.MatchWithError (cognitive 16) · ×1
  • MatcherSet.MatchWithError (cognitive 16) REDACTED:374 — MatcherSet.MatchWithError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticError.UnmarshalCaddyfile (cognitive 16) · ×1
  • StaticError.UnmarshalCaddyfile (cognitive 16) modules/caddyhttp/staticerror.go:62 — StaticError.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateContext.funcMaybe (cognitive 16) · ×1
  • TemplateContext.funcMaybe (cognitive 16) modules/caddyhttp/templates/tplcontext.go:532 — TemplateContext.funcMaybe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Timeouts.ServeHTTP (cognitive 16) · ×1
  • Timeouts.ServeHTTP (cognitive 16) modules/caddyhttp/timeouts/timeouts.go:89 — Timeouts.ServeHTTP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchURLPattern.UnmarshalCaddyfile (cognitive 16) · ×1
  • MatchURLPattern.UnmarshalCaddyfile (cognitive 16) modules/caddyhttp/urlpatternmatcher.go:207 — MatchURLPattern.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VarsMatcher.MatchWithError (cognitive 16) · ×1
  • VarsMatcher.MatchWithError (cognitive 16) modules/caddyhttp/vars.go:177 — VarsMatcher.MatchWithError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CA.loadOrGenRoot (cognitive 16) · ×1
  • CA.loadOrGenRoot (cognitive 16) modules/caddypki/ca.go:277 — CA.loadOrGenRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeyPair.Load (cognitive 16) · ×1
  • KeyPair.Load (cognitive 16) modules/caddypki/crypto.go:91 — KeyPair.Load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — 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.
D2 · Cognitive Complexity · ClientAuthentication.ConfigureTLSConfig (cognitive 16) · ×1
  • ClientAuthentication.ConfigureTLSConfig (cognitive 16) REDACTED:844 — ClientAuthentication.ConfigureTLSConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TLS.AddAutomationPolicy (cognitive 16) · ×1
  • TLS.AddAutomationPolicy (cognitive 16) REDACTED:859 — TLS.AddAutomationPolicy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), 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.
D2 · Cognitive Complexity · FileStorage.UnmarshalCaddyfile (cognitive 16) · ×1
  • FileStorage.UnmarshalCaddyfile (cognitive 16) modules/filestorage/filestorage.go:48 — FileStorage.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogEncoderConfig.ZapcoreEncoderConfig (cognitive 16) · ×1
  • LogEncoderConfig.ZapcoreEncoderConfig (cognitive 16) modules/logging/encoders.go:203 — LogEncoderConfig.ZapcoreEncoderConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 4 (5 pts) (nesting depth added 2). Of this number, 13 points are the body's 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 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) modules/caddyhttp/intercept/intercept.go:301 — modules/caddyhttp/intercept/intercept.go:301-362 | modules/caddyhttp/reverseproxy/caddyfile.go:982-1043 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) modules/logging/filters.go:499 — modules/logging/filters.go:499-539 | modules/logging/filters.go:622-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) modules/logging/appendencoder.go:146 — modules/logging/appendencoder.go:146-183 | REDACTED:195-232 — before extracting anything, compare `modules/logging/appendencoder.go` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/logging/appendencoder.go:146` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) modules/caddyhttp/intercept/intercept.go:250 — modules/caddyhttp/intercept/intercept.go:250-286 | modules/caddyhttp/reverseproxy/caddyfile.go:883-919 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/intercept/intercept.go:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) modules/caddyhttp/vars.go:186 — modules/caddyhttp/vars.go:186-216 | modules/caddyhttp/vars.go:332-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/vars.go:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) modules/caddyhttp/matchers.go:1623 — modules/caddyhttp/matchers.go:1623-1652 | modules/caddytls/matchers.go:202-231 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) modules/caddytls/fileloader.go:88 — modules/caddytls/fileloader.go:88-116 | modules/caddytls/storageloader.go:84-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddytls/fileloader.go:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) listen.go:36 — listen.go:36-63 | listen_unix.go:119-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `listen_unix.go:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — 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 `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — 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.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) modules/caddyhttp/matchers.go:1657 — modules/caddyhttp/matchers.go:1657-1681 | modules/caddytls/matchers.go:236-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/matchers.go:1657` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) modules/caddyhttp/reverseproxy/caddyfile.go:1557 — modules/caddyhttp/reverseproxy/caddyfile.go:1557-1583 | modules/caddyhttp/reverseproxy/caddyfile.go:1657-1683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/reverseproxy/caddyfile.go:1557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) cmd/storagefuncs.go:75 — cmd/storagefuncs.go:75-95 | cmd/storagefuncs.go:147-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — 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.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) REDACTED:252 — REDACTED:252-267 | REDACTED:400-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:252` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) caddyconfig/httpcaddyfile/addresses.go:135 — caddyconfig/httpcaddyfile/addresses.go:135-153 | caddyconfig/httpcaddyfile/addresses.go:198-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddyconfig/httpcaddyfile/addresses.go:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) modules/caddypki/adminapi.go:95 — modules/caddypki/adminapi.go:95-113 | modules/caddypki/adminapi.go:145-163 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) caddyconfig/load.go:74 — caddyconfig/load.go:74-91 | caddyconfig/load.go:145-162 — both copies are in the same file, so extract the block into one function there and call it from each site — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) modules/caddyhttp/fileserver/command.go:193 — modules/caddyhttp/fileserver/command.go:193-209 | modules/caddyhttp/staticresp.go:420-434 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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 `modules/caddyhttp/fileserver/command.go:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — 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 — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) modules/caddyhttp/headers/headers.go:318 — modules/caddyhttp/headers/headers.go:318-334 | modules/caddyhttp/headers/headers.go:347-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/headers/headers.go:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/caddyhttp/headers/headers.go:344` calls `CanonicalHeaderKey` and `modules/caddyhttp/headers/headers.go:317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) modules/caddyhttp/reverseproxy/caddyfile.go:1164 — modules/caddyhttp/reverseproxy/caddyfile.go:1164-1179 | modules/caddyhttp/reverseproxy/caddyfile.go:1576-1591 | modules/caddyhttp/reverseproxy/caddyfile.go:1676-1691 — 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 — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:1164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) caddy.go:228 — caddy.go:228-238 | caddy.go:248-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `caddy.go:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) modules/caddyhttp/headers/caddyfile.go:83 — modules/caddyhttp/headers/caddyfile.go:83-95 | modules/caddyhttp/headers/caddyfile.go:127-140 — both copies are in the same file, so extract the block into one function there and call it from each site — 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) modules/caddyhttp/reverseproxy/command.go:301 — modules/caddyhttp/reverseproxy/command.go:301-312 | modules/caddyhttp/staticresp.go:432-444 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) modules/caddyhttp/intercept/intercept.go:264 — modules/caddyhttp/intercept/intercept.go:264-271 | modules/caddyhttp/intercept/intercept.go:311-320 | modules/caddyhttp/reverseproxy/caddyfile.go:897-904 | modules/caddyhttp/reverseproxy/caddyfile.go:992-1001 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `modules/caddyhttp/intercept/intercept.go:264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) REDACTED:550 — REDACTED:550-558 | REDACTED:588-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:588` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — 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 — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) caddyconfig/httpcaddyfile/builtins.go:350 — caddyconfig/httpcaddyfile/builtins.go:350-358 | caddyconfig/httpcaddyfile/builtins.go:372-380 | caddyconfig/httpcaddyfile/builtins.go:400-408 | caddyconfig/httpcaddyfile/builtins.go:422-430 | caddyconfig/httpcaddyfile/builtins.go:439-447 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) modules/caddyhttp/reverseproxy/caddyfile.go:357 — modules/caddyhttp/reverseproxy/caddyfile.go:357-366 | modules/caddyhttp/reverseproxy/caddyfile.go:390-399 | modules/caddyhttp/reverseproxy/caddyfile.go:439-448 | modules/caddyhttp/reverseproxy/caddyfile.go:451-460 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — 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 `modules/caddyhttp/reverseproxy/caddyfile.go:357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `modules/caddyhttp/reverseproxy/caddyfile.go:368` calls `Log`, `Named`, `Warn` and `modules/caddyhttp/reverseproxy/caddyfile.go:451` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) modules/caddyhttp/server.go:902 — modules/caddyhttp/server.go:902-907 | modules/caddyhttp/server.go:917-922 | modules/caddyhttp/server.go:932-937 — 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 — 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 `modules/caddyhttp/server.go:902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P12 · CI test-gate honesty · Coverage collected but not gated · ×1
  • Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Minor — 51 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×12
  • Orphaned file modules/caddyhttp/caddyauth/argon2id.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file caddyconfig/httpcaddyfile/shorthands.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddyhttp/tracing/module.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddytls/leafstorageloader.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/metrics/metrics.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file notify/notify_windows.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddytls/leaffileloader.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddytls/leaffolderloader.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddyfs/filesystem.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file metrics.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/caddytls/leafpemloader.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file modules/logging/filewriter_test_windows.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X10 · Duplicated predicate · Duplicated predicate · ×12
  • Duplicated predicate REDACTED:105 — `!errors.Is(err, context.Canceled) && ctx.Err() == nil` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate caddy.go:875 — `b[0] == byte('"') && b[len(b)-1] == byte('"')` appears character-identically in 2 files — caddy.go, modules/caddyhttp/caddyhttp.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/logging/appendencoder.go:110 — `caddy.IsWriterStandardStream(wo) && term.IsTerminal(int(os.Stderr.Fd()))` appears character-identically in 3 files — modules/logging/appendencoder.go, REDACTED, modules/logging/journaldencoder.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/reverseproxy/reverseproxy.go:1435 — `h.Headers != nil && h.Headers.Response != nil` appears character-identically in 2 files — modules/caddyhttp/reverseproxy/reverseproxy.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/reverseproxy/caddyfile.go:278 — `h.LoadBalancing != nil && h.LoadBalancing.SelectionPolicyRaw != nil` appears character-identically in 2 files — modules/caddyhttp/reverseproxy/caddyfile.go, modules/caddyhttp/reverseproxy/reverseproxy.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:766 — `isCELStringLiteral(e) || isCELCaddyPlaceholderCall(e) || isCELConcatCall(e)` appears character-identically in 2 files — REDACTED, modules/caddyhttp/fileserver/matcher.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/responsematchers.go:104 — `len(arg) == 3 && strings.HasSuffix(arg, "xx")` appears character-identically in 2 files — modules/caddyhttp/responsematchers.go, modules/caddyhttp/reverseproxy/caddyfile.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/matchers.go:1612 — `mre.Name != "" && !wordRE.MatchString(mre.Name)` appears character-identically in 2 files — modules/caddyhttp/matchers.go, modules/caddytls/matchers.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/server.go:655 — `r.ProtoMajor == 1 && r.ContentLength != 0` appears character-identically in 2 files — modules/caddyhttp/server.go, modules/caddyhttp/timeouts/timeouts.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/replacer.go:154 — `req.TLS != nil && !req.TLS.HandshakeComplete` appears character-identically in 2 files — modules/caddyhttp/replacer.go, modules/caddyhttp/reverseproxy/reverseproxy.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate modules/caddyhttp/push/handler.go:89 — `server.Logs != nil && server.Logs.ShouldLogCredentials` appears character-identically in 3 files — modules/caddyhttp/push/handler.go, modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go, modules/caddyhttp/reverseproxy/reverseproxy.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:738 — `srv.AutoHTTPS == nil || !srv.AutoHTTPS.Disabled` appears character-identically in 2 files — REDACTED, modules/caddyhttp/autohttps.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on error · ×2
  • Silent fallback default on error modules/caddyhttp/replacer.go:579 — `getTLSReplacement` turns a non-nil `err` into `return nil, true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error modules/caddyhttp/server.go:1864 — `determineTrustedProxy` turns a non-nil `err` into `return false, ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×1
  • 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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • 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 — folded into the bus-factor score and metrics (9 single-owned of 162 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 162 of the 227 production source files in this repository met that bar). 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)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: modules/logging/journaldencoder.go, modules/internal/network/networkproxy.go, modules/caddyhttp/reverseproxy/fastcgi/writer.go, listen_reuseUnixSocket_windows.go, notify/notify_windows.go, modules/caddyhttp/templates/frontmatter.go, caddyconfig/caddyfile/importgraph.go, modules/caddytls/pemloader.go.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (66507 LoC, 386 module-visible types across 45 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 12 of 165 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 165 of the 227 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: modules/caddyhttp/caddyauth/argon2id.go, caddyconfig/httpcaddyfile/shorthands.go, modules/caddyhttp/tracing/module.go, modules/caddytls/leafstorageloader.go, modules/metrics/metrics.go, notify/notify_windows.go, modules/caddytls/leaffileloader.go, modules/caddytls/leaffolderloader.go (and 4 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift README.md:116 — README.md changes into `caddy/cmd/caddy/`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected caddytest/integration/testdata/issue_7557_invalid_subdirective_snippet.conf:4 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `issue_7557_invalid_subdirective_snippet.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation · Not all functions that make a request accept a context.Context · ×1
  • Not all functions that make a request accept a context.Context — Only 7/12 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Minor — 22 finding(s)
D12 · Dependency Hygiene · Outdated · ×22
  • Outdated: github.com/DeRuina/timberjack — `github.com/DeRuina/timberjack` is required at v1.4.8 in REDACTED, but v1.4.9 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/DeRuina/timberjack@v1.4.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/KimMachineGun/automemlimit — `github.com/KimMachineGun/automemlimit` is required at v1.0.0 in REDACTED, but v1.0.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/KimMachineGun/automemlimit@v1.0.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/dunglas/httpsfv — `github.com/dunglas/httpsfv` is required at v1.1.1 in REDACTED, but v1.1.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/dunglas/httpsfv@v1.1.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/go-chi/chi/v5 — `github.com/go-chi/chi/v5` is required at v5.3.2 in REDACTED, but v5.5.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/go-chi/chi/v5@v5.5.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/klauspost/compress — `github.com/klauspost/compress` is required at v1.20.1 in REDACTED, but v1.20.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/klauspost/compress@v1.20.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/klauspost/cpuid/v2 — `github.com/klauspost/cpuid/v2` is required at v2.4.0 in REDACTED, but v2.4.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/klauspost/cpuid/v2@v2.4.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pires/go-proxyproto — `github.com/pires/go-proxyproto` is required at v0.15.0 in REDACTED, but v0.16.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pires/go-proxyproto@v0.16.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/prometheus/client_golang — `github.com/prometheus/client_golang` is required at v1.24.1 in REDACTED, but v1.25.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/client_golang@v1.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/quic-go/quic-go — `github.com/quic-go/quic-go` is required at v0.63.0 in REDACTED, but v0.64.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/quic-go/quic-go@v0.64.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/contrib/bridges/prometheus — `go.opentelemetry.io/contrib/bridges/prometheus` is required at v0.71.0 in REDACTED, but v0.72.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/contrib/bridges/prometheus@v0.72.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/contrib/exporters/autoexport — `go.opentelemetry.io/contrib/exporters/autoexport` is required at v0.71.0 in REDACTED, but v0.72.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/contrib/exporters/autoexport@v0.72.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp — `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` is required at v0.71.0 in REDACTED, but v0.72.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.72.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/contrib/propagators/autoprop — `go.opentelemetry.io/contrib/propagators/autoprop` is required at v0.71.0 in REDACTED, but v0.72.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/contrib/propagators/autoprop@v0.72.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel — `go.opentelemetry.io/otel` is required at v1.46.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/sdk — `go.opentelemetry.io/otel/sdk` is required at v1.46.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/sdk@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/sdk/metric — `go.opentelemetry.io/otel/sdk/metric` is required at v1.46.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/sdk/metric@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.opentelemetry.io/otel/trace — `go.opentelemetry.io/otel/trace` is required at v1.46.0 in REDACTED, but v1.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.opentelemetry.io/otel/trace@v1.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.57.0 in REDACTED, but v0.58.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/crypto@v0.58.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/net — `golang.org/x/net` is required at v0.60.0 in REDACTED, but v0.61.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/net@v0.61.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.23.0 in REDACTED, but v0.24.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sync@v0.24.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.48.0 in REDACTED, but v0.49.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.49.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/term — `golang.org/x/term` is required at v0.46.0 in REDACTED, but v0.47.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/term@v0.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-9b7440c0c59a4d648d64241be0ae2321/history.json --exit-code 0 --source .6artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-9b7440c0c59a4d648d64241be0ae2321/tree.json --exit-code 0 --source .4artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .72artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-2f9f77a7e9324ad5a5a0c7512e3c94ab3artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-2f9f77a7e9324ad5a5a0c7512e3c94ab0artifacts/raw/osv-scanner.json

Run 01a16ad2-3b72-7afd-aabb-3b19047b14fd · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md