5 views
caddyserver/caddy
Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Go★ 77,230+515 that day#6 on trending
D51.3/100
Duplication63
5.7% in go, bash, perlDead coden/a
the languages dead code reads are under 5% of the codeComplexity42
64% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
2.71%duplicated code · 1,989 of 73,444 lines
155clones in code
222code files of 398 scanned
5.55%duplicated over all files · 548 clones
Most complex files
- modules/caddyhttp/reverseproxy/caddyfile.go452 cx
- caddyconfig/httpcaddyfile/httptype.go443 cx
- modules/caddyhttp/reverseproxy/reverseproxy.go375 cx
- caddyconfig/httpcaddyfile/tlsapp.go340 cx
- modules/caddyhttp/matchers.go311 cx
- caddyconfig/httpcaddyfile/builtins.go248 cx
- modules/caddyhttp/server.go247 cx
- admin.go243 cx
- modules/caddytls/connpolicy.go229 cx
- modules/caddyhttp/reverseproxy/selectionpolicies_test.go227 cx
Dead code 0% unused · 0 findings
No dead code found — everything here is reachable.
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 1 generated file: modules/caddyhttp/encode/testdata/caddy_asciinema_player.js.
Largest clones in the code
- 10 lines in 8 placesgo54 tokensmodules/caddyhttp/reverseproxy/caddyfile.go:345–354modules/caddyhttp/reverseproxy/caddyfile.go:370–379modules/caddyhttp/reverseproxy/caddyfile.go:390–399modules/caddyhttp/reverseproxy/caddyfile.go:451–460modules/caddyhttp/reverseproxy/caddyfile.go:467–476and 3 more
345case "health_uri": 346 if !d.NextArg() { 347 return d.ArgErr() 348 } 349 if h.HealthChecks == nil { 350 h.HealthChecks = new(HealthChecks) 351 } 352 if h.HealthChecks.Active == nil { 353 h.HealthChecks.Active = new(ActiveHealthChecks) 354 } - 50 lines in 2 placesgo269 tokens
757 if call.FunctionName() == CELPlaceholderFuncName { 758 return true 759 } 760 case ast.UnspecifiedExprKind, ast.ComprehensionKind, ast.IdentKind, ast.ListKind, ast.LiteralKind, ast.MapKind, ast.SelectKind, ast.StructKind: 761 // appeasing the linter :) 762 } 763 return false 764} 765 766// isCELConcatCall tests whether the expression is a concat function (+) with string, placeholder, orFirst 10 of 50 lines.
- 42 lines in 2 placesgo248 tokensmodules/caddyhttp/reverseproxy/caddyfile.go:1555–1596modules/caddyhttp/reverseproxy/caddyfile.go:1655–1696
1555 u.Name = d.Val() 1556 1557case "refresh": 1558 if !d.NextArg() { 1559 return d.ArgErr() 1560 } 1561 dur, err := caddy.ParseDuration(d.Val()) 1562 if err != nil { 1563 return d.Errf("parsing refresh interval duration: %v", err) 1564 }First 10 of 42 lines.
7 more
- 11 lines in 5 placesgo60 tokens
- 39 lines in 2 placesgo206 tokens
- 45 lines in 2 placesgo194 tokens
- 38 lines in 2 placesgo174 tokens
- 35 lines in 2 placesgo168 tokens
- 10 lines in 4 placesgo54 tokens
- 8 lines in 4 placesgo53 tokens
Largest clones over all files, tests and data included
- 127 lines in 2 placesgotests479 tokens
236func TestParseNetworkAddress(t *testing.T) { 237 for i, tc := range []struct { 238 input string 239 defaultNetwork string 240 defaultPort uint 241 expectAddr NetworkAddress 242 expectErr bool 243 }{ 244 { 245 input: "",First 10 of 127 lines.
- 67 lines in 2 placesgotests469 tokens
36 httpMetrics: &httpMetrics{}, 37} 38handlerErr := errors.New("oh noes") 39response := []byte("hello world!") 40h := HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { 41 if actual := testutil.ToFloat64(metrics.httpMetrics.requestInFlight); actual != 1.0 { 42 t.Errorf("Not same: expected %#v, but got %#v", 1.0, actual) 43 } 44 if handlerErr == nil { 45 w.Write(response)First 10 of 67 lines.
- 14 lines in 5 placesgotests115 tokensmodules/caddyhttp/server_test.go:598–611modules/caddyhttp/server_test.go:617–630modules/caddyhttp/server_test.go:638–651modules/caddyhttp/server_test.go:659–672modules/caddyhttp/server_test.go:1153–1166
598func TestServer_serveHTTP_AllowlistKeepsExactMatch(t *testing.T) { 599 got := &http.Header{} 600 s := &Server{ 601 logger: zap.NewNop(), 602 ExpectedUnderscoreHeaders: []string{"user_id"}, 603 primaryHandlerChain: HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { 604 *got = r.Header.Clone() 605 return nil 606 }), 607 }First 10 of 14 lines.
- 9 lines in 6 placesgotests90 tokens
- 14 lines in 5 placesgotests105 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 212 | 72,626 | 155 | 1,989 | 2.74% |
| bash | 9 | 644 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 359 | 116,166 | 509 | 6,614 | 5.69% |
| markup | 2 | 2,661 | 31 | 217 | 8.15% |
| yaml | 13 | 2,034 | 5 | 69 | 3.39% |
| txt | 6 | 367 | 3 | 78 | 21.25% |
| css | 1 | 2,836 | 0 | 0 | 0% |
| markdown | 6 | 777 | 0 | 0 | 0% |
| bash | 10 | 651 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 6, 2026 | #6 | 77,230 (+515) | 398 | 125,666 | 548 | 5.55% | 2.71% | D 51.3 | 700d603 |
| Oct 5, 2026 | #4 | 76,652 (+24) | 397 | 125,140 | 547 | 5.57% | 2.71% | D 51.3 | 8507b63 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.