[{"data":1,"prerenderedAt":550},["ShallowReactive",2],{"navigation_docs":3,"-start":239,"-start-surround":547},[4,29,94,114,184],{"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],{"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,"icon":6,"path":96,"stem":97,"children":98,"page":6},"Concepts","\u002Fconcepts","3.concepts",[99,104,109],{"title":100,"path":101,"stem":102,"icon":103},"Types of code clones","\u002Fconcepts\u002Fclone-types","3.concepts\u002F1.clone-types","i-lucide-copy",{"title":105,"path":106,"stem":107,"icon":108},"How detection works","\u002Fconcepts\u002Fhow-detection-works","3.concepts\u002F2.how-detection-works","i-lucide-scan-search",{"title":110,"path":111,"stem":112,"icon":113},"The health score","\u002Fconcepts\u002Fhealth-score","3.concepts\u002F3.health-score","i-lucide-heart-pulse",{"title":115,"icon":6,"path":116,"stem":117,"children":118,"page":6},"Reference","\u002Freference","4.reference",[119,124,129,134,171,176,180],{"title":120,"path":121,"stem":122,"icon":123},"CLI options","\u002Freference\u002Fcli","4.reference\u002F1.cli","i-lucide-terminal",{"title":125,"path":126,"stem":127,"icon":128},"The config file","\u002Freference\u002Fconfig-file","4.reference\u002F2.config-file","i-lucide-settings",{"title":130,"path":131,"stem":132,"icon":133},"Exit codes","\u002Freference\u002Fexit-codes","4.reference\u002F3.exit-codes","i-lucide-log-out",{"title":135,"icon":6,"path":136,"stem":137,"children":138},"Reporters","\u002Freference\u002Freporters","4.reference\u002F4.reporters\u002Findex",[139,141,146,151,156,161,166],{"title":135,"path":136,"stem":137,"icon":140},"i-lucide-file-chart-column",{"title":142,"path":143,"stem":144,"icon":145},"HTML reporter","\u002Freference\u002Freporters\u002Fhtml","4.reference\u002F4.reporters\u002F2.html","i-lucide-file-code",{"title":147,"path":148,"stem":149,"icon":150},"JSON reporter","\u002Freference\u002Freporters\u002Fjson","4.reference\u002F4.reporters\u002F3.json","i-lucide-braces",{"title":152,"path":153,"stem":154,"icon":155},"Badge reporter","\u002Freference\u002Freporters\u002Fbadge","4.reference\u002F4.reporters\u002F4.badge","i-lucide-award",{"title":157,"path":158,"stem":159,"icon":160},"SARIF reporter","\u002Freference\u002Freporters\u002Fsarif","4.reference\u002F4.reporters\u002F5.sarif","i-lucide-shield-check",{"title":162,"path":163,"stem":164,"icon":165},"CodeClimate reporter","\u002Freference\u002Freporters\u002Fcodeclimate","4.reference\u002F4.reporters\u002F6.codeclimate","i-lucide-flag-triangle-right",{"title":167,"path":168,"stem":169,"icon":170},"OpenMetrics reporter","\u002Freference\u002Freporters\u002Fopenmetrics","4.reference\u002F4.reporters\u002F7.openmetrics","i-lucide-activity",{"title":172,"path":173,"stem":174,"icon":175},"Supported formats","\u002Freference\u002Fsupported-formats","4.reference\u002F5.supported-formats","i-lucide-languages",{"title":177,"path":178,"stem":179,"icon":38},"GitHub Action","\u002Freference\u002Fgithub-action","4.reference\u002F6.github-action",{"title":181,"path":182,"stem":183,"icon":68},"Rust crates","\u002Freference\u002Frust-crates","4.reference\u002F7.rust-crates",{"title":185,"icon":6,"path":186,"stem":187,"children":188,"page":6},"Project","\u002Fproject","5.project",[189,194,199,204,229,234],{"title":190,"path":191,"stem":192,"icon":193},"Changelog","\u002Fproject\u002Fchangelog","5.project\u002F1.changelog","i-lucide-scroll-text",{"title":195,"path":196,"stem":197,"icon":198},"Migrating from v4 to v5","\u002Fproject\u002Fmigration","5.project\u002F2.migration","i-lucide-arrow-right-left",{"title":200,"path":201,"stem":202,"icon":203},"jscpd v4 (TypeScript)","\u002Fproject\u002Fv4","5.project\u002F3.v4","i-simple-icons-typescript",{"title":205,"icon":6,"path":206,"stem":207,"children":208},"Benchmarks","\u002Fproject\u002Fbenchmarks","5.project\u002F4.benchmarks\u002Findex",[209,211,216,220,225],{"title":205,"path":206,"stem":207,"icon":210},"i-lucide-gauge",{"title":212,"path":213,"stem":214,"icon":215},"Detection Speed","\u002Fproject\u002Fbenchmarks\u002Fdetection-speed","5.project\u002F4.benchmarks\u002F2.detection-speed","i-lucide-zap",{"title":217,"path":218,"stem":219,"icon":58},"Multi-Format Detection","\u002Fproject\u002Fbenchmarks\u002Fcross-format","5.project\u002F4.benchmarks\u002F3.cross-format",{"title":221,"path":222,"stem":223,"icon":224},"AI Token Efficiency","\u002Fproject\u002Fbenchmarks\u002Fai-token-efficiency","5.project\u002F4.benchmarks\u002F4.ai-token-efficiency","i-lucide-sparkles",{"title":226,"path":227,"stem":228,"icon":93},"Embedding Models","\u002Fproject\u002Fbenchmarks\u002Fembedding-models","5.project\u002F4.benchmarks\u002F5.embedding-models",{"title":230,"path":231,"stem":232,"icon":233},"Research","\u002Fproject\u002Fresearch","5.project\u002F5.research","i-lucide-graduation-cap",{"title":235,"path":236,"stem":237,"icon":238},"Articles","\u002Fproject\u002Farticles","5.project\u002F6.articles","i-lucide-newspaper",{"id":240,"title":11,"body":241,"description":539,"extension":540,"links":541,"meta":542,"navigation":543,"path":7,"seo":544,"stem":12,"__hash__":546},"docs\u002F1.start\u002Findex.md",{"type":242,"value":243,"toc":531},"minimark",[244,248,253,276,299,307,310,359,374,378,412,417,421,424,428,482,486,527],[245,246,247],"p",{},"jscpd finds duplicated code in a repository and reports it in the terminal, in CI, in an editor or to a coding agent. It is for teams that want a duplication number to gate a build on, and the copies behind it.",[249,250,252],"h2",{"id":251},"what-a-default-run-reports","What a default run reports",[245,254,255,256,260,261,264,265,268,269,272,273,275],{},"Without options, jscpd reports exact copies: every block of at least 50 tokens and 5 lines that appears more than once (",[257,258,259],"code",{},"--min-tokens",", ",[257,262,263],{},"--min-lines","). It reads 224 formats and tokenizes each with that language's own comment and string rules, JavaScript and TypeScript through the oxc parser, so a clone is a repeated run of language tokens. A rolling Rabin-Karp hash over those tokens finds the repeats. Inside a git repository, files that ",[257,266,267],{},".gitignore"," lists are skipped. ",[270,271,105],"a",{"href":106}," follows a file through the pipeline; ",[270,274,172],{"href":173}," lists the formats.",[277,278,284],"pre",{"className":279,"code":280,"filename":281,"language":282,"meta":283,"style":283},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd .\n","Terminal","bash","",[257,285,286],{"__ignoreMap":283},[287,288,291,295],"span",{"class":289,"line":290},"line",1,[287,292,294],{"class":293},"sBMFI","jscpd",[287,296,298],{"class":297},"sfazB"," .\n",[277,300,305],{"className":301,"code":303,"language":304,"meta":283},[302],"language-text","Clone found (javascript)\n - generated\u002Fcheckout.js [2:1 - 25:2] (24 lines, 179 tokens)\n   src\u002Fcheckout.js [1:1 - 24:2]\nClone found (javascript)\n - generated\u002Fcheckout.js [2:1 - 25:2] (24 lines, 179 tokens)\n   vendor\u002Fcheckout.js [2:1 - 25:2]\nFound 2 clones.\n","text",[257,306,303],{"__ignoreMap":283},[245,308,309],{},"After the clones, the terminal prints one row per format and a total; for this run it is one row:",[311,312,313,336],"table",{},[314,315,316],"thead",{},[317,318,319,323,327,330,333],"tr",{},[320,321,322],"th",{},"Format",[320,324,326],{"align":325},"right","Files analyzed",[320,328,329],{"align":325},"Lines",[320,331,332],{"align":325},"Clones",[320,334,335],{"align":325},"Duplicated lines",[337,338,339],"tbody",{},[317,340,341,347,350,353,356],{},[342,343,344],"td",{},[257,345,346],{},"javascript",[342,348,349],{"align":325},"3",[342,351,352],{"align":325},"74",[342,354,355],{"align":325},"2",[342,357,358],{"align":325},"48 (64.86 %)",[245,360,361,362,365,366,369,370,373],{},"The run is ",[257,363,364],{},"fixtures\u002Fignore-demo\u002Fglob"," from the jscpd repository: one file copied into ",[257,367,368],{},"vendor\u002F"," and ",[257,371,372],{},"generated\u002F",". Each clone names both places with line and column; the percentage is the duplication of the scan.",[249,375,377],{"id":376},"what-it-finds-when-you-ask","What it finds when you ask",[379,380,381,395,405],"ul",{},[382,383,384,385,260,388,369,391,394],"li",{},"Renamed copies, the same code under other variable, function or literal names: ",[257,386,387],{},"--ignore-identifiers",[257,389,390],{},"--ignore-literals",[257,392,393],{},"--ignore-annotations",".",[382,396,397,398,401,402,394],{},"Near-miss copies with a few inserted or edited lines: ",[257,399,400],{},"--max-gap-lines","; and JavaScript or TypeScript functions with the same structure: ",[257,403,404],{},"--similarity",[382,406,407,408,411],{},"Semantic clones, functions that do the same job with different code, in one language or across languages: ",[257,409,410],{},"--semantic",", experimental, with a code embedding model.",[245,413,414,416],{},[270,415,100],{"href":101}," says where the lines between these sit and which flag turns each on.",[249,418,420],{"id":419},"what-it-does-not-do","What it does not do",[245,422,423],{},"jscpd does not rewrite code: it reports, and the refactoring is yours or your agent's. A scan reads the paths you pass and makes no network call; there is no hosted service and no index of other repositories to compare against. The semantic mode is the exception: it downloads a 548 MB model once, or talks to an embeddings API you name. A default run reports exact clones only; the other kinds need their flags.",[249,425,427],{"id":426},"other-questions-jscpd-answers","Other questions jscpd answers",[245,429,430,369,433,436,437,260,440,443,444,447,448,443,451,454,455,458,459,462,463,443,466,469,470,473,474,477,478,481],{},[257,431,432],{},"--dashboard",[257,434,435],{},"--health"," put duplication, dead code and complexity on one screen with a score (",[270,438,439],{"href":76},"dashboard",[270,441,442],{"href":111},"health score","). ",[257,445,446],{},"--dead-code"," finds unused files, exports, symbols and imports in JavaScript, TypeScript and Python (",[270,449,450],{"href":81},"dead code",[257,452,453],{},"--history"," plots duplication over git history (",[270,456,457],{"href":71},"history","), and ",[257,460,461],{},"--compare"," measures a port or two implementations of one app (",[270,464,465],{"href":86},"compare",[257,467,468],{},"--mcp"," serves the detector to coding agents (",[270,471,472],{"href":61},"agents",") and ",[257,475,476],{},"--lsp"," to editors (",[270,479,480],{"href":66},"editors",").",[249,483,485],{"id":484},"where-to-go-next","Where to go next",[311,487,488,498],{},[314,489,490],{},[317,491,492,495],{},[320,493,494],{},"You want to",[320,496,497],{},"Read",[337,499,500,509,518],{},[317,501,502,505],{},[342,503,504],{},"Install jscpd with your package manager or a one-line installer",[342,506,507],{},[270,508,15],{"href":16},[317,510,511,514],{},[342,512,513],{},"Scan your repository and read the report, in about ten minutes",[342,515,516],{},[270,517,20],{"href":21},[317,519,520,523],{},[342,521,522],{},"Fail a pull request when duplication grows",[342,524,525],{},[270,526,35],{"href":36},[528,529,530],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":283,"searchDepth":532,"depth":532,"links":533},2,[534,535,536,537,538],{"id":251,"depth":532,"text":252},{"id":376,"depth":532,"text":377},{"id":419,"depth":532,"text":420},{"id":426,"depth":532,"text":427},{"id":484,"depth":532,"text":485},"What a default run reports, what jscpd finds when you ask for it, what it leaves alone, and where to go first.","md",null,{},{"icon":13},{"title":11,"description":545},"jscpd finds duplicated code in 224 formats, from exact copies to renamed, near-miss and semantic clones, and reports it in the terminal, in CI, in editors and to coding agents.","ViADnKuQO-kjjUzW1ih7Hat0PluzRxkVXW4UNYEQOY0",[541,548],{"title":15,"path":16,"stem":17,"description":549,"icon":18,"children":-1},"Every channel installs the same binary; pick the one your project already uses, then check the version.",1791302979621]