[{"data":1,"prerenderedAt":667},["ShallowReactive",2],{"navigation_docs":3,"trending-repo-tailscale\u002Ftailcat":249,"page-views-\u002Ftrending\u002Ftailscale\u002Ftailcat":665},[4,29,104,124,194],{"title":5,"icon":6,"path":7,"stem":8,"children":9},"Start",false,"\u002Fstart","1.start",[10,14,19,24],{"title":11,"path":7,"stem":12,"icon":13},"What jscpd finds","1.start\u002Findex","i-lucide-house",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fstart\u002Finstallation","1.start\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quickstart","\u002Fstart\u002Fquickstart","1.start\u002F3.quickstart","i-lucide-rocket",{"title":25,"path":26,"stem":27,"icon":28},"Configuration basics","\u002Fstart\u002Fconfiguration","1.start\u002F4.configuration","i-lucide-settings-2",{"title":30,"icon":6,"path":31,"stem":32,"children":33,"page":6},"Guides","\u002Fguides","2.guides",[34,39,44,49,54,59,64,69,74,79,84,89,94,99],{"title":35,"path":36,"stem":37,"icon":38},"Use jscpd in CI","\u002Fguides\u002Fci","2.guides\u002F01.ci","i-lucide-github",{"title":40,"path":41,"stem":42,"icon":43},"Pre-commit hooks","\u002Fguides\u002Fpre-commit","2.guides\u002F02.pre-commit","i-lucide-git-commit",{"title":45,"path":46,"stem":47,"icon":48},"Fail only on new duplication","\u002Fguides\u002Fbaseline","2.guides\u002F03.baseline","i-lucide-git-compare",{"title":50,"path":51,"stem":52,"icon":53},"Monorepos","\u002Fguides\u002Fmonorepos","2.guides\u002F04.monorepos","i-lucide-folder-tree",{"title":55,"path":56,"stem":57,"icon":58},"Cross-format detection","\u002Fguides\u002Fcross-format","2.guides\u002F05.cross-format","i-lucide-layers",{"title":60,"path":61,"stem":62,"icon":63},"Agents","\u002Fguides\u002Fagents","2.guides\u002F06.agents","i-lucide-cpu",{"title":65,"path":66,"stem":67,"icon":68},"Editors","\u002Fguides\u002Feditors","2.guides\u002F07.editors","i-lucide-code",{"title":70,"path":71,"stem":72,"icon":73},"Duplication over git history","\u002Fguides\u002Fhistory","2.guides\u002F08.history","i-lucide-chart-no-axes-combined",{"title":75,"path":76,"stem":77,"icon":78},"Dashboard and health score","\u002Fguides\u002Fdashboard","2.guides\u002F09.dashboard","i-lucide-layout-dashboard",{"title":80,"path":81,"stem":82,"icon":83},"Dead code","\u002Fguides\u002Fdead-code","2.guides\u002F10.dead-code","i-lucide-ghost",{"title":85,"path":86,"stem":87,"icon":88},"Comparing two codebases","\u002Fguides\u002Fcompare","2.guides\u002F11.compare","i-lucide-git-compare-arrows",{"title":90,"path":91,"stem":92,"icon":93},"Semantic clones","\u002Fguides\u002Fsemantic-clones","2.guides\u002F12.semantic-clones","i-lucide-brain-circuit",{"title":95,"path":96,"stem":97,"icon":98},"Similar functions","\u002Fguides\u002Fsimilarity","2.guides\u002F13.similarity","i-lucide-list-tree",{"title":100,"path":101,"stem":102,"icon":103},"Boundaries","\u002Fguides\u002Fboundaries","2.guides\u002F14.boundaries","i-lucide-fence",{"title":105,"icon":6,"path":106,"stem":107,"children":108,"page":6},"Concepts","\u002Fconcepts","3.concepts",[109,114,119],{"title":110,"path":111,"stem":112,"icon":113},"Types of code clones","\u002Fconcepts\u002Fclone-types","3.concepts\u002F1.clone-types","i-lucide-copy",{"title":115,"path":116,"stem":117,"icon":118},"How detection works","\u002Fconcepts\u002Fhow-detection-works","3.concepts\u002F2.how-detection-works","i-lucide-scan-search",{"title":120,"path":121,"stem":122,"icon":123},"The health score","\u002Fconcepts\u002Fhealth-score","3.concepts\u002F3.health-score","i-lucide-heart-pulse",{"title":125,"icon":6,"path":126,"stem":127,"children":128,"page":6},"Reference","\u002Freference","4.reference",[129,134,139,144,181,186,190],{"title":130,"path":131,"stem":132,"icon":133},"CLI options","\u002Freference\u002Fcli","4.reference\u002F1.cli","i-lucide-terminal",{"title":135,"path":136,"stem":137,"icon":138},"The config file","\u002Freference\u002Fconfig-file","4.reference\u002F2.config-file","i-lucide-settings",{"title":140,"path":141,"stem":142,"icon":143},"Exit codes","\u002Freference\u002Fexit-codes","4.reference\u002F3.exit-codes","i-lucide-log-out",{"title":145,"icon":6,"path":146,"stem":147,"children":148},"Reporters","\u002Freference\u002Freporters","4.reference\u002F4.reporters\u002Findex",[149,151,156,161,166,171,176],{"title":145,"path":146,"stem":147,"icon":150},"i-lucide-file-chart-column",{"title":152,"path":153,"stem":154,"icon":155},"HTML reporter","\u002Freference\u002Freporters\u002Fhtml","4.reference\u002F4.reporters\u002F2.html","i-lucide-file-code",{"title":157,"path":158,"stem":159,"icon":160},"JSON reporter","\u002Freference\u002Freporters\u002Fjson","4.reference\u002F4.reporters\u002F3.json","i-lucide-braces",{"title":162,"path":163,"stem":164,"icon":165},"Badge reporter","\u002Freference\u002Freporters\u002Fbadge","4.reference\u002F4.reporters\u002F4.badge","i-lucide-award",{"title":167,"path":168,"stem":169,"icon":170},"SARIF reporter","\u002Freference\u002Freporters\u002Fsarif","4.reference\u002F4.reporters\u002F5.sarif","i-lucide-shield-check",{"title":172,"path":173,"stem":174,"icon":175},"CodeClimate reporter","\u002Freference\u002Freporters\u002Fcodeclimate","4.reference\u002F4.reporters\u002F6.codeclimate","i-lucide-flag-triangle-right",{"title":177,"path":178,"stem":179,"icon":180},"OpenMetrics reporter","\u002Freference\u002Freporters\u002Fopenmetrics","4.reference\u002F4.reporters\u002F7.openmetrics","i-lucide-activity",{"title":182,"path":183,"stem":184,"icon":185},"Supported formats","\u002Freference\u002Fsupported-formats","4.reference\u002F5.supported-formats","i-lucide-languages",{"title":187,"path":188,"stem":189,"icon":38},"GitHub Action","\u002Freference\u002Fgithub-action","4.reference\u002F6.github-action",{"title":191,"path":192,"stem":193,"icon":68},"Rust crates","\u002Freference\u002Frust-crates","4.reference\u002F7.rust-crates",{"title":195,"icon":6,"path":196,"stem":197,"children":198,"page":6},"Project","\u002Fproject","5.project",[199,204,209,214,239,244],{"title":200,"path":201,"stem":202,"icon":203},"Changelog","\u002Fproject\u002Fchangelog","5.project\u002F1.changelog","i-lucide-scroll-text",{"title":205,"path":206,"stem":207,"icon":208},"Migrating from v4 to v5","\u002Fproject\u002Fmigration","5.project\u002F2.migration","i-lucide-arrow-right-left",{"title":210,"path":211,"stem":212,"icon":213},"jscpd v4 (TypeScript)","\u002Fproject\u002Fv4","5.project\u002F3.v4","i-simple-icons-typescript",{"title":215,"icon":6,"path":216,"stem":217,"children":218},"Benchmarks","\u002Fproject\u002Fbenchmarks","5.project\u002F4.benchmarks\u002Findex",[219,221,226,230,235],{"title":215,"path":216,"stem":217,"icon":220},"i-lucide-gauge",{"title":222,"path":223,"stem":224,"icon":225},"Detection Speed","\u002Fproject\u002Fbenchmarks\u002Fdetection-speed","5.project\u002F4.benchmarks\u002F2.detection-speed","i-lucide-zap",{"title":227,"path":228,"stem":229,"icon":58},"Multi-Format Detection","\u002Fproject\u002Fbenchmarks\u002Fcross-format","5.project\u002F4.benchmarks\u002F3.cross-format",{"title":231,"path":232,"stem":233,"icon":234},"AI Token Efficiency","\u002Fproject\u002Fbenchmarks\u002Fai-token-efficiency","5.project\u002F4.benchmarks\u002F4.ai-token-efficiency","i-lucide-sparkles",{"title":236,"path":237,"stem":238,"icon":93},"Embedding Models","\u002Fproject\u002Fbenchmarks\u002Fembedding-models","5.project\u002F4.benchmarks\u002F5.embedding-models",{"title":240,"path":241,"stem":242,"icon":243},"Research","\u002Fproject\u002Fresearch","5.project\u002F5.research","i-lucide-graduation-cap",{"title":245,"path":246,"stem":247,"icon":248},"Articles","\u002Fproject\u002Farticles","5.project\u002F6.articles","i-lucide-newspaper",{"name":250,"url":251,"appearances":252,"latest":268},"tailscale\u002Ftailcat","https:\u002F\u002Fgithub.com\u002Ftailscale\u002Ftailcat",[253],{"date":254,"rank":255,"stars":256,"starsToday":257,"headSha":258,"sources":259,"lines":260,"clones":261,"duplicatedLines":262,"percentage":263,"codePercentage":264,"codeSources":265,"healthScore":266,"healthGrade":267},"2026-11-14",7,9548,256,"e00cdde6ff787f801361ff85ed085775c775d4c5",100,24489,65,689,2.81,0.7,43,55,"C",{"date":254,"generatedAt":269,"name":250,"url":251,"description":270,"language":271,"stars":256,"starsToday":257,"defaultBranch":272,"headSha":258,"durationMs":273,"total":274,"formats":278,"topClones":320,"code":465,"health":589,"complexity":615,"deadCode":662},"2026-11-14T05:21:34.109Z","like netcat, but over Tailscale's data plane, without Tailscale's control plane","Go","main",835,{"sources":259,"lines":260,"tokens":275,"clones":261,"duplicatedLines":262,"duplicatedTokens":276,"percentage":263,"percentageTokens":277},162252,5026,3.1,[279,286,293,297,300,303,307,310,314,317],{"format":280,"sources":281,"lines":282,"clones":283,"duplicatedLines":284,"percentage":285},"go",77,21302,64,678,3.18,{"format":287,"sources":288,"lines":289,"clones":290,"duplicatedLines":291,"percentage":292},"yaml",6,423,1,11,2.6,{"format":294,"sources":255,"lines":295,"clones":296,"duplicatedLines":296,"percentage":296},"markdown",1545,0,{"format":298,"sources":290,"lines":299,"clones":296,"duplicatedLines":296,"percentage":296},"c-header",407,{"format":301,"sources":290,"lines":302,"clones":296,"duplicatedLines":296,"percentage":296},"javascript",344,{"format":304,"sources":305,"lines":306,"clones":296,"duplicatedLines":296,"percentage":296},"bash",3,188,{"format":308,"sources":290,"lines":309,"clones":296,"duplicatedLines":296,"percentage":296},"go-module",113,{"format":311,"sources":312,"lines":313,"clones":296,"duplicatedLines":296,"percentage":296},"c",2,66,{"format":315,"sources":290,"lines":316,"clones":296,"duplicatedLines":296,"percentage":296},"markup",63,{"format":318,"sources":290,"lines":319,"clones":296,"duplicatedLines":296,"percentage":296},"nix",38,[321,356,372,392,402,412,422,435,446,456],{"format":280,"lines":322,"tokens":323,"first":324,"others":328,"copies":288,"excerpt":345,"kind":355},8,53,{"name":325,"start":326,"end":327},"listen_test.go",19,26,[329,333,336,339,342],{"name":330,"start":331,"end":332},"tailcat_test.go",360,367,{"name":330,"start":334,"end":335},418,425,{"name":330,"start":337,"end":338},512,519,{"name":330,"start":340,"end":341},1022,1029,{"name":330,"start":343,"end":344},1121,1128,{"lines":346,"total":322},[347,348,349,350,351,352,353,354],"func TestListen(t *testing.T) {","    t.Parallel()","","    dm := integration.RunDERPAndSTUN(t, mkLogger(t, \"derpstun\"), \"127.0.0.1\")","    reg := dm.Regions[1]","    if reg == nil {","        t.Fatal(\"no region 1 in derpmap\")","    }","tests",{"format":280,"lines":357,"tokens":358,"first":359,"others":362,"copies":312,"excerpt":366,"kind":355},25,196,{"name":330,"start":360,"end":361},711,735,[363],{"name":330,"start":364,"end":365},857,881,{"lines":367,"total":357},[368,350,351,352,353,354,349,369,370,371],"func TestUDPForward(t *testing.T) {","    backend, err := net.ListenUDP(\"udp4\", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)})","    if err != nil {","        t.Fatal(err)",{"format":280,"lines":327,"tokens":373,"first":374,"others":378,"copies":312,"excerpt":382,"kind":355},182,{"name":375,"start":376,"end":377},"cmd\u002Ftailcat\u002Fsocks_test.go",226,251,[379],{"name":330,"start":380,"end":381},712,737,{"lines":383,"total":327},[384,385,386,387,388,349,389,390,391,388],"dm := integration.RunDERPAndSTUN(t, testLogger(t, \"derpstun\"), \"127.0.0.1\")","reg := dm.Regions[1]","if reg == nil {","    t.Fatal(\"no region 1 in derpmap\")","}","backend, err := net.ListenUDP(\"udp4\", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)})","if err != nil {","    t.Fatal(err)",{"format":280,"lines":357,"tokens":393,"first":394,"others":398,"copies":312,"kind":355},169,{"name":395,"start":396,"end":397},"cmd\u002Ftailcat\u002Fforward_test.go",62,86,[399],{"name":395,"start":400,"end":401},124,148,{"format":280,"lines":357,"tokens":403,"first":404,"others":408,"copies":312,"kind":355},156,{"name":405,"start":406,"end":407},"web\u002Fwasm_test.go",253,277,[409],{"name":405,"start":410,"end":411},485,509,{"format":280,"lines":413,"tokens":414,"first":415,"others":418,"copies":312,"kind":355},20,151,{"name":330,"start":416,"end":417},744,763,[419],{"name":330,"start":420,"end":421},896,915,{"format":280,"lines":423,"tokens":424,"first":425,"others":428,"copies":305,"kind":355},9,68,{"name":375,"start":426,"end":427},313,321,[429,432],{"name":375,"start":430,"end":431},333,341,{"name":375,"start":433,"end":434},353,361,{"format":280,"lines":326,"tokens":436,"first":437,"others":441,"copies":312,"kind":445},131,{"name":438,"start":439,"end":440},"tailcat.go",652,670,[442],{"name":438,"start":443,"end":444},2011,2029,"code",{"format":280,"lines":447,"tokens":448,"first":449,"others":452,"copies":312,"kind":355},17,128,{"name":330,"start":450,"end":451},806,822,[453],{"name":330,"start":454,"end":455},970,986,{"format":280,"lines":322,"tokens":396,"first":457,"others":460,"copies":305,"kind":355},{"name":330,"start":458,"end":459},649,656,[461,463],{"name":330,"start":462,"end":451},815,{"name":330,"start":464,"end":455},979,{"sources":265,"lines":466,"tokens":467,"clones":423,"duplicatedLines":468,"duplicatedTokens":469,"percentage":264,"percentageTokens":470,"formats":471,"topClones":480,"generated":587},13308,83736,93,726,0.87,[472,476,477,478],{"format":280,"sources":473,"lines":474,"clones":423,"duplicatedLines":468,"percentage":475},40,12516,0.74,{"format":298,"sources":290,"lines":299,"clones":296,"duplicatedLines":296,"percentage":296},{"format":301,"sources":290,"lines":302,"clones":296,"duplicatedLines":296,"percentage":296},{"format":304,"sources":290,"lines":479,"clones":296,"duplicatedLines":296,"percentage":296},41,[481,495,515,534,543,553,563,571,579],{"format":280,"lines":326,"tokens":436,"first":482,"others":483,"copies":312,"excerpt":485,"kind":445},{"name":438,"start":439,"end":440},[484],{"name":438,"start":443,"end":444},{"lines":486,"total":326},[487,488,489,490,349,491,492,493,390,494],"sys := &lb.sys","bus := eventbus.New()","sys.Set(bus)","sys.Set(health.NewTracker(bus))","netMon, err := netmon.New(bus, func(format string, args ...any) {","    logf(format, args...)","})","    lb.Close() \u002F\u002F closes the subsystems started so far",{"format":280,"lines":291,"tokens":496,"first":497,"others":500,"copies":312,"excerpt":504,"kind":445},90,{"name":498,"start":401,"end":499},"cmd\u002Flibtailcat\u002Fmain.go",158,[501],{"name":498,"start":502,"end":503},165,175,{"lines":505,"total":291},[506,507,508,509,510,511,512,513,514,510],"func 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 {","    return guard(err, func() error {","        if count == nil {","            return capi.ErrArgument","        }","        *count = 0","        b, err := buffer(ptr, size)","        if err != nil {","            return err",{"format":280,"lines":291,"tokens":516,"first":517,"others":520,"copies":312,"excerpt":524,"kind":445},88,{"name":438,"start":518,"end":519},2338,2348,[521],{"name":438,"start":522,"end":523},2366,2376,{"lines":525,"total":291},[526,527,528,354,529,530,531,532,533,354],"func (c *Client) DialTCP(ctx context.Context, ap netip.AddrPort) (net.Conn, error) {","    if err := c.up(ctx); err != nil {","        return nil, err","    if ap.Addr().Is4() {","        a := nat64PrefixBytes","        a4 := ap.Addr().As4()","        copy(a[12:], a4[:])","        ap = netip.AddrPortFrom(netip.AddrFrom16(a), ap.Port())",{"format":280,"lines":535,"tokens":397,"first":536,"others":539,"copies":312,"kind":445},10,{"name":438,"start":537,"end":538},750,759,[540],{"name":438,"start":541,"end":542},2073,2081,{"format":280,"lines":423,"tokens":544,"first":545,"others":549,"copies":312,"kind":445},75,{"name":546,"start":547,"end":548},"cmd\u002Ftailcat\u002Ftailcat.go",1979,1987,[550],{"name":546,"start":551,"end":552},2061,2070,{"format":280,"lines":554,"tokens":555,"first":556,"others":559,"copies":312,"kind":445},12,69,{"name":438,"start":557,"end":558},693,704,[560],{"name":438,"start":561,"end":562},2047,2058,{"format":280,"lines":423,"tokens":564,"first":565,"others":567,"copies":312,"kind":445},67,{"name":546,"start":566,"end":462},807,[568],{"name":546,"start":569,"end":570},1341,1349,{"format":280,"lines":288,"tokens":283,"first":572,"others":575,"copies":312,"kind":445},{"name":438,"start":573,"end":574},719,724,[576],{"name":438,"start":577,"end":578},736,741,{"format":280,"lines":288,"tokens":580,"first":581,"others":584,"copies":312,"kind":445},56,{"name":582,"start":583,"end":426},"internal\u002Fcapi\u002Fapi.go",308,[585],{"name":582,"start":427,"end":586},326,{"files":296,"minified":296,"sample":588},[],{"score":266,"grade":267,"size":590,"dimensions":594,"skipped":611},{"lines":591,"files":592,"class":593},22136,81,"M",[595,604],{"id":596,"source":597,"value":277,"adjusted":277,"lines":284,"halfLife":598,"formats":599,"excluded":600,"weight":290,"score":603},"duplication","jscpd",8.5,[280,298,301,311,304,318],[315,601,602],"text","data",77.7,{"id":605,"source":597,"value":606,"adjusted":607,"lines":608,"halfLife":609,"weight":290,"score":610},"complexity",72.4,68.2,16034,50,38.9,[612],{"id":613,"reason":614},"dead-code","the languages dead code reads are under 5% of the code",{"total":616,"mean":323,"files":617},4296,[618,622,626,630,635,638,643,647,652,657],{"path":546,"complexity":619,"lines":620,"bytes":621},481,2105,71630,{"path":438,"complexity":623,"lines":624,"bytes":625},402,2640,86171,{"path":330,"complexity":627,"lines":628,"bytes":629},374,1684,47011,{"path":631,"complexity":632,"lines":633,"bytes":634},"internal\u002Fperf\u002Fperf.go",278,1363,35957,{"path":582,"complexity":401,"lines":636,"bytes":637},594,15915,{"path":639,"complexity":640,"lines":641,"bytes":642},"cmd\u002Ftailcat\u002Fcli_test.go",141,658,21110,{"path":375,"complexity":644,"lines":645,"bytes":646},127,598,15966,{"path":648,"complexity":649,"lines":650,"bytes":651},"cmd\u002Ftailcat\u002Fperf.go",110,450,15098,{"path":653,"complexity":654,"lines":655,"bytes":656},"internal\u002Fperf\u002Fperf_test.go",109,377,11985,{"path":658,"complexity":659,"lines":660,"bytes":661},"tailcat_ssh_test.go",108,497,12884,{"percentage":296,"findings":296,"files":290,"byCategory":663,"largest":664},[],[],{"\u002Ftrending\u002Ftailscale\u002Ftailcat":666},{"views":296,"visits":296},1794633810176]