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