[{"data":1,"prerenderedAt":1822},["ShallowReactive",2],{"navigation_docs":3,"-reference-reporters-sarif":249,"-reference-reporters-sarif-surround":1814,"page-views-\u002Freference\u002Freporters\u002Fsarif":1819},[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":167,"body":251,"description":1807,"extension":1808,"links":1809,"meta":1810,"navigation":1811,"path":168,"seo":1812,"stem":169,"__hash__":1813},"docs\u002F4.reference\u002F4.reporters\u002F5.sarif.md",{"type":252,"value":253,"toc":1796},"minimark",[254,266,271,306,314,412,416,426,1050,1072,1077,1094,1217,1228,1231,1325,1329,1351,1500,1511,1575,1578,1582,1591,1648,1663,1667,1764,1768,1792],[255,256,257,261,262,265],"p",{},[258,259,260],"code",{},"-r sarif"," writes the format that GitHub code scanning, Azure DevOps and SARIF viewers read, so a clone appears as an annotation on the lines of a pull request with a link to its other copy. Pick it when findings belong in the code scanning view; for GitLab merge requests the ",[263,264,172],"a",{"href":173}," is the one GitLab shows as quality issues.",[267,268,270],"h2",{"id":269},"run-it","Run it",[272,273,279],"pre",{"className":274,"code":275,"filename":276,"language":277,"meta":278,"style":278},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd . -r sarif --output report\n","Terminal","bash","",[258,280,281],{"__ignoreMap":278},[282,283,286,290,294,297,300,303],"span",{"class":284,"line":285},"line",1,[282,287,289],{"class":288},"sBMFI","jscpd",[282,291,293],{"class":292},"sfazB"," .",[282,295,296],{"class":292}," -r",[282,298,299],{"class":292}," sarif",[282,301,302],{"class":292}," --output",[282,304,305],{"class":292}," report\n",[272,307,312],{"className":308,"code":310,"language":311,"meta":278},[309],"language-text","SARIF report saved to report\u002Fjscpd-report.sarif\n","text",[258,313,310],{"__ignoreMap":278},[272,315,320],{"className":316,"code":317,"filename":318,"language":319,"meta":278,"style":278},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"reporters\": [\"console\", \"sarif\"],\n  \"output\": \"report\",\n  \"sarifErrorTokens\": 150\n}\n",".jscpd.json","json",[258,321,322,328,368,390,406],{"__ignoreMap":278},[282,323,324],{"class":284,"line":285},[282,325,327],{"class":326},"sMK4o","{\n",[282,329,331,334,338,341,344,347,349,352,354,357,360,363,365],{"class":284,"line":330},2,[282,332,333],{"class":326},"  \"",[282,335,337],{"class":336},"spNyl","reporters",[282,339,340],{"class":326},"\"",[282,342,343],{"class":326},":",[282,345,346],{"class":326}," [",[282,348,340],{"class":326},[282,350,351],{"class":292},"console",[282,353,340],{"class":326},[282,355,356],{"class":326},",",[282,358,359],{"class":326}," \"",[282,361,362],{"class":292},"sarif",[282,364,340],{"class":326},[282,366,367],{"class":326},"],\n",[282,369,371,373,376,378,380,382,385,387],{"class":284,"line":370},3,[282,372,333],{"class":326},[282,374,375],{"class":336},"output",[282,377,340],{"class":326},[282,379,343],{"class":326},[282,381,359],{"class":326},[282,383,384],{"class":292},"report",[282,386,340],{"class":326},[282,388,389],{"class":326},",\n",[282,391,393,395,398,400,402],{"class":284,"line":392},4,[282,394,333],{"class":326},[282,396,397],{"class":336},"sarifErrorTokens",[282,399,340],{"class":326},[282,401,343],{"class":326},[282,403,405],{"class":404},"sbssI"," 150\n",[282,407,409],{"class":284,"line":408},5,[282,410,411],{"class":326},"}\n",[267,413,415],{"id":414},"the-output","The output",[255,417,418,419,422,423,343],{},"One result from the repository's ",[258,420,421],{},"fixtures\u002Fmcp-demo"," folder scanned with ",[258,424,425],{},"--ignore-identifiers --ignore-literals --max-gap-lines 1",[272,427,430],{"className":316,"code":428,"filename":429,"language":319,"meta":278,"style":278},"{\n  \"ruleId\": \"jscpd\u002Fsimilar-code\",\n  \"level\": \"warning\",\n  \"message\": {\n    \"text\": \"Duplicated code block (197 tokens), duplicated at [src\u002Fprint\u002Finvoice.js:1](0)\"\n  },\n  \"locations\": [\n    {\n      \"physicalLocation\": {\n        \"artifactLocation\": { \"uri\": \"src\u002Finvoice.js\", \"uriBaseId\": \"%SRCROOT%\", \"index\": 0 },\n        \"region\": { \"startLine\": 1, \"startColumn\": 1, \"endLine\": 12, \"endColumn\": 2 }\n      }\n    }\n  ],\n  \"relatedLocations\": [\n    {\n      \"id\": 0,\n      \"message\": { \"text\": \"Duplicated at src\u002Fprint\u002Finvoice.js:1\" },\n      \"physicalLocation\": {\n        \"artifactLocation\": { \"uri\": \"src\u002Fprint\u002Finvoice.js\", \"uriBaseId\": \"%SRCROOT%\", \"index\": 1 },\n        \"region\": { \"startLine\": 1, \"startColumn\": 1, \"endLine\": 13, \"endColumn\": 2 }\n      }\n    }\n  ],\n  \"partialFingerprints\": { \"jscpdCloneHash\u002Fv1\": \"c3ca1ec9e494c277\" },\n  \"properties\": {\n    \"token_count\": 197,\n    \"similarity\": 0.947,\n    \"similarity_method\": \"gap\",\n    \"clone_hash\": \"c3ca1ec9e494c277\"\n  }\n}\n","report\u002Fjscpd-report.sarif",[258,431,432,436,456,476,490,509,515,530,536,551,619,689,695,701,707,721,726,742,772,785,843,905,910,915,920,952,966,983,1000,1021,1039,1045],{"__ignoreMap":278},[282,433,434],{"class":284,"line":285},[282,435,327],{"class":326},[282,437,438,440,443,445,447,449,452,454],{"class":284,"line":330},[282,439,333],{"class":326},[282,441,442],{"class":336},"ruleId",[282,444,340],{"class":326},[282,446,343],{"class":326},[282,448,359],{"class":326},[282,450,451],{"class":292},"jscpd\u002Fsimilar-code",[282,453,340],{"class":326},[282,455,389],{"class":326},[282,457,458,460,463,465,467,469,472,474],{"class":284,"line":370},[282,459,333],{"class":326},[282,461,462],{"class":336},"level",[282,464,340],{"class":326},[282,466,343],{"class":326},[282,468,359],{"class":326},[282,470,471],{"class":292},"warning",[282,473,340],{"class":326},[282,475,389],{"class":326},[282,477,478,480,483,485,487],{"class":284,"line":392},[282,479,333],{"class":326},[282,481,482],{"class":336},"message",[282,484,340],{"class":326},[282,486,343],{"class":326},[282,488,489],{"class":326}," {\n",[282,491,492,495,497,499,501,503,506],{"class":284,"line":408},[282,493,494],{"class":326},"    \"",[282,496,311],{"class":288},[282,498,340],{"class":326},[282,500,343],{"class":326},[282,502,359],{"class":326},[282,504,505],{"class":292},"Duplicated code block (197 tokens), duplicated at [src\u002Fprint\u002Finvoice.js:1](0)",[282,507,508],{"class":326},"\"\n",[282,510,512],{"class":284,"line":511},6,[282,513,514],{"class":326},"  },\n",[282,516,518,520,523,525,527],{"class":284,"line":517},7,[282,519,333],{"class":326},[282,521,522],{"class":336},"locations",[282,524,340],{"class":326},[282,526,343],{"class":326},[282,528,529],{"class":326}," [\n",[282,531,533],{"class":284,"line":532},8,[282,534,535],{"class":326},"    {\n",[282,537,539,542,545,547,549],{"class":284,"line":538},9,[282,540,541],{"class":326},"      \"",[282,543,544],{"class":288},"physicalLocation",[282,546,340],{"class":326},[282,548,343],{"class":326},[282,550,489],{"class":326},[282,552,554,557,560,562,564,567,569,573,575,577,579,582,584,586,588,591,593,595,597,600,602,604,606,609,611,613,616],{"class":284,"line":553},10,[282,555,556],{"class":326},"        \"",[282,558,559],{"class":404},"artifactLocation",[282,561,340],{"class":326},[282,563,343],{"class":326},[282,565,566],{"class":326}," {",[282,568,359],{"class":326},[282,570,572],{"class":571},"swJcz","uri",[282,574,340],{"class":326},[282,576,343],{"class":326},[282,578,359],{"class":326},[282,580,581],{"class":292},"src\u002Finvoice.js",[282,583,340],{"class":326},[282,585,356],{"class":326},[282,587,359],{"class":326},[282,589,590],{"class":571},"uriBaseId",[282,592,340],{"class":326},[282,594,343],{"class":326},[282,596,359],{"class":326},[282,598,599],{"class":292},"%SRCROOT%",[282,601,340],{"class":326},[282,603,356],{"class":326},[282,605,359],{"class":326},[282,607,608],{"class":571},"index",[282,610,340],{"class":326},[282,612,343],{"class":326},[282,614,615],{"class":404}," 0",[282,617,618],{"class":326}," },\n",[282,620,622,624,627,629,631,633,635,638,640,642,645,647,649,652,654,656,658,660,662,665,667,669,672,674,676,679,681,683,686],{"class":284,"line":621},11,[282,623,556],{"class":326},[282,625,626],{"class":404},"region",[282,628,340],{"class":326},[282,630,343],{"class":326},[282,632,566],{"class":326},[282,634,359],{"class":326},[282,636,637],{"class":571},"startLine",[282,639,340],{"class":326},[282,641,343],{"class":326},[282,643,644],{"class":404}," 1",[282,646,356],{"class":326},[282,648,359],{"class":326},[282,650,651],{"class":571},"startColumn",[282,653,340],{"class":326},[282,655,343],{"class":326},[282,657,644],{"class":404},[282,659,356],{"class":326},[282,661,359],{"class":326},[282,663,664],{"class":571},"endLine",[282,666,340],{"class":326},[282,668,343],{"class":326},[282,670,671],{"class":404}," 12",[282,673,356],{"class":326},[282,675,359],{"class":326},[282,677,678],{"class":571},"endColumn",[282,680,340],{"class":326},[282,682,343],{"class":326},[282,684,685],{"class":404}," 2",[282,687,688],{"class":326}," }\n",[282,690,692],{"class":284,"line":691},12,[282,693,694],{"class":326},"      }\n",[282,696,698],{"class":284,"line":697},13,[282,699,700],{"class":326},"    }\n",[282,702,704],{"class":284,"line":703},14,[282,705,706],{"class":326},"  ],\n",[282,708,710,712,715,717,719],{"class":284,"line":709},15,[282,711,333],{"class":326},[282,713,714],{"class":336},"relatedLocations",[282,716,340],{"class":326},[282,718,343],{"class":326},[282,720,529],{"class":326},[282,722,724],{"class":284,"line":723},16,[282,725,535],{"class":326},[282,727,729,731,734,736,738,740],{"class":284,"line":728},17,[282,730,541],{"class":326},[282,732,733],{"class":288},"id",[282,735,340],{"class":326},[282,737,343],{"class":326},[282,739,615],{"class":404},[282,741,389],{"class":326},[282,743,745,747,749,751,753,755,757,759,761,763,765,768,770],{"class":284,"line":744},18,[282,746,541],{"class":326},[282,748,482],{"class":288},[282,750,340],{"class":326},[282,752,343],{"class":326},[282,754,566],{"class":326},[282,756,359],{"class":326},[282,758,311],{"class":404},[282,760,340],{"class":326},[282,762,343],{"class":326},[282,764,359],{"class":326},[282,766,767],{"class":292},"Duplicated at src\u002Fprint\u002Finvoice.js:1",[282,769,340],{"class":326},[282,771,618],{"class":326},[282,773,775,777,779,781,783],{"class":284,"line":774},19,[282,776,541],{"class":326},[282,778,544],{"class":288},[282,780,340],{"class":326},[282,782,343],{"class":326},[282,784,489],{"class":326},[282,786,788,790,792,794,796,798,800,802,804,806,808,811,813,815,817,819,821,823,825,827,829,831,833,835,837,839,841],{"class":284,"line":787},20,[282,789,556],{"class":326},[282,791,559],{"class":404},[282,793,340],{"class":326},[282,795,343],{"class":326},[282,797,566],{"class":326},[282,799,359],{"class":326},[282,801,572],{"class":571},[282,803,340],{"class":326},[282,805,343],{"class":326},[282,807,359],{"class":326},[282,809,810],{"class":292},"src\u002Fprint\u002Finvoice.js",[282,812,340],{"class":326},[282,814,356],{"class":326},[282,816,359],{"class":326},[282,818,590],{"class":571},[282,820,340],{"class":326},[282,822,343],{"class":326},[282,824,359],{"class":326},[282,826,599],{"class":292},[282,828,340],{"class":326},[282,830,356],{"class":326},[282,832,359],{"class":326},[282,834,608],{"class":571},[282,836,340],{"class":326},[282,838,343],{"class":326},[282,840,644],{"class":404},[282,842,618],{"class":326},[282,844,846,848,850,852,854,856,858,860,862,864,866,868,870,872,874,876,878,880,882,884,886,888,891,893,895,897,899,901,903],{"class":284,"line":845},21,[282,847,556],{"class":326},[282,849,626],{"class":404},[282,851,340],{"class":326},[282,853,343],{"class":326},[282,855,566],{"class":326},[282,857,359],{"class":326},[282,859,637],{"class":571},[282,861,340],{"class":326},[282,863,343],{"class":326},[282,865,644],{"class":404},[282,867,356],{"class":326},[282,869,359],{"class":326},[282,871,651],{"class":571},[282,873,340],{"class":326},[282,875,343],{"class":326},[282,877,644],{"class":404},[282,879,356],{"class":326},[282,881,359],{"class":326},[282,883,664],{"class":571},[282,885,340],{"class":326},[282,887,343],{"class":326},[282,889,890],{"class":404}," 13",[282,892,356],{"class":326},[282,894,359],{"class":326},[282,896,678],{"class":571},[282,898,340],{"class":326},[282,900,343],{"class":326},[282,902,685],{"class":404},[282,904,688],{"class":326},[282,906,908],{"class":284,"line":907},22,[282,909,694],{"class":326},[282,911,913],{"class":284,"line":912},23,[282,914,700],{"class":326},[282,916,918],{"class":284,"line":917},24,[282,919,706],{"class":326},[282,921,923,925,928,930,932,934,936,939,941,943,945,948,950],{"class":284,"line":922},25,[282,924,333],{"class":326},[282,926,927],{"class":336},"partialFingerprints",[282,929,340],{"class":326},[282,931,343],{"class":326},[282,933,566],{"class":326},[282,935,359],{"class":326},[282,937,938],{"class":288},"jscpdCloneHash\u002Fv1",[282,940,340],{"class":326},[282,942,343],{"class":326},[282,944,359],{"class":326},[282,946,947],{"class":292},"c3ca1ec9e494c277",[282,949,340],{"class":326},[282,951,618],{"class":326},[282,953,955,957,960,962,964],{"class":284,"line":954},26,[282,956,333],{"class":326},[282,958,959],{"class":336},"properties",[282,961,340],{"class":326},[282,963,343],{"class":326},[282,965,489],{"class":326},[282,967,969,971,974,976,978,981],{"class":284,"line":968},27,[282,970,494],{"class":326},[282,972,973],{"class":288},"token_count",[282,975,340],{"class":326},[282,977,343],{"class":326},[282,979,980],{"class":404}," 197",[282,982,389],{"class":326},[282,984,986,988,991,993,995,998],{"class":284,"line":985},28,[282,987,494],{"class":326},[282,989,990],{"class":288},"similarity",[282,992,340],{"class":326},[282,994,343],{"class":326},[282,996,997],{"class":404}," 0.947",[282,999,389],{"class":326},[282,1001,1003,1005,1008,1010,1012,1014,1017,1019],{"class":284,"line":1002},29,[282,1004,494],{"class":326},[282,1006,1007],{"class":288},"similarity_method",[282,1009,340],{"class":326},[282,1011,343],{"class":326},[282,1013,359],{"class":326},[282,1015,1016],{"class":292},"gap",[282,1018,340],{"class":326},[282,1020,389],{"class":326},[282,1022,1024,1026,1029,1031,1033,1035,1037],{"class":284,"line":1023},30,[282,1025,494],{"class":326},[282,1027,1028],{"class":288},"clone_hash",[282,1030,340],{"class":326},[282,1032,343],{"class":326},[282,1034,359],{"class":326},[282,1036,947],{"class":292},[282,1038,508],{"class":326},[282,1040,1042],{"class":284,"line":1041},31,[282,1043,1044],{"class":326},"  }\n",[282,1046,1048],{"class":284,"line":1047},32,[282,1049,411],{"class":326},[255,1051,1052,1053,1056,1057,1060,1061,1064,1065,1067,1068,1071],{},"The primary location is the first copy; the second copy is related location ",[258,1054,1055],{},"0",", and the message links to it as ",[258,1058,1059],{},"[...](0)",", which is how GitHub shows both sides. Paths are relative to the scanned directory, declared once under ",[258,1062,1063],{},"originalUriBaseIds"," as ",[258,1066,599],{},", and ",[258,1069,1070],{},"tool.driver.version"," is the jscpd version.",[1073,1074,1076],"h3",{"id":1075},"rules","Rules",[255,1078,1079,1081,1082,1085,1086,1089,1090,1093],{},[258,1080,442],{}," names the ",[263,1083,1084],{"href":111},"kind of clone",". ",[258,1087,1088],{},"jscpd\u002Fduplicate-code"," is always declared in ",[258,1091,1092],{},"tool.driver.rules","; the other rules appear there only when a result uses them.",[1095,1096,1097,1116],"table",{},[1098,1099,1100],"thead",{},[1101,1102,1103,1107,1110,1113],"tr",{},[1104,1105,1106],"th",{},"Rule",[1104,1108,1109],{},"Clone",[1104,1111,1112],{},"Needs",[1104,1114,1115],{},"Since",[1117,1118,1119,1134,1160,1176,1199],"tbody",{},[1101,1120,1121,1126,1129,1132],{},[1122,1123,1124],"td",{},[258,1125,1088],{},[1122,1127,1128],{},"Token-for-token copies (Type-1)",[1122,1130,1131],{},"nothing",[1122,1133],{},[1101,1135,1136,1141,1144,1157],{},[1122,1137,1138],{},[258,1139,1140],{},"jscpd\u002Frenamed-code",[1122,1142,1143],{},"Copies that match once identifiers, literals or annotations are normalized (Type-2)",[1122,1145,1146,1149,1150,1153,1154],{},[258,1147,1148],{},"--ignore-identifiers",", ",[258,1151,1152],{},"--ignore-literals"," or ",[258,1155,1156],{},"--ignore-annotations",[1122,1158,1159],{},"5.2.0+",[1101,1161,1162,1166,1169,1174],{},[1122,1163,1164],{},[258,1165,451],{},[1122,1167,1168],{},"Exact matches merged across a gap of changed lines (Type-3)",[1122,1170,1171],{},[258,1172,1173],{},"--max-gap-lines",[1122,1175,1159],{},[1101,1177,1178,1183,1188,1193],{},[1122,1179,1180],{},[258,1181,1182],{},"jscpd\u002Fsimilar-function",[1122,1184,1185,1186],{},"Functions whose normalized syntax trees share subtrees, in 15 languages (Type-3), see ",[263,1187,95],{"href":96},[1122,1189,1190],{},[258,1191,1192],{},"--similarity",[1122,1194,1195,1196,1198],{},"5.4.0+ (filed under ",[258,1197,451],{}," before)",[1101,1200,1201,1206,1209,1214],{},[1122,1202,1203],{},[258,1204,1205],{},"jscpd\u002Fsemantic-code",[1122,1207,1208],{},"Functions that do the same job written differently (Type-4)",[1122,1210,1211],{},[258,1212,1213],{},"--semantic",[1122,1215,1216],{},"5.3.3+",[255,1218,1219,1220,1223,1224,1227],{},"The same ids are the ",[258,1221,1222],{},"check_name"," of the CodeClimate report and the diagnostic codes of ",[258,1225,1226],{},"--lsp",", so one clone has one name in code scanning, in a merge request and in the editor.",[1073,1229,1230],{"id":959},"Properties",[1095,1232,1233,1243],{},[1098,1234,1235],{},[1101,1236,1237,1240],{},[1104,1238,1239],{},"Property",[1104,1241,1242],{},"Meaning",[1117,1244,1245,1254,1278,1290,1303],{},[1101,1246,1247,1251],{},[1122,1248,1249],{},[258,1250,973],{},[1122,1252,1253],{},"Matched tokens",[1101,1255,1256,1262],{},[1122,1257,1258,1149,1260],{},[258,1259,990],{},[258,1261,1007],{},[1122,1263,1264,1265,1268,1269,1272,1273,1153,1275],{},"Present for ",[258,1266,1267],{},"similar"," and ",[258,1270,1271],{},"semantic"," clones; the method is ",[258,1274,1016],{},[258,1276,1277],{},"ast",[1101,1279,1280,1285],{},[1122,1281,1282],{},[258,1283,1284],{},"nodes",[1122,1286,1264,1287,1289],{},[258,1288,1277],{}," pairs: the sizes of the two functions' normalized syntax trees",[1101,1291,1292,1296],{},[1122,1293,1294],{},[258,1295,1028],{},[1122,1297,1298,1299,1302],{},"The content hash of the pair, the same value as ",[258,1300,1301],{},"partialFingerprints.jscpdCloneHash\u002Fv1","; it does not depend on which copy comes first, so code scanning keeps tracking a clone when line numbers shift (5.0.15+)",[1101,1304,1305,1310],{},[1122,1306,1307],{},[258,1308,1309],{},"blame",[1122,1311,1312,1149,1315,1268,1318,1321,1322],{},[258,1313,1314],{},"sha",[258,1316,1317],{},"author",[258,1319,1320],{},"timestamp"," of the first copy, with ",[258,1323,1324],{},"--blame",[267,1326,1328],{"id":1327},"where-it-shows-up","Where it shows up",[255,1330,1331,1332,1334,1335,1338,1339,1342,1343,1346,1347,1350],{},"With the GitHub Action, ",[258,1333,362],{}," among the reporters is enough: the action uploads the file to code scanning itself (",[258,1336,1337],{},"upload-sarif"," defaults to ",[258,1340,1341],{},"true","). The job needs the ",[258,1344,1345],{},"security-events: write"," permission, and ",[258,1348,1349],{},"contents: read"," as well in a private repository:",[272,1352,1357],{"className":1353,"code":1354,"filename":1355,"language":1356,"meta":278,"style":278},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","name: Duplication\non: [push, pull_request]\n\npermissions:\n  contents: read\n  security-events: write\n\njobs:\n  jscpd:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: kucherenko\u002Fjscpd@v5\n        with:\n          reporters: console,sarif\n",".github\u002Fworkflows\u002Fjscpd.yml","yaml",[258,1358,1359,1369,1390,1396,1404,1414,1424,1428,1435,1442,1452,1459,1472,1483,1490],{"__ignoreMap":278},[282,1360,1361,1364,1366],{"class":284,"line":285},[282,1362,1363],{"class":571},"name",[282,1365,343],{"class":326},[282,1367,1368],{"class":292}," Duplication\n",[282,1370,1371,1375,1377,1379,1382,1384,1387],{"class":284,"line":330},[282,1372,1374],{"class":1373},"sfNiH","on",[282,1376,343],{"class":326},[282,1378,346],{"class":326},[282,1380,1381],{"class":292},"push",[282,1383,356],{"class":326},[282,1385,1386],{"class":292}," pull_request",[282,1388,1389],{"class":326},"]\n",[282,1391,1392],{"class":284,"line":370},[282,1393,1395],{"emptyLinePlaceholder":1394},true,"\n",[282,1397,1398,1401],{"class":284,"line":392},[282,1399,1400],{"class":571},"permissions",[282,1402,1403],{"class":326},":\n",[282,1405,1406,1409,1411],{"class":284,"line":408},[282,1407,1408],{"class":571},"  contents",[282,1410,343],{"class":326},[282,1412,1413],{"class":292}," read\n",[282,1415,1416,1419,1421],{"class":284,"line":511},[282,1417,1418],{"class":571},"  security-events",[282,1420,343],{"class":326},[282,1422,1423],{"class":292}," write\n",[282,1425,1426],{"class":284,"line":517},[282,1427,1395],{"emptyLinePlaceholder":1394},[282,1429,1430,1433],{"class":284,"line":532},[282,1431,1432],{"class":571},"jobs",[282,1434,1403],{"class":326},[282,1436,1437,1440],{"class":284,"line":538},[282,1438,1439],{"class":571},"  jscpd",[282,1441,1403],{"class":326},[282,1443,1444,1447,1449],{"class":284,"line":553},[282,1445,1446],{"class":571},"    runs-on",[282,1448,343],{"class":326},[282,1450,1451],{"class":292}," ubuntu-latest\n",[282,1453,1454,1457],{"class":284,"line":621},[282,1455,1456],{"class":571},"    steps",[282,1458,1403],{"class":326},[282,1460,1461,1464,1467,1469],{"class":284,"line":691},[282,1462,1463],{"class":326},"      -",[282,1465,1466],{"class":571}," uses",[282,1468,343],{"class":326},[282,1470,1471],{"class":292}," actions\u002Fcheckout@v4\n",[282,1473,1474,1476,1478,1480],{"class":284,"line":697},[282,1475,1463],{"class":326},[282,1477,1466],{"class":571},[282,1479,343],{"class":326},[282,1481,1482],{"class":292}," kucherenko\u002Fjscpd@v5\n",[282,1484,1485,1488],{"class":284,"line":703},[282,1486,1487],{"class":571},"        with",[282,1489,1403],{"class":326},[282,1491,1492,1495,1497],{"class":284,"line":709},[282,1493,1494],{"class":571},"          reporters",[282,1496,343],{"class":326},[282,1498,1499],{"class":292}," console,sarif\n",[255,1501,1502,1503,1506,1507,1510],{},"With the binary in any workflow, upload the file yourself; ",[258,1504,1505],{},"if: always()"," uploads it when ",[258,1508,1509],{},"--threshold"," fails the step:",[272,1512,1514],{"className":1353,"code":1513,"filename":1355,"language":1356,"meta":278,"style":278},"      - run: jscpd . -r console,sarif --output report\n      - uses: github\u002Fcodeql-action\u002Fupload-sarif@v3\n        if: always()\n        with:\n          sarif_file: report\u002Fjscpd-report.sarif\n          category: jscpd\n",[258,1515,1516,1528,1539,1549,1555,1565],{"__ignoreMap":278},[282,1517,1518,1520,1523,1525],{"class":284,"line":285},[282,1519,1463],{"class":326},[282,1521,1522],{"class":571}," run",[282,1524,343],{"class":326},[282,1526,1527],{"class":292}," jscpd . -r console,sarif --output report\n",[282,1529,1530,1532,1534,1536],{"class":284,"line":330},[282,1531,1463],{"class":326},[282,1533,1466],{"class":571},[282,1535,343],{"class":326},[282,1537,1538],{"class":292}," github\u002Fcodeql-action\u002Fupload-sarif@v3\n",[282,1540,1541,1544,1546],{"class":284,"line":370},[282,1542,1543],{"class":571},"        if",[282,1545,343],{"class":326},[282,1547,1548],{"class":292}," always()\n",[282,1550,1551,1553],{"class":284,"line":392},[282,1552,1487],{"class":571},[282,1554,1403],{"class":326},[282,1556,1557,1560,1562],{"class":284,"line":408},[282,1558,1559],{"class":571},"          sarif_file",[282,1561,343],{"class":326},[282,1563,1564],{"class":292}," report\u002Fjscpd-report.sarif\n",[282,1566,1567,1570,1572],{"class":284,"line":511},[282,1568,1569],{"class":571},"          category",[282,1571,343],{"class":326},[282,1573,1574],{"class":292}," jscpd\n",[255,1576,1577],{},"Results appear under Security, Code scanning, and as annotations on pull request diffs.",[267,1579,1581],{"id":1580},"with-gates","With gates",[255,1583,1584,1585,1587,1588,343],{},"Every result is a ",[258,1586,471],{}," unless one of three things raises it to ",[258,1589,1590],{},"error",[1095,1592,1593,1606],{},[1098,1594,1595],{},[1101,1596,1597,1603],{},[1104,1598,1599,1600,1602],{},"Level ",[258,1601,1590],{}," when",[1104,1604,1605],{},"Flag",[1117,1607,1608,1622,1636],{},[1101,1609,1610,1613],{},[1122,1611,1612],{},"The clone is new against the baseline",[1122,1614,1615,1153,1618,1621],{},[258,1616,1617],{},"--baseline",[258,1619,1620],{},"--baseline-from-ref"," (5.1.0+)",[1101,1623,1624,1627],{},[1122,1625,1626],{},"The clone has at least N tokens",[1122,1628,1629,1632,1633,1635],{},[258,1630,1631],{},"--sarif-error-tokens N",", config ",[258,1634,397],{}," (5.0.15+)",[1101,1637,1638,1643],{},[1122,1639,1640,1641],{},"The duplication of the whole run is above the threshold; then every result is an ",[258,1642,1590],{},[1122,1644,1645,1647],{},[258,1646,1509],{},", the same strictly-greater comparison that fails the build",[255,1649,1650,1651,1654,1655,1658,1659,1662],{},"On the sample run, ",[258,1652,1653],{},"--sarif-error-tokens 150"," raises only the 197-token clone, and ",[258,1656,1657],{},"--threshold 5"," raises all three because the run has 17.7% duplication. ",[258,1660,1661],{},"--kind"," keeps only the kinds you name.",[267,1664,1666],{"id":1665},"options","Options",[1095,1668,1669,1678],{},[1098,1670,1671],{},[1101,1672,1673,1675],{},[1104,1674,1605],{},[1104,1676,1677],{},"Effect on the file",[1117,1679,1680,1696,1707,1723,1736,1751],{},[1101,1681,1682,1690],{},[1122,1683,1684,1149,1687],{},[258,1685,1686],{},"-o",[258,1688,1689],{},"--output",[1122,1691,1692,1693],{},"The directory of ",[258,1694,1695],{},"jscpd-report.sarif",[1101,1697,1698,1702],{},[1122,1699,1700],{},[258,1701,1631],{},[1122,1703,1599,1704,1706],{},[258,1705,1590],{}," from N tokens up",[1101,1708,1709,1717],{},[1122,1710,1711,1149,1714],{},[258,1712,1713],{},"-t",[258,1715,1716],{},"--threshold P",[1122,1718,1719,1720,1722],{},"Every result at level ",[258,1721,1590],{}," when the run is above P",[1101,1724,1725,1731],{},[1122,1726,1727,1149,1729],{},[258,1728,1617],{},[258,1730,1620],{},[1122,1732,1599,1733,1735],{},[258,1734,1590],{}," for new clones",[1101,1737,1738,1745],{},[1122,1739,1740,1149,1743],{},[258,1741,1742],{},"-b",[258,1744,1324],{},[1122,1746,1747,1748,1750],{},"Adds the ",[258,1749,1309],{}," property",[1101,1752,1753,1761],{},[1122,1754,1755,1149,1758],{},[258,1756,1757],{},"-a",[258,1759,1760],{},"--absolute",[1122,1762,1763],{},"Absolute paths in reports",[267,1765,1767],{"id":1766},"related","Related",[1769,1770,1771,1778,1787],"ul",{},[1772,1773,1774,1777],"li",{},[263,1775,1776],{"href":111},"Clone types"," for the kinds behind the rules and the flags that enable them.",[1772,1779,1780,1268,1783,1786],{},[263,1781,1782],{"href":36},"CI",[263,1784,1785],{"href":188},"the GitHub Action",".",[1772,1788,1789,1791],{},[263,1790,172],{"href":173}," for GitLab.",[1793,1794,1795],"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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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":278,"searchDepth":330,"depth":330,"links":1797},[1798,1799,1803,1804,1805,1806],{"id":269,"depth":330,"text":270},{"id":414,"depth":330,"text":415,"children":1800},[1801,1802],{"id":1075,"depth":370,"text":1076},{"id":959,"depth":370,"text":1230},{"id":1327,"depth":330,"text":1328},{"id":1580,"depth":330,"text":1581},{"id":1665,"depth":330,"text":1666},{"id":1766,"depth":330,"text":1767},"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.","md",null,{},{"icon":170},{"title":167,"description":1807},"baRAbUP5hmGAEWs9Al1oX5MxQU23bn9TAPyQJgOpLqg",[1815,1817],{"title":162,"path":163,"stem":164,"description":1816,"icon":165,"children":-1},"Two SVG badges with the duplication and the duplicated lines of a run, for a README.",{"title":172,"path":173,"stem":174,"description":1818,"icon":175,"children":-1},"GitLab Code Quality issues in the CodeClimate format, two per clone, so merge requests show duplication on the changed lines.",{"\u002Freference\u002Freporters\u002Fsarif":1820},{"views":1821,"visits":703},34,1795510272970]