[{"data":1,"prerenderedAt":731},["ShallowReactive",2],{"navigation_docs":3,"-start-configuration":239,"-start-configuration-surround":726},[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":25,"body":241,"description":719,"extension":720,"links":721,"meta":722,"navigation":723,"path":26,"seo":724,"stem":27,"__hash__":725},"docs\u002F1.start\u002F4.configuration.md",{"type":242,"value":243,"toc":713},"minimark",[244,253,258,261,291,302,306,313,533,636,647,651,667,677,681,709],[245,246,247,248,252],"p",{},"Most projects need five or six settings, and they belong in a file next to the code so that every run, local or in CI, uses the same ones. This page is that file; the ",[249,250,251],"a",{"href":126},"config file reference"," has every key and the details of how files and flags combine.",[254,255,257],"h2",{"id":256},"where-the-file-lives","Where the file lives",[245,259,260],{},"jscpd looks in the current working directory, in this order, and takes the first match:",[262,263,264,271,281],"ol",{},[265,266,267],"li",{},[268,269,270],"code",{},".jscpd.json",[265,272,273,276,277,280],{},[268,274,275],{},".config\u002Fjscpd.json"," or ",[268,278,279],{},".config\u002F.jscpd.json"," (5.1.0+)",[265,282,283,284,287,288],{},"the ",[268,285,286],{},"jscpd"," key of ",[268,289,290],{},"package.json",[245,292,293,294,297,298,301],{},"It does not look inside the paths it scans, so ",[268,295,296],{},"jscpd packages\u002Fapi"," from the repository root reads the root's file. ",[268,299,300],{},"-c path\u002Fto\u002Ffile.json"," names a file explicitly, from anywhere, and a flag on the command line wins over any file.",[254,303,305],{"id":304},"the-keys-to-set-first","The keys to set first",[245,307,308,309,312],{},"Keys are the ",[249,310,311],{"href":121},"CLI flags"," in camelCase. A flag given on the command line overrides the same key in the file.",[314,315,320],"pre",{"className":316,"code":317,"filename":270,"language":318,"meta":319,"style":319},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"threshold\": 3,\n  \"ignore\": [\"**\u002Fnode_modules\u002F**\", \"**\u002Fdist\u002F**\", \"**\u002F*.min.js\"],\n  \"format\": [\"javascript\", \"typescript\", \"python\"],\n  \"minTokens\": 50,\n  \"minLines\": 5,\n  \"reporters\": [\"console\", \"html\"],\n  \"output\": \"report\"\n}\n","json","",[268,321,322,331,354,400,441,458,475,507,527],{"__ignoreMap":319},[323,324,327],"span",{"class":325,"line":326},"line",1,[323,328,330],{"class":329},"sMK4o","{\n",[323,332,334,337,341,344,347,351],{"class":325,"line":333},2,[323,335,336],{"class":329},"  \"",[323,338,340],{"class":339},"spNyl","threshold",[323,342,343],{"class":329},"\"",[323,345,346],{"class":329},":",[323,348,350],{"class":349},"sbssI"," 3",[323,352,353],{"class":329},",\n",[323,355,357,359,362,364,366,369,371,375,377,380,383,386,388,390,392,395,397],{"class":325,"line":356},3,[323,358,336],{"class":329},[323,360,361],{"class":339},"ignore",[323,363,343],{"class":329},[323,365,346],{"class":329},[323,367,368],{"class":329}," [",[323,370,343],{"class":329},[323,372,374],{"class":373},"sfazB","**\u002Fnode_modules\u002F**",[323,376,343],{"class":329},[323,378,379],{"class":329},",",[323,381,382],{"class":329}," \"",[323,384,385],{"class":373},"**\u002Fdist\u002F**",[323,387,343],{"class":329},[323,389,379],{"class":329},[323,391,382],{"class":329},[323,393,394],{"class":373},"**\u002F*.min.js",[323,396,343],{"class":329},[323,398,399],{"class":329},"],\n",[323,401,403,405,408,410,412,414,416,419,421,423,425,428,430,432,434,437,439],{"class":325,"line":402},4,[323,404,336],{"class":329},[323,406,407],{"class":339},"format",[323,409,343],{"class":329},[323,411,346],{"class":329},[323,413,368],{"class":329},[323,415,343],{"class":329},[323,417,418],{"class":373},"javascript",[323,420,343],{"class":329},[323,422,379],{"class":329},[323,424,382],{"class":329},[323,426,427],{"class":373},"typescript",[323,429,343],{"class":329},[323,431,379],{"class":329},[323,433,382],{"class":329},[323,435,436],{"class":373},"python",[323,438,343],{"class":329},[323,440,399],{"class":329},[323,442,444,446,449,451,453,456],{"class":325,"line":443},5,[323,445,336],{"class":329},[323,447,448],{"class":339},"minTokens",[323,450,343],{"class":329},[323,452,346],{"class":329},[323,454,455],{"class":349}," 50",[323,457,353],{"class":329},[323,459,461,463,466,468,470,473],{"class":325,"line":460},6,[323,462,336],{"class":329},[323,464,465],{"class":339},"minLines",[323,467,343],{"class":329},[323,469,346],{"class":329},[323,471,472],{"class":349}," 5",[323,474,353],{"class":329},[323,476,478,480,483,485,487,489,491,494,496,498,500,503,505],{"class":325,"line":477},7,[323,479,336],{"class":329},[323,481,482],{"class":339},"reporters",[323,484,343],{"class":329},[323,486,346],{"class":329},[323,488,368],{"class":329},[323,490,343],{"class":329},[323,492,493],{"class":373},"console",[323,495,343],{"class":329},[323,497,379],{"class":329},[323,499,382],{"class":329},[323,501,502],{"class":373},"html",[323,504,343],{"class":329},[323,506,399],{"class":329},[323,508,510,512,515,517,519,521,524],{"class":325,"line":509},8,[323,511,336],{"class":329},[323,513,514],{"class":339},"output",[323,516,343],{"class":329},[323,518,346],{"class":329},[323,520,382],{"class":329},[323,522,523],{"class":373},"report",[323,525,526],{"class":329},"\"\n",[323,528,530],{"class":325,"line":529},9,[323,531,532],{"class":329},"}\n",[534,535,536,552],"table",{},[537,538,539],"thead",{},[540,541,542,546,549],"tr",{},[543,544,545],"th",{},"Key",[543,547,548],{},"What it decides",[543,550,551],{},"Start with",[553,554,555,568,580,595,610],"tbody",{},[540,556,557,562,565],{},[558,559,560],"td",{},[268,561,340],{},[558,563,564],{},"The duplication percentage above which the run exits 1",[558,566,567],{},"A little above today's value, then lower it",[540,569,570,574,577],{},[558,571,572],{},[268,573,361],{},[558,575,576],{},"Globs for files that never count: generated code, vendored code, fixtures",[558,578,579],{},"Whatever your linter ignores",[540,581,582,586,592],{},[558,583,584],{},[268,585,407],{},[558,587,588,589],{},"The formats to scan, by name from ",[268,590,591],{},"jscpd --list",[558,593,594],{},"Your programming languages; leave out json, yaml, markdown unless you mean them",[540,596,597,604,607],{},[558,598,599,601,602],{},[268,600,448],{},", ",[268,603,465],{},[558,605,606],{},"How small a clone can be",[558,608,609],{},"The defaults, 50 and 5; raise them if the report is noisy",[540,611,612,618,621],{},[558,613,614,601,616],{},[268,615,482],{},[268,617,514],{},[558,619,620],{},"Which reports to write and where",[558,622,623,625,626,628,629,631,632,635],{},[268,624,493],{}," plus ",[268,627,502],{}," for reading, ",[268,630,318],{}," for scripts, ",[268,633,634],{},"sarif"," for GitHub code scanning",[245,637,638,639,642,643,646],{},"Files that ",[268,640,641],{},".gitignore"," lists are skipped already; ",[268,644,645],{},"noGitignore: true"," turns that off.",[254,648,650],{"id":649},"check-what-a-run-would-use","Check what a run would use",[314,652,657],{"className":653,"code":654,"filename":655,"language":656,"meta":319,"style":319},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd --debug\n","Terminal","bash",[268,658,659],{"__ignoreMap":319},[323,660,661,664],{"class":325,"line":326},[323,662,286],{"class":663},"sBMFI",[323,665,666],{"class":373}," --debug\n",[245,668,669,670,673,674,676],{},"The command prints the merged configuration (file plus flags) as JSON and exits without scanning. The keys appear in snake_case there (",[268,671,672],{},"min_tokens"," for ",[268,675,448],{},"). If a value you set is not in the output, the key is misspelled: jscpd warns about keys it does not know and ignores them.",[254,678,680],{"id":679},"next","Next",[682,683,684,698,703],"ul",{},[265,685,686,687,689,690,693,694,697],{},"Everything about the file, ",[268,688,290],{},", inline ",[268,691,692],{},"jscpd:ignore"," markers and ignore patterns: ",[249,695,696],{"href":126},"the config file",".",[265,699,700,701,697],{},"Every flag with its default: ",[249,702,120],{"href":121},[265,704,705,706,697],{},"Fail the build on new clones only: ",[249,707,708],{"href":46},"baseline",[710,711,712],"style",{},"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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":319,"searchDepth":333,"depth":333,"links":714},[715,716,717,718],{"id":256,"depth":333,"text":257},{"id":304,"depth":333,"text":305},{"id":649,"depth":333,"text":650},{"id":679,"depth":333,"text":680},"The config file jscpd reads, the handful of keys most projects set, and how to check what a run will use.","md",null,{},{"icon":28},{"title":25,"description":719},"WBm7ugSTd2QcWhWY2xVuffzM0kFbWvRA6_f65UxHB_w",[727,729],{"title":20,"path":21,"stem":22,"description":728,"icon":23,"children":-1},"Scan a repository, read the clones jscpd found and turn the number into a build step, in about ten minutes.",{"title":35,"path":36,"stem":37,"description":730,"icon":38,"children":-1},"Run jscpd as a failing check on GitHub Actions, GitLab CI or any other runner, with SARIF, Code Quality and metrics reports.",1791302986395]