[{"data":1,"prerenderedAt":662},["ShallowReactive",2],{"navigation_docs":3,"-reference-reporters-badge":239,"-reference-reporters-badge-surround":657},[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":152,"body":241,"description":650,"extension":651,"links":652,"meta":653,"navigation":654,"path":153,"seo":655,"stem":154,"__hash__":656},"docs\u002F4.reference\u002F4.reporters\u002F4.badge.md",{"type":242,"value":243,"toc":642},"minimark",[244,252,259,264,299,307,319,325,405,409,478,481,533,537,562,565,569,597,601,615,619,638],[245,246,247,251],"p",{},[248,249,250],"code",{},"-r badge"," writes shields-style SVGs that show the numbers of the last run with no badge service in between: commit them or publish them from CI and link them from the README. The color of the duplication badge follows the percentage, so a README shows at a glance whether the project sits below 10%, below 20% or above.",[245,253,254],{},[255,256],"img",{"alt":257,"src":258},"jscpd badge","https:\u002F\u002Fraw.githubusercontent.com\u002Fkucherenko\u002Fjscpd\u002Fmaster\u002Fassets\u002Fjscpd-badge.svg",[260,261,263],"h2",{"id":262},"run-it","Run it",[265,266,272],"pre",{"className":267,"code":268,"filename":269,"language":270,"meta":271,"style":271},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd . -r badge --output report\n","Terminal","bash","",[248,273,274],{"__ignoreMap":271},[275,276,279,283,287,290,293,296],"span",{"class":277,"line":278},"line",1,[275,280,282],{"class":281},"sBMFI","jscpd",[275,284,286],{"class":285},"sfazB"," .",[275,288,289],{"class":285}," -r",[275,291,292],{"class":285}," badge",[275,294,295],{"class":285}," --output",[275,297,298],{"class":285}," report\n",[265,300,305],{"className":301,"code":303,"language":304,"meta":271},[302],"language-text","Badge saved to report\u002Fjscpd-badge.svg\n","text",[248,306,303],{"__ignoreMap":271},[265,308,310],{"className":267,"code":309,"filename":269,"language":270,"meta":271,"style":271},"ls report\n",[248,311,312],{"__ignoreMap":271},[275,313,314,317],{"class":277,"line":278},[275,315,316],{"class":281},"ls",[275,318,298],{"class":285},[265,320,323],{"className":321,"code":322,"language":304,"meta":271},[302],"jscpd-badge.svg\njscpd-lines-badge.svg\n",[248,324,322],{"__ignoreMap":271},[265,326,331],{"className":327,"code":328,"filename":329,"language":330,"meta":271,"style":271},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"reporters\": [\"console\", \"badge\"],\n  \"output\": \"report\"\n}\n",".jscpd.json","json",[248,332,333,339,379,399],{"__ignoreMap":271},[275,334,335],{"class":277,"line":278},[275,336,338],{"class":337},"sMK4o","{\n",[275,340,342,345,349,352,355,358,360,363,365,368,371,374,376],{"class":277,"line":341},2,[275,343,344],{"class":337},"  \"",[275,346,348],{"class":347},"spNyl","reporters",[275,350,351],{"class":337},"\"",[275,353,354],{"class":337},":",[275,356,357],{"class":337}," [",[275,359,351],{"class":337},[275,361,362],{"class":285},"console",[275,364,351],{"class":337},[275,366,367],{"class":337},",",[275,369,370],{"class":337}," \"",[275,372,373],{"class":285},"badge",[275,375,351],{"class":337},[275,377,378],{"class":337},"],\n",[275,380,382,384,387,389,391,393,396],{"class":277,"line":381},3,[275,383,344],{"class":337},[275,385,386],{"class":347},"output",[275,388,351],{"class":337},[275,390,354],{"class":337},[275,392,370],{"class":337},[275,394,395],{"class":285},"report",[275,397,398],{"class":337},"\"\n",[275,400,402],{"class":277,"line":401},4,[275,403,404],{"class":337},"}\n",[260,406,408],{"id":407},"the-output","The output",[410,411,412,431],"table",{},[413,414,415],"thead",{},[416,417,418,422,425,428],"tr",{},[419,420,421],"th",{},"File",[419,423,424],{},"Label",[419,426,427],{},"Value",[419,429,430],{},"Color",[432,433,434,457],"tbody",{},[416,435,436,442,447,454],{},[437,438,439],"td",{},[248,440,441],{},"jscpd-badge.svg",[437,443,444],{},[248,445,446],{},"duplication",[437,448,449,450,453],{},"the duplication of the run, ",[248,451,452],{},"17.7%"," here",[437,455,456],{},"green up to 10%, orange above 10%, red above 20%",[416,458,459,464,469,475],{},[437,460,461],{},[248,462,463],{},"jscpd-lines-badge.svg",[437,465,466],{},[248,467,468],{},"dup lines",[437,470,471,472,453],{},"the duplicated lines, ",[248,473,474],{},"34",[437,476,477],{},"blue",[245,479,480],{},"Each badge is a 20 px high SVG with the label on grey and the value on the color, in 11 px DejaVu Sans. The file below is the duplication badge of the sample run without its gradient and shadow text:",[265,482,487],{"className":483,"code":484,"filename":485,"language":486,"meta":271,"style":271},"language-xml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"132\" height=\"20\">\n  \u003Crect rx=\"3\" width=\"132\" height=\"20\" fill=\"#555\"\u002F>\n  \u003Crect rx=\"3\" x=\"87\" width=\"45\" height=\"20\" fill=\"#f39c12\"\u002F>\n  \u003Cg fill=\"#fff\" text-anchor=\"middle\" font-family=\"DejaVu Sans,sans-serif\" font-size=\"11\">\n    \u003Ctext x=\"43\" y=\"14\">duplication\u003C\u002Ftext>\n    \u003Ctext x=\"109\" y=\"14\">17.7%\u003C\u002Ftext>\n  \u003C\u002Fg>\n\u003C\u002Fsvg>\n","report\u002Fjscpd-badge.svg","xml",[248,488,489,494,499,504,509,515,521,527],{"__ignoreMap":271},[275,490,491],{"class":277,"line":278},[275,492,493],{},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"132\" height=\"20\">\n",[275,495,496],{"class":277,"line":341},[275,497,498],{},"  \u003Crect rx=\"3\" width=\"132\" height=\"20\" fill=\"#555\"\u002F>\n",[275,500,501],{"class":277,"line":381},[275,502,503],{},"  \u003Crect rx=\"3\" x=\"87\" width=\"45\" height=\"20\" fill=\"#f39c12\"\u002F>\n",[275,505,506],{"class":277,"line":401},[275,507,508],{},"  \u003Cg fill=\"#fff\" text-anchor=\"middle\" font-family=\"DejaVu Sans,sans-serif\" font-size=\"11\">\n",[275,510,512],{"class":277,"line":511},5,[275,513,514],{},"    \u003Ctext x=\"43\" y=\"14\">duplication\u003C\u002Ftext>\n",[275,516,518],{"class":277,"line":517},6,[275,519,520],{},"    \u003Ctext x=\"109\" y=\"14\">17.7%\u003C\u002Ftext>\n",[275,522,524],{"class":277,"line":523},7,[275,525,526],{},"  \u003C\u002Fg>\n",[275,528,530],{"class":277,"line":529},8,[275,531,532],{},"\u003C\u002Fsvg>\n",[260,534,536],{"id":535},"where-it-shows-up","Where it shows up",[265,538,543],{"className":539,"code":540,"filename":541,"language":542,"meta":271,"style":271},"language-markdown shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","![duplication](.\u002Freport\u002Fjscpd-badge.svg)\n","README.md","markdown",[248,544,545],{"__ignoreMap":271},[275,546,547,550,552,555,559],{"class":277,"line":278},[275,548,549],{"class":337},"![",[275,551,446],{"class":285},[275,553,554],{"class":337},"](",[275,556,558],{"class":557},"sQLHv",".\u002Freport\u002Fjscpd-badge.svg",[275,560,561],{"class":337},")\n",[245,563,564],{},"The image has to be reachable from the README: commit the file after a local run, or let the CI job that runs jscpd commit or publish it.",[260,566,568],{"id":567},"with-gates","With gates",[245,570,571,572,575,576,579,580,583,584,587,588,592,593,596],{},"The badges show numbers only. ",[248,573,574],{},"--threshold"," and a baseline do not change them; ",[248,577,578],{},"--kind"," does, because the statistics follow the clones that are reported. ",[248,581,582],{},"--health -r badge"," writes a third file, ",[248,585,586],{},"jscpd-health-badge.svg",", with the grade and score of the ",[589,590,591],"a",{"href":111},"health score"," (",[248,594,595],{},"health | B 73","): green for A and B, yellow for C, orange for D and red for E.",[260,598,600],{"id":599},"options","Options",[245,602,603,604,607,608,611,612,614],{},"The badge reporter reads ",[248,605,606],{},"-o","\u002F",[248,609,610],{},"--output"," only. ",[589,613,120],{"href":121}," lists it with the rest.",[260,616,618],{"id":617},"related","Related",[620,621,622,628],"ul",{},[623,624,625,627],"li",{},[589,626,135],{"href":136}," for the other formats.",[623,629,630,633,634,637],{},[589,631,632],{"href":76},"Dashboard"," for ",[248,635,636],{},"--dashboard",", which writes the health badge too.",[639,640,641],"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 .sQLHv, html code.shiki .sQLHv{--shiki-light:#90A4AE;--shiki-light-text-decoration:underline;--shiki-default:#EEFFFF;--shiki-default-text-decoration:underline;--shiki-dark:#BABED8;--shiki-dark-text-decoration:underline}",{"title":271,"searchDepth":341,"depth":341,"links":643},[644,645,646,647,648,649],{"id":262,"depth":341,"text":263},{"id":407,"depth":341,"text":408},{"id":535,"depth":341,"text":536},{"id":567,"depth":341,"text":568},{"id":599,"depth":341,"text":600},{"id":617,"depth":341,"text":618},"Two SVG badges with the duplication and the duplicated lines of a run, for a README.","md",null,{},{"icon":155},{"title":152,"description":650},"8zfbRd6dd-L0dwwG1wKmZHx50S2rgJl_R-5S8-yz1NU",[658,660],{"title":147,"path":148,"stem":149,"description":659,"icon":150,"children":-1},"Every clone with its locations, kind and source, plus the statistics per format, in one file for scripts and pipelines.",{"title":157,"path":158,"stem":159,"description":661,"icon":160,"children":-1},"A SARIF 2.1.0 log with one result per clone, its counterpart as a related location and a stable fingerprint, for GitHub code scanning and other SARIF consumers.",1791302987596]