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