tailscale/tailcat
like netcat, but over Tailscale's data plane, without Tailscale's control plane
Go★ 9,548+256 that day#7 on trending
C55/100
Duplication78
3.1% in go, c-header, javascript, c, bash, nixDead coden/a
the languages dead code reads are under 5% of the codeComplexity39
72.4% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
0.7%duplicated code · 93 of 13,308 lines
9clones in code
43code files of 100 scanned
2.81%duplicated over all files · 65 clones
Most complex files
- cmd/tailcat/tailcat.go481 cx
- tailcat.go402 cx
- tailcat_test.go374 cx
- internal/perf/perf.go278 cx
- internal/capi/api.go148 cx
- cmd/tailcat/cli_test.go141 cx
- cmd/tailcat/socks_test.go127 cx
- cmd/tailcat/perf.go110 cx
- internal/perf/perf_test.go109 cx
- tailcat_ssh_test.go108 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.
Largest clones in the code
- 19 lines in 2 placesgo131 tokens
652sys := &lb.sys 653bus := eventbus.New() 654sys.Set(bus) 655sys.Set(health.NewTracker(bus)) 656 657netMon, err := netmon.New(bus, func(format string, args ...any) { 658 logf(format, args...) 659}) 660if err != nil { 661 lb.Close() // closes the subsystems started so farFirst 10 of 19 lines.
- 11 lines in 2 placesgo90 tokens
148func tc_conn_read(id C.tc_handle, token C.tc_token, ptr unsafe.Pointer, size C.size_t, count *C.size_t, err **C.char) C.int32_t { 149 return guard(err, func() error { 150 if count == nil { 151 return capi.ErrArgument 152 } 153 *count = 0 154 b, err := buffer(ptr, size) 155 if err != nil { 156 return err 157 }First 10 of 11 lines.
- 11 lines in 2 placesgo88 tokens
2338func (c *Client) DialTCP(ctx context.Context, ap netip.AddrPort) (net.Conn, error) { 2339 if err := c.up(ctx); err != nil { 2340 return nil, err 2341 } 2342 if ap.Addr().Is4() { 2343 a := nat64PrefixBytes 2344 a4 := ap.Addr().As4() 2345 copy(a[12:], a4[:]) 2346 ap = netip.AddrPortFrom(netip.AddrFrom16(a), ap.Port()) 2347 }First 10 of 11 lines.
6 more
- 10 lines in 2 placesgo86 tokens
- 9 lines in 2 placesgo75 tokens
- 12 lines in 2 placesgo69 tokens
- 9 lines in 2 placesgo67 tokens
- 6 lines in 2 placesgo64 tokens
- 6 lines in 2 placesgo56 tokens
Largest clones over all files, tests and data included
- 8 lines in 6 placesgotests53 tokenslisten_test.go:19–26tailcat_test.go:360–367tailcat_test.go:418–425tailcat_test.go:512–519tailcat_test.go:1022–1029and 1 more
19func TestListen(t *testing.T) { 20 t.Parallel() 21 22 dm := integration.RunDERPAndSTUN(t, mkLogger(t, "derpstun"), "127.0.0.1") 23 reg := dm.Regions[1] 24 if reg == nil { 25 t.Fatal("no region 1 in derpmap") 26 } - 25 lines in 2 placesgotests196 tokens
711func TestUDPForward(t *testing.T) { 712 dm := integration.RunDERPAndSTUN(t, mkLogger(t, "derpstun"), "127.0.0.1") 713 reg := dm.Regions[1] 714 if reg == nil { 715 t.Fatal("no region 1 in derpmap") 716 } 717 718 backend, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)}) 719 if err != nil { 720 t.Fatal(err)First 10 of 25 lines.
- 26 lines in 2 placesgotests182 tokens
226dm := integration.RunDERPAndSTUN(t, testLogger(t, "derpstun"), "127.0.0.1") 227reg := dm.Regions[1] 228if reg == nil { 229 t.Fatal("no region 1 in derpmap") 230} 231 232backend, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)}) 233if err != nil { 234 t.Fatal(err) 235}First 10 of 26 lines.
- 25 lines in 2 placesgotests169 tokens
- 25 lines in 2 placesgotests156 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 40 | 12,516 | 9 | 93 | 0.74% |
| c-header | 1 | 407 | 0 | 0 | 0% |
| javascript | 1 | 344 | 0 | 0 | 0% |
| bash | 1 | 41 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 77 | 21,302 | 64 | 678 | 3.18% |
| yaml | 6 | 423 | 1 | 11 | 2.6% |
| markdown | 7 | 1,545 | 0 | 0 | 0% |
| c-header | 1 | 407 | 0 | 0 | 0% |
| javascript | 1 | 344 | 0 | 0 | 0% |
| bash | 3 | 188 | 0 | 0 | 0% |
| go-module | 1 | 113 | 0 | 0 | 0% |
| c | 2 | 66 | 0 | 0 | 0% |
| markup | 1 | 63 | 0 | 0 | 0% |
| nix | 1 | 38 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Nov 14, 2026 | #7 | 9,548 (+256) | 100 | 24,489 | 65 | 2.81% | 0.7% | C 55 | e00cdde |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.