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