[{"data":1,"prerenderedAt":1385},["ShallowReactive",2],{"navigation_docs":3,"-ci-and-hooks-ci":129,"-ci-and-hooks-ci-surround":1380},[4,45,62,88,108],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration","i-lucide-settings",{"title":26,"path":27,"stem":28,"icon":29},"Supported Formats","\u002Fgetting-started\u002Fsupported-formats","1.getting-started\u002F5.supported-formats","i-lucide-file-code",{"title":31,"path":32,"stem":33,"icon":34},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F6.agent-skill","i-lucide-cpu",{"title":36,"path":37,"stem":38,"icon":39},"Changelog","\u002Fgetting-started\u002Fchangelog","1.getting-started\u002F7.changelog","i-lucide-scroll-text",{"title":41,"path":42,"stem":43,"icon":44},"Migrating from v4 to v5","\u002Fgetting-started\u002Fmigration","1.getting-started\u002F8.migration","i-lucide-arrow-right-left",{"title":46,"path":47,"stem":48,"children":49,"icon":6},"CI & Hooks","\u002Fci-and-hooks","2.ci-and-hooks\u002F1.index",[50,52,57],{"title":46,"path":47,"stem":48,"icon":51},"i-lucide-git-pull-request",{"title":53,"path":54,"stem":55,"icon":56},"Use jscpd in CI","\u002Fci-and-hooks\u002Fci","2.ci-and-hooks\u002F2.ci","i-lucide-github",{"title":58,"path":59,"stem":60,"icon":61},"Use jscpd in Pre-Commit Hook","\u002Fci-and-hooks\u002Fpre-commit","2.ci-and-hooks\u002F3.pre-commit","i-lucide-git-commit",{"title":63,"path":64,"stem":65,"children":66,"icon":68},"Reporters","\u002Freporters","3.reporters\u002F1.index",[67,69,73,78,83],{"title":63,"path":64,"stem":65,"icon":68},"i-lucide-file-chart-column",{"title":70,"path":71,"stem":72,"icon":29},"HTML Reporter","\u002Freporters\u002Fhtml","3.reporters\u002F2.html",{"title":74,"path":75,"stem":76,"icon":77},"JSON Reporter","\u002Freporters\u002Fjson","3.reporters\u002F3.json","i-lucide-braces",{"title":79,"path":80,"stem":81,"icon":82},"Badge Reporter","\u002Freporters\u002Fbadge","3.reporters\u002F4.badge","i-lucide-award",{"title":84,"path":85,"stem":86,"icon":87},"SARIF Reporter","\u002Freporters\u002Fsarif","3.reporters\u002F5.sarif","i-lucide-shield-check",{"title":89,"icon":6,"path":90,"stem":91,"children":92,"page":6},"Benchmarks","\u002Fbenchmarks","4.benchmarks",[93,98,103],{"title":94,"path":95,"stem":96,"icon":97},"Detection Speed","\u002Fbenchmarks\u002Fdetection-speed","4.benchmarks\u002F1.detection-speed","i-lucide-zap",{"title":99,"path":100,"stem":101,"icon":102},"Multi-Format Detection","\u002Fbenchmarks\u002Fcross-format","4.benchmarks\u002F2.cross-format","i-lucide-layers",{"title":104,"path":105,"stem":106,"icon":107},"AI Token Efficiency","\u002Fbenchmarks\u002Fai-token-efficiency","4.benchmarks\u002F3.ai-token-efficiency","i-lucide-sparkles",{"title":109,"path":110,"stem":111,"children":112,"icon":114},"API","\u002Fapi","5.api\u002F1.index",[113,115,120,125],{"title":109,"path":110,"stem":111,"icon":114},"i-lucide-code",{"title":116,"path":117,"stem":118,"icon":119},"Rust Crates (v5)","\u002Fapi\u002Fcore","5.api\u002F2.core","i-lucide-box",{"title":121,"path":122,"stem":123,"icon":124},"Server API","\u002Fapi\u002Fserver","5.api\u002F3.server","i-lucide-server",{"title":126,"path":127,"stem":128,"icon":119},"MCP Server","\u002Fapi\u002Fmcp-server","5.api\u002F4.mcp-server",{"id":130,"title":53,"body":131,"description":1372,"extension":1373,"links":1374,"meta":1375,"navigation":1376,"path":54,"seo":1377,"stem":55,"__hash__":1379},"docs\u002F2.ci-and-hooks\u002F2.ci.md",{"type":132,"value":133,"toc":1359},"minimark",[134,139,151,156,282,285,289,296,330,333,337,765,769,861,865,870,926,930,971,975,1024,1028,1063,1067,1097,1101,1173,1177,1180,1263,1267,1270,1305,1311,1315,1355],[135,136,138],"h2",{"id":137},"github-action","GitHub Action",[140,141,142,143,150],"p",{},"The ",[144,145,149],"a",{"href":146,"rel":147},"https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fjscpd-copy-paste-detector",[148],"nofollow","jscpd-copy-paste-detector"," GitHub Action runs jscpd in your CI workflow. It installs the Rust engine, runs detection, uploads SARIF to GitHub Code Scanning, and optionally uploads the report as an artifact.",[152,153,155],"h3",{"id":154},"basic-usage","Basic Usage",[157,158,164],"pre",{"className":159,"code":160,"filename":161,"language":162,"meta":163,"style":163},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","name: Duplication Check\n\non: [push, pull_request]\n\njobs:\n  jscpd:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: kucherenko\u002Fjscpd@master\n",".github\u002Fworkflows\u002Fjscpd.yml","yaml","",[165,166,167,184,191,215,220,229,237,248,256,270],"code",{"__ignoreMap":163},[168,169,172,176,180],"span",{"class":170,"line":171},"line",1,[168,173,175],{"class":174},"swJcz","name",[168,177,179],{"class":178},"sMK4o",":",[168,181,183],{"class":182},"sfazB"," Duplication Check\n",[168,185,187],{"class":170,"line":186},2,[168,188,190],{"emptyLinePlaceholder":189},true,"\n",[168,192,194,198,200,203,206,209,212],{"class":170,"line":193},3,[168,195,197],{"class":196},"sfNiH","on",[168,199,179],{"class":178},[168,201,202],{"class":178}," [",[168,204,205],{"class":182},"push",[168,207,208],{"class":178},",",[168,210,211],{"class":182}," pull_request",[168,213,214],{"class":178},"]\n",[168,216,218],{"class":170,"line":217},4,[168,219,190],{"emptyLinePlaceholder":189},[168,221,223,226],{"class":170,"line":222},5,[168,224,225],{"class":174},"jobs",[168,227,228],{"class":178},":\n",[168,230,232,235],{"class":170,"line":231},6,[168,233,234],{"class":174},"  jscpd",[168,236,228],{"class":178},[168,238,240,243,245],{"class":170,"line":239},7,[168,241,242],{"class":174},"    runs-on",[168,244,179],{"class":178},[168,246,247],{"class":182}," ubuntu-latest\n",[168,249,251,254],{"class":170,"line":250},8,[168,252,253],{"class":174},"    steps",[168,255,228],{"class":178},[168,257,259,262,265,267],{"class":170,"line":258},9,[168,260,261],{"class":178},"      -",[168,263,264],{"class":174}," uses",[168,266,179],{"class":178},[168,268,269],{"class":182}," actions\u002Fcheckout@v4\n",[168,271,273,275,277,279],{"class":170,"line":272},10,[168,274,261],{"class":178},[168,276,264],{"class":174},[168,278,179],{"class":178},[168,280,281],{"class":182}," kucherenko\u002Fjscpd@master\n",[140,283,284],{},"This scans the entire repository with default settings and uploads SARIF results to GitHub Code Scanning.",[152,286,288],{"id":287},"fail-on-threshold","Fail on Threshold",[140,290,291,292,295],{},"Set ",[165,293,294],{},"threshold"," to fail the build when duplication exceeds a percentage:",[157,297,299],{"className":159,"code":298,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    threshold: 5\n",[165,300,301,312,319],{"__ignoreMap":163},[168,302,303,306,308,310],{"class":170,"line":171},[168,304,305],{"class":178},"-",[168,307,264],{"class":174},[168,309,179],{"class":178},[168,311,281],{"class":182},[168,313,314,317],{"class":170,"line":186},[168,315,316],{"class":174},"  with",[168,318,228],{"class":178},[168,320,321,324,326],{"class":170,"line":193},[168,322,323],{"class":174},"    threshold",[168,325,179],{"class":178},[168,327,329],{"class":328},"sbssI"," 5\n",[140,331,332],{},"The workflow fails if more than 5% of the code is duplicated.",[152,334,336],{"id":335},"action-inputs","Action Inputs",[338,339,340,356],"table",{},[341,342,343],"thead",{},[344,345,346,350,353],"tr",{},[347,348,349],"th",{},"Input",[347,351,352],{},"Description",[347,354,355],{},"Default",[357,358,359,375,392,407,422,434,458,470,482,494,509,524,535,550,566,578,590,604,618,632,646,660,672,684,699,711,725,737,751],"tbody",{},[344,360,361,367,370],{},[362,363,364],"td",{},[165,365,366],{},"path",[362,368,369],{},"Paths to scan (space-separated)",[362,371,372],{},[165,373,374],{},".",[344,376,377,382,389],{},[362,378,379],{},[165,380,381],{},"config",[362,383,384,385,388],{},"Path to ",[165,386,387],{},".jscpd.json"," config file",[362,390,391],{},"—",[344,393,394,399,402],{},[362,395,396],{},[165,397,398],{},"min-tokens",[362,400,401],{},"Minimum tokens for a clone",[362,403,404],{},[165,405,406],{},"50",[344,408,409,414,417],{},[362,410,411],{},[165,412,413],{},"min-lines",[362,415,416],{},"Minimum lines for a clone",[362,418,419],{},[165,420,421],{},"5",[344,423,424,429,432],{},[362,425,426],{},[165,427,428],{},"max-lines",[362,430,431],{},"Maximum lines per block",[362,433,391],{},[344,435,436,441,454],{},[362,437,438],{},[165,439,440],{},"mode",[362,442,443,444,447,448,447,451],{},"Detection mode: ",[165,445,446],{},"mild",", ",[165,449,450],{},"weak",[165,452,453],{},"strict",[362,455,456],{},[165,457,446],{},[344,459,460,465,468],{},[362,461,462],{},[165,463,464],{},"format",[362,466,467],{},"Comma-separated formats to check",[362,469,391],{},[344,471,472,477,480],{},[362,473,474],{},[165,475,476],{},"ignore",[362,478,479],{},"Comma-separated glob patterns to ignore",[362,481,391],{},[344,483,484,489,492],{},[362,485,486],{},[165,487,488],{},"ignore-pattern",[362,490,491],{},"Comma-separated regex patterns to skip",[362,493,391],{},[344,495,496,501,504],{},[362,497,498],{},[165,499,500],{},"reporters",[362,502,503],{},"Comma-separated reporters",[362,505,506],{},[165,507,508],{},"console",[344,510,511,516,519],{},[362,512,513],{},[165,514,515],{},"output",[362,517,518],{},"Output directory for file reporters",[362,520,521],{},[165,522,523],{},"report",[344,525,526,530,533],{},[362,527,528],{},[165,529,294],{},[362,531,532],{},"Max duplication % before exit 1",[362,534,391],{},[344,536,537,542,545],{},[362,538,539],{},[165,540,541],{},"blame",[362,543,544],{},"Enrich clones with git blame data",[362,546,547],{},[165,548,549],{},"false",[344,551,552,557,564],{},[362,553,554],{},[165,555,556],{},"exit-code",[362,558,559,560,563],{},"Exit with code when duplicates found (",[165,561,562],{},"true"," or integer)",[362,565,391],{},[344,567,568,573,576],{},[362,569,570],{},[165,571,572],{},"pattern",[362,574,575],{},"Glob pattern for file search",[362,577,391],{},[344,579,580,585,588],{},[362,581,582],{},[165,583,584],{},"max-size",[362,586,587],{},"Skip files larger than SIZE",[362,589,391],{},[344,591,592,597,600],{},[362,593,594],{},[165,595,596],{},"skip-local",[362,598,599],{},"Skip clones in same directory",[362,601,602],{},[165,603,549],{},[344,605,606,611,614],{},[362,607,608],{},[165,609,610],{},"ignore-case",[362,612,613],{},"Ignore case of symbols (experimental)",[362,615,616],{},[165,617,549],{},[344,619,620,625,628],{},[362,621,622],{},[165,623,624],{},"follow-symlinks",[362,626,627],{},"Follow symbolic links",[362,629,630],{},[165,631,549],{},[344,633,634,639,642],{},[362,635,636],{},[165,637,638],{},"no-gitignore",[362,640,641],{},"Don't respect .gitignore files",[362,643,644],{},[165,645,549],{},[344,647,648,653,656],{},[362,649,650],{},[165,651,652],{},"absolute",[362,654,655],{},"Use absolute paths in reports",[362,657,658],{},[165,659,549],{},[344,661,662,667,670],{},[362,663,664],{},[165,665,666],{},"formats-exts",[362,668,669],{},"Custom format-to-extension mappings",[362,671,391],{},[344,673,674,679,682],{},[362,675,676],{},[165,677,678],{},"formats-names",[362,680,681],{},"Custom format-to-filename mappings",[362,683,391],{},[344,685,686,691,694],{},[362,687,688],{},[165,689,690],{},"version",[362,692,693],{},"jscpd version to install",[362,695,696],{},[165,697,698],{},"latest",[344,700,701,706,709],{},[362,702,703],{},[165,704,705],{},"install-prefix",[362,707,708],{},"Installation directory for the binary",[362,710,391],{},[344,712,713,718,721],{},[362,714,715],{},[165,716,717],{},"skip-install",[362,719,720],{},"Skip installation (binary already present)",[362,722,723],{},[165,724,549],{},[344,726,727,732,735],{},[362,728,729],{},[165,730,731],{},"extra-args",[362,733,734],{},"Additional arguments passed to jscpd",[362,736,391],{},[344,738,739,744,747],{},[362,740,741],{},[165,742,743],{},"upload-report",[362,745,746],{},"Upload report directory as artifact",[362,748,749],{},[165,750,549],{},[344,752,753,758,761],{},[362,754,755],{},[165,756,757],{},"upload-sarif",[362,759,760],{},"Upload SARIF to GitHub Code Scanning",[362,762,763],{},[165,764,562],{},[152,766,768],{"id":767},"action-outputs","Action Outputs",[338,770,771,780],{},[341,772,773],{},[344,774,775,778],{},[347,776,777],{},"Output",[347,779,352],{},[357,781,782,792,802,812,822,832,842,852],{},[344,783,784,789],{},[362,785,786],{},[165,787,788],{},"duplication-percentage",[362,790,791],{},"Percentage of duplicated code found",[344,793,794,799],{},[362,795,796],{},[165,797,798],{},"clones-found",[362,800,801],{},"Number of clone pairs found",[344,803,804,809],{},[362,805,806],{},[165,807,808],{},"duplicated-lines",[362,810,811],{},"Number of duplicated lines",[344,813,814,819],{},[362,815,816],{},[165,817,818],{},"total-lines",[362,820,821],{},"Total lines scanned",[344,823,824,829],{},[362,825,826],{},[165,827,828],{},"files-count",[362,830,831],{},"Number of source files scanned",[344,833,834,839],{},[362,835,836],{},[165,837,838],{},"report-path",[362,840,841],{},"Path to the output directory",[344,843,844,849],{},[362,845,846],{},[165,847,848],{},"sarif-path",[362,850,851],{},"Path to the SARIF report file",[344,853,854,858],{},[362,855,856],{},[165,857,556],{},[362,859,860],{},"Exit code from jscpd",[152,862,864],{"id":863},"examples","Examples",[866,867,869],"h4",{"id":868},"scan-specific-directories-with-threshold","Scan specific directories with threshold",[157,871,873],{"className":159,"code":872,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    path: src\u002Flib src\u002Futils\n    threshold: 3\n    ignore: \"**\u002F*.test.*,**\u002F*.spec.*\"\n",[165,874,875,885,891,901,910],{"__ignoreMap":163},[168,876,877,879,881,883],{"class":170,"line":171},[168,878,305],{"class":178},[168,880,264],{"class":174},[168,882,179],{"class":178},[168,884,281],{"class":182},[168,886,887,889],{"class":170,"line":186},[168,888,316],{"class":174},[168,890,228],{"class":178},[168,892,893,896,898],{"class":170,"line":193},[168,894,895],{"class":174},"    path",[168,897,179],{"class":178},[168,899,900],{"class":182}," src\u002Flib src\u002Futils\n",[168,902,903,905,907],{"class":170,"line":217},[168,904,323],{"class":174},[168,906,179],{"class":178},[168,908,909],{"class":328}," 3\n",[168,911,912,915,917,920,923],{"class":170,"line":222},[168,913,914],{"class":174},"    ignore",[168,916,179],{"class":178},[168,918,919],{"class":178}," \"",[168,921,922],{"class":182},"**\u002F*.test.*,**\u002F*.spec.*",[168,924,925],{"class":178},"\"\n",[866,927,929],{"id":928},"use-a-config-file","Use a config file",[157,931,933],{"className":159,"code":932,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    config: .jscpd.json\n    upload-report: true\n",[165,934,935,945,951,961],{"__ignoreMap":163},[168,936,937,939,941,943],{"class":170,"line":171},[168,938,305],{"class":178},[168,940,264],{"class":174},[168,942,179],{"class":178},[168,944,281],{"class":182},[168,946,947,949],{"class":170,"line":186},[168,948,316],{"class":174},[168,950,228],{"class":178},[168,952,953,956,958],{"class":170,"line":193},[168,954,955],{"class":174},"    config",[168,957,179],{"class":178},[168,959,960],{"class":182}," .jscpd.json\n",[168,962,963,966,968],{"class":170,"line":217},[168,964,965],{"class":174},"    upload-report",[168,967,179],{"class":178},[168,969,970],{"class":196}," true\n",[866,972,974],{"id":973},"multi-reporter-with-artifact-upload","Multi-reporter with artifact upload",[157,976,978],{"className":159,"code":977,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    reporters: console,json,html,sarif\n    output: jscpd-report\n    upload-report: true\n",[165,979,980,990,996,1006,1016],{"__ignoreMap":163},[168,981,982,984,986,988],{"class":170,"line":171},[168,983,305],{"class":178},[168,985,264],{"class":174},[168,987,179],{"class":178},[168,989,281],{"class":182},[168,991,992,994],{"class":170,"line":186},[168,993,316],{"class":174},[168,995,228],{"class":178},[168,997,998,1001,1003],{"class":170,"line":193},[168,999,1000],{"class":174},"    reporters",[168,1002,179],{"class":178},[168,1004,1005],{"class":182}," console,json,html,sarif\n",[168,1007,1008,1011,1013],{"class":170,"line":217},[168,1009,1010],{"class":174},"    output",[168,1012,179],{"class":178},[168,1014,1015],{"class":182}," jscpd-report\n",[168,1017,1018,1020,1022],{"class":170,"line":222},[168,1019,965],{"class":174},[168,1021,179],{"class":178},[168,1023,970],{"class":196},[866,1025,1027],{"id":1026},"pin-a-specific-version","Pin a specific version",[157,1029,1031],{"className":159,"code":1030,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    version: \"5.0.9\"\n",[165,1032,1033,1043,1049],{"__ignoreMap":163},[168,1034,1035,1037,1039,1041],{"class":170,"line":171},[168,1036,305],{"class":178},[168,1038,264],{"class":174},[168,1040,179],{"class":178},[168,1042,281],{"class":182},[168,1044,1045,1047],{"class":170,"line":186},[168,1046,316],{"class":174},[168,1048,228],{"class":178},[168,1050,1051,1054,1056,1058,1061],{"class":170,"line":193},[168,1052,1053],{"class":174},"    version",[168,1055,179],{"class":178},[168,1057,919],{"class":178},[168,1059,1060],{"class":182},"5.0.9",[168,1062,925],{"class":178},[866,1064,1066],{"id":1065},"skip-install-binary-already-in-image","Skip install (binary already in image)",[157,1068,1070],{"className":159,"code":1069,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  with:\n    skip-install: true\n",[165,1071,1072,1082,1088],{"__ignoreMap":163},[168,1073,1074,1076,1078,1080],{"class":170,"line":171},[168,1075,305],{"class":178},[168,1077,264],{"class":174},[168,1079,179],{"class":178},[168,1081,281],{"class":182},[168,1083,1084,1086],{"class":170,"line":186},[168,1085,316],{"class":174},[168,1087,228],{"class":178},[168,1089,1090,1093,1095],{"class":170,"line":193},[168,1091,1092],{"class":174},"    skip-install",[168,1094,179],{"class":178},[168,1096,970],{"class":196},[866,1098,1100],{"id":1099},"use-outputs-in-subsequent-steps","Use outputs in subsequent steps",[157,1102,1104],{"className":159,"code":1103,"language":162,"meta":163,"style":163},"- uses: kucherenko\u002Fjscpd@master\n  id: jscpd\n\n- name: Check results\n  if: steps.jscpd.outputs.duplication-percentage > 5\n  run: |\n    echo \"Duplication is ${{ steps.jscpd.outputs.duplication-percentage }}%\"\n    echo \"Found ${{ steps.jscpd.outputs.clones-found }} clones\"\n",[165,1105,1106,1116,1126,1130,1142,1152,1163,1168],{"__ignoreMap":163},[168,1107,1108,1110,1112,1114],{"class":170,"line":171},[168,1109,305],{"class":178},[168,1111,264],{"class":174},[168,1113,179],{"class":178},[168,1115,281],{"class":182},[168,1117,1118,1121,1123],{"class":170,"line":186},[168,1119,1120],{"class":174},"  id",[168,1122,179],{"class":178},[168,1124,1125],{"class":182}," jscpd\n",[168,1127,1128],{"class":170,"line":193},[168,1129,190],{"emptyLinePlaceholder":189},[168,1131,1132,1134,1137,1139],{"class":170,"line":217},[168,1133,305],{"class":178},[168,1135,1136],{"class":174}," name",[168,1138,179],{"class":178},[168,1140,1141],{"class":182}," Check results\n",[168,1143,1144,1147,1149],{"class":170,"line":222},[168,1145,1146],{"class":174},"  if",[168,1148,179],{"class":178},[168,1150,1151],{"class":182}," steps.jscpd.outputs.duplication-percentage > 5\n",[168,1153,1154,1157,1159],{"class":170,"line":231},[168,1155,1156],{"class":174},"  run",[168,1158,179],{"class":178},[168,1160,1162],{"class":1161},"s7zQu"," |\n",[168,1164,1165],{"class":170,"line":239},[168,1166,1167],{"class":182},"    echo \"Duplication is ${{ steps.jscpd.outputs.duplication-percentage }}%\"\n",[168,1169,1170],{"class":170,"line":250},[168,1171,1172],{"class":182},"    echo \"Found ${{ steps.jscpd.outputs.clones-found }} clones\"\n",[135,1174,1176],{"id":1175},"gitlab-ci","GitLab CI",[140,1178,1179],{},"Use jscpd in GitLab CI with a simple pipeline job:",[157,1181,1184],{"className":159,"code":1182,"filename":1183,"language":162,"meta":163,"style":163},"jscpd:\n  stage: test\n  image: node:20\n  before_script:\n    - npm install -g jscpd@5\n  script:\n    - jscpd --threshold 5 --reporters console,sarif .\n  artifacts:\n    paths:\n      - report\u002F\n",".gitlab-ci.yml",[165,1185,1186,1193,1203,1213,1220,1228,1235,1242,1249,1256],{"__ignoreMap":163},[168,1187,1188,1191],{"class":170,"line":171},[168,1189,1190],{"class":174},"jscpd",[168,1192,228],{"class":178},[168,1194,1195,1198,1200],{"class":170,"line":186},[168,1196,1197],{"class":174},"  stage",[168,1199,179],{"class":178},[168,1201,1202],{"class":182}," test\n",[168,1204,1205,1208,1210],{"class":170,"line":193},[168,1206,1207],{"class":174},"  image",[168,1209,179],{"class":178},[168,1211,1212],{"class":182}," node:20\n",[168,1214,1215,1218],{"class":170,"line":217},[168,1216,1217],{"class":174},"  before_script",[168,1219,228],{"class":178},[168,1221,1222,1225],{"class":170,"line":222},[168,1223,1224],{"class":178},"    -",[168,1226,1227],{"class":182}," npm install -g jscpd@5\n",[168,1229,1230,1233],{"class":170,"line":231},[168,1231,1232],{"class":174},"  script",[168,1234,228],{"class":178},[168,1236,1237,1239],{"class":170,"line":239},[168,1238,1224],{"class":178},[168,1240,1241],{"class":182}," jscpd --threshold 5 --reporters console,sarif .\n",[168,1243,1244,1247],{"class":170,"line":250},[168,1245,1246],{"class":174},"  artifacts",[168,1248,228],{"class":178},[168,1250,1251,1254],{"class":170,"line":258},[168,1252,1253],{"class":174},"    paths",[168,1255,228],{"class":178},[168,1257,1258,1260],{"class":170,"line":272},[168,1259,261],{"class":178},[168,1261,1262],{"class":182}," report\u002F\n",[135,1264,1266],{"id":1265},"generic-ci","Generic CI",[140,1268,1269],{},"Any CI system that can run shell commands works with jscpd:",[157,1271,1275],{"className":1272,"code":1273,"language":1274,"meta":163,"style":163},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install -g jscpd@5\njscpd --threshold 5 .\u002Fsrc\n","bash",[165,1276,1277,1292],{"__ignoreMap":163},[168,1278,1279,1283,1286,1289],{"class":170,"line":171},[168,1280,1282],{"class":1281},"sBMFI","npm",[168,1284,1285],{"class":182}," install",[168,1287,1288],{"class":182}," -g",[168,1290,1291],{"class":182}," jscpd@5\n",[168,1293,1294,1296,1299,1302],{"class":170,"line":186},[168,1295,1190],{"class":1281},[168,1297,1298],{"class":182}," --threshold",[168,1300,1301],{"class":328}," 5",[168,1303,1304],{"class":182}," .\u002Fsrc\n",[140,1306,142,1307,1310],{},[165,1308,1309],{},"--threshold"," flag makes jscpd exit with code 1 when duplication exceeds the specified percentage, which causes CI builds to fail.",[152,1312,1314],{"id":1313},"tips","Tips",[1316,1317,1318,1326,1331,1337,1348],"ul",{},[1319,1320,1321,1322,1325],"li",{},"Use ",[165,1323,1324],{},"--reporters console,sarif"," in CI to get both console output and SARIF for code scanning platforms",[1319,1327,1321,1328,1330],{},[165,1329,1309],{}," to set a failure threshold — the process exits with code 1 if exceeded",[1319,1332,1321,1333,1336],{},[165,1334,1335],{},"--ignore"," to exclude generated files, test fixtures, or vendor directories",[1319,1338,1339,1340,1343,1344,1347],{},"For large repos, use the Rust engine (",[165,1341,1342],{},"jscpd@5"," \u002F ",[165,1345,1346],{},"cpd",") — it runs 24-37x faster, keeping CI times low",[1319,1349,1350,1351,1354],{},"Consider ",[165,1352,1353],{},"--format"," to limit detection to specific languages during CI, with a full scan in a scheduled job",[1356,1357,1358],"style",{},"html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":163,"searchDepth":186,"depth":186,"links":1360},[1361,1368,1369],{"id":137,"depth":186,"text":138,"children":1362},[1363,1364,1365,1366,1367],{"id":154,"depth":193,"text":155},{"id":287,"depth":193,"text":288},{"id":335,"depth":193,"text":336},{"id":767,"depth":193,"text":768},{"id":863,"depth":193,"text":864},{"id":1175,"depth":186,"text":1176},{"id":1265,"depth":186,"text":1266,"children":1370},[1371],{"id":1313,"depth":193,"text":1314},"Run jscpd in GitHub Actions, GitLab CI, and other CI systems to enforce duplication thresholds.","md",null,{},{"icon":56},{"title":53,"description":1378},"Integrate jscpd into GitHub Actions, GitLab CI, and generic CI pipelines to fail builds when code duplication exceeds a threshold.","osjzIVoVOxif8HQXPRwnazy-VWscZB3bdOIvOMAv2Ek",[1381,1383],{"title":46,"path":47,"stem":48,"description":1382,"icon":51,"children":-1},"Integrate jscpd into your CI pipeline and git hooks.",{"title":58,"path":59,"stem":60,"description":1384,"icon":61,"children":-1},"Run jscpd before every commit to prevent duplicated code from entering the repository.",1782123773324]