[{"data":1,"prerenderedAt":812},["ShallowReactive",2],{"navigation_docs":3,"-reference-reporters-html":239,"-reference-reporters-html-surround":807},[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":142,"body":241,"description":800,"extension":801,"links":802,"meta":803,"navigation":804,"path":143,"seo":805,"stem":144,"__hash__":806},"docs\u002F4.reference\u002F4.reporters\u002F2.html.md",{"type":242,"value":243,"toc":791},"minimark",[244,264,269,304,312,392,396,402,462,471,475,482,533,536,602,660,664,674,678,692,696,712,735,751,768,772,787],[245,246,247,251,252,255,256,259,260,263],"p",{},[248,249,250],"code",{},"-r html"," writes a page you open in a browser or attach to a CI job: four summary cards, a table of the formats, and every clone with its source behind a \"Show code\" button. Pick it when a person reads the report; a script is better off with the ",[253,254,147],"a",{"href":148},", and a merge request widget with ",[253,257,258],{"href":158},"SARIF"," or the ",[253,261,262],{"href":163},"CodeClimate format",".",[265,266,268],"h2",{"id":267},"run-it","Run it",[270,271,277],"pre",{"className":272,"code":273,"filename":274,"language":275,"meta":276,"style":276},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd . -r html --output report\n","Terminal","bash","",[248,278,279],{"__ignoreMap":276},[280,281,284,288,292,295,298,301],"span",{"class":282,"line":283},"line",1,[280,285,287],{"class":286},"sBMFI","jscpd",[280,289,291],{"class":290},"sfazB"," .",[280,293,294],{"class":290}," -r",[280,296,297],{"class":290}," html",[280,299,300],{"class":290}," --output",[280,302,303],{"class":290}," report\n",[270,305,310],{"className":306,"code":308,"language":309,"meta":276},[307],"language-text","HTML report saved to report\u002Fjscpd-report.html\n","text",[248,311,308],{"__ignoreMap":276},[270,313,318],{"className":314,"code":315,"filename":316,"language":317,"meta":276,"style":276},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"reporters\": [\"console\", \"html\"],\n  \"output\": \"report\"\n}\n",".jscpd.json","json",[248,319,320,326,366,386],{"__ignoreMap":276},[280,321,322],{"class":282,"line":283},[280,323,325],{"class":324},"sMK4o","{\n",[280,327,329,332,336,339,342,345,347,350,352,355,358,361,363],{"class":282,"line":328},2,[280,330,331],{"class":324},"  \"",[280,333,335],{"class":334},"spNyl","reporters",[280,337,338],{"class":324},"\"",[280,340,341],{"class":324},":",[280,343,344],{"class":324}," [",[280,346,338],{"class":324},[280,348,349],{"class":290},"console",[280,351,338],{"class":324},[280,353,354],{"class":324},",",[280,356,357],{"class":324}," \"",[280,359,360],{"class":290},"html",[280,362,338],{"class":324},[280,364,365],{"class":324},"],\n",[280,367,369,371,374,376,378,380,383],{"class":282,"line":368},3,[280,370,331],{"class":324},[280,372,373],{"class":334},"output",[280,375,338],{"class":324},[280,377,341],{"class":324},[280,379,357],{"class":324},[280,381,382],{"class":290},"report",[280,384,385],{"class":324},"\"\n",[280,387,389],{"class":282,"line":388},4,[280,390,391],{"class":324},"}\n",[265,393,395],{"id":394},"the-output","The output",[245,397,398,401],{},[248,399,400],{},"jscpd-report.html"," is one file with its styles inline; the only external resource is the npm downloads badge in the footer. From top to bottom:",[403,404,405,418],"table",{},[406,407,408],"thead",{},[409,410,411,415],"tr",{},[412,413,414],"th",{},"Section",[412,416,417],{},"What it holds",[419,420,421,430,438,454],"tbody",{},[409,422,423,427],{},[424,425,426],"td",{},"Dashboard",[424,428,429],{},"Total files, total lines of code, number of clones, and duplicated lines with the duplication in percent",[409,431,432,435],{},[424,433,434],{},"Formats with duplications",[424,436,437],{},"One row per format with files, lines, clones, duplicated lines and duplicated tokens, each count with its percentage, plus a total row; a format name links to its clones",[409,439,440,443],{},[424,441,442],{},"One section per format",[424,444,445,446,449,450,453],{},"Every clone as two locations, ",[248,447,448],{},"src\u002Finvoice.js (Line 1:1 - Line 12:2)"," and ",[248,451,452],{},"src\u002Fprint\u002Finvoice.js (Line 1:1 - Line 13:2)",", with a \"Show code\" button that reveals the first fragment",[409,455,456,459],{},[424,457,458],{},"Footer",[424,460,461],{},"The jscpd version that wrote the page",[245,463,464,465,449,468,470],{},"The page has no filter or sort controls, and it does not mark the kind of a clone or whether it is new against a baseline; the ",[253,466,467],{"href":148},"JSON",[253,469,258],{"href":158}," reports carry that.",[265,472,474],{"id":473},"where-it-shows-up","Where it shows up",[245,476,477,478,481],{},"Upload the file as an artifact so a failing job still leaves it behind. With the GitHub Action, ",[248,479,480],{},"upload-report: true"," uploads the whole output directory:",[270,483,488],{"className":484,"code":485,"filename":486,"language":487,"meta":276,"style":276},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","- uses: kucherenko\u002Fjscpd@v5\n  with:\n    reporters: console,html\n    upload-report: true\n",".github\u002Fworkflows\u002Fjscpd.yml","yaml",[248,489,490,504,512,522],{"__ignoreMap":276},[280,491,492,495,499,501],{"class":282,"line":283},[280,493,494],{"class":324},"-",[280,496,498],{"class":497},"swJcz"," uses",[280,500,341],{"class":324},[280,502,503],{"class":290}," kucherenko\u002Fjscpd@v5\n",[280,505,506,509],{"class":282,"line":328},[280,507,508],{"class":497},"  with",[280,510,511],{"class":324},":\n",[280,513,514,517,519],{"class":282,"line":368},[280,515,516],{"class":497},"    reporters",[280,518,341],{"class":324},[280,520,521],{"class":290}," console,html\n",[280,523,524,527,529],{"class":282,"line":388},[280,525,526],{"class":497},"    upload-report",[280,528,341],{"class":324},[280,530,532],{"class":531},"sfNiH"," true\n",[245,534,535],{},"With the binary in any workflow:",[270,537,539],{"className":484,"code":538,"filename":486,"language":487,"meta":276,"style":276},"- run: jscpd . -r console,html --output report\n- uses: actions\u002Fupload-artifact@v4\n  if: always()\n  with:\n    name: jscpd-report\n    path: report\u002Fjscpd-report.html\n",[248,540,541,553,564,574,580,591],{"__ignoreMap":276},[280,542,543,545,548,550],{"class":282,"line":283},[280,544,494],{"class":324},[280,546,547],{"class":497}," run",[280,549,341],{"class":324},[280,551,552],{"class":290}," jscpd . -r console,html --output report\n",[280,554,555,557,559,561],{"class":282,"line":328},[280,556,494],{"class":324},[280,558,498],{"class":497},[280,560,341],{"class":324},[280,562,563],{"class":290}," actions\u002Fupload-artifact@v4\n",[280,565,566,569,571],{"class":282,"line":368},[280,567,568],{"class":497},"  if",[280,570,341],{"class":324},[280,572,573],{"class":290}," always()\n",[280,575,576,578],{"class":282,"line":388},[280,577,508],{"class":497},[280,579,511],{"class":324},[280,581,583,586,588],{"class":282,"line":582},5,[280,584,585],{"class":497},"    name",[280,587,341],{"class":324},[280,589,590],{"class":290}," jscpd-report\n",[280,592,594,597,599],{"class":282,"line":593},6,[280,595,596],{"class":497},"    path",[280,598,341],{"class":324},[280,600,601],{"class":290}," report\u002Fjscpd-report.html\n",[270,603,606],{"className":484,"code":604,"filename":605,"language":487,"meta":276,"style":276},"jscpd:\n  script:\n    - jscpd . -r console,html --output report\n  artifacts:\n    when: always\n    paths:\n      - report\u002Fjscpd-report.html\n",".gitlab-ci.yml",[248,607,608,614,621,628,635,645,652],{"__ignoreMap":276},[280,609,610,612],{"class":282,"line":283},[280,611,287],{"class":497},[280,613,511],{"class":324},[280,615,616,619],{"class":282,"line":328},[280,617,618],{"class":497},"  script",[280,620,511],{"class":324},[280,622,623,626],{"class":282,"line":368},[280,624,625],{"class":324},"    -",[280,627,552],{"class":290},[280,629,630,633],{"class":282,"line":388},[280,631,632],{"class":497},"  artifacts",[280,634,511],{"class":324},[280,636,637,640,642],{"class":282,"line":582},[280,638,639],{"class":497},"    when",[280,641,341],{"class":324},[280,643,644],{"class":290}," always\n",[280,646,647,650],{"class":282,"line":593},[280,648,649],{"class":497},"    paths",[280,651,511],{"class":324},[280,653,655,658],{"class":282,"line":654},7,[280,656,657],{"class":324},"      -",[280,659,601],{"class":290},[265,661,663],{"id":662},"with-gates","With gates",[245,665,666,669,670,673],{},[248,667,668],{},"--threshold"," changes nothing in the page: jscpd writes the file, then checks the duplication and sets the exit code. ",[248,671,672],{},"--kind"," narrows the clone list to the kinds you name, and the statistics follow it. A baseline leaves the page as it is.",[265,675,677],{"id":676},"options","Options",[245,679,680,681,684,685,688,689,691],{},"The HTML reporter reads ",[248,682,683],{},"-o","\u002F",[248,686,687],{},"--output"," only. ",[253,690,120],{"href":121}," lists it with the rest.",[265,693,695],{"id":694},"other-modes","Other modes",[245,697,698,699,704,705,707,708,711],{},"With ",[253,700,701],{"href":86},[248,702,703],{},"--compare",", ",[248,706,250],{}," writes ",[248,709,710],{},"jscpd-compare.html"," instead: a migration map that draws two folders as dependency graphs facing each other, with a bridge for every pair of functions that do the same job, and a table of the same pairs on a second tab. Like the clone report, it is one file.",[270,713,715],{"className":272,"code":714,"filename":274,"language":275,"meta":276,"style":276},"jscpd --compare python\u002F typescript\u002F -r html\n",[248,716,717],{"__ignoreMap":276},[280,718,719,721,724,727,730,732],{"class":282,"line":283},[280,720,287],{"class":286},[280,722,723],{"class":290}," --compare",[280,725,726],{"class":290}," python\u002F",[280,728,729],{"class":290}," typescript\u002F",[280,731,294],{"class":290},[280,733,734],{"class":290}," html\n",[245,736,737,738,449,743,747,748,750],{},"Two live examples: ",[253,739,742],{"href":740,"target":741},"\u002Fexamples\u002Fcompare-demo.html","_blank","a Python module halfway through its port to TypeScript",[253,744,746],{"href":745,"target":741},"\u002Fexamples\u002Fcompare-tauri.html","ten Tauri plugins compared across Android and iOS",". ",[253,749,85],{"href":86}," explains how to read the map.",[245,752,753,707,758,449,761,707,764,767],{},[253,754,755],{"href":76},[248,756,757],{},"--dashboard",[248,759,760],{},"jscpd-dashboard.html",[248,762,763],{},"--health",[248,765,766],{},"jscpd-health.html"," under the same reporter name.",[265,769,771],{"id":770},"related","Related",[773,774,775,781],"ul",{},[776,777,778,780],"li",{},[253,779,135],{"href":136}," for the whole list and the files each one writes.",[776,782,783,786],{},[253,784,785],{"href":36},"CI"," for complete workflows.",[788,789,790],"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);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":276,"searchDepth":328,"depth":328,"links":792},[793,794,795,796,797,798,799],{"id":267,"depth":328,"text":268},{"id":394,"depth":328,"text":395},{"id":473,"depth":328,"text":474},{"id":662,"depth":328,"text":663},{"id":676,"depth":328,"text":677},{"id":694,"depth":328,"text":695},{"id":770,"depth":328,"text":771},"One self-contained page with the statistics per format and the code of every clone, for reading a report in a browser.","md",null,{},{"icon":145},{"title":142,"description":800},"A_tSaGfvQy-MBqDraueQEfW85kdORzf_wjV89uEw5C0",[808,810],{"title":135,"path":136,"stem":137,"description":809,"icon":140,"children":-1},"The 15 reporters of jscpd, what each one writes, and which to pick for a terminal, a script, a merge request widget or a README.",{"title":147,"path":148,"stem":149,"description":811,"icon":150,"children":-1},"Every clone with its locations, kind and source, plus the statistics per format, in one file for scripts and pipelines.",1791302987299]