[{"data":1,"prerenderedAt":732},["ShallowReactive",2],{"navigation_docs":3,"trending-repo-anthropics\u002Fclaude-code-action":249,"page-views-\u002Ftrending\u002Fanthropics\u002Fclaude-code-action":730},[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",{"name":250,"url":251,"appearances":252,"latest":268},"anthropics\u002Fclaude-code-action","https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fclaude-code-action",[253],{"date":254,"rank":255,"stars":256,"starsToday":257,"headSha":258,"sources":259,"lines":260,"clones":261,"duplicatedLines":262,"percentage":263,"codePercentage":264,"codeSources":265,"healthScore":266,"healthGrade":267},"2026-09-27",5,9130,31,"756cc22e19660d20e8cc9496b4f242475a7f7790",225,43244,202,3276,7.58,3.51,79,66.7,"C",{"date":254,"generatedAt":269,"name":250,"url":251,"description":270,"language":271,"stars":256,"starsToday":257,"defaultBranch":272,"headSha":258,"durationMs":273,"total":274,"formats":278,"topClones":329,"health":499,"complexity":531,"deadCode":578,"code":600,"measuredAt":728,"jscpdVersion":729},"2026-09-27T05:28:08.542Z","","TypeScript","main",68,{"sources":259,"lines":260,"tokens":275,"clones":261,"duplicatedLines":262,"duplicatedTokens":276,"percentage":263,"percentageTokens":277},212679,15592,7.33,[279,286,293,300,306,311,316,320,323,326],{"format":280,"sources":281,"lines":282,"clones":283,"duplicatedLines":284,"percentage":285},"typescript",120,30004,151,2401,8,{"format":287,"sources":288,"lines":289,"clones":290,"duplicatedLines":291,"percentage":292},"yaml",46,4386,42,521,11.88,{"format":294,"sources":295,"lines":296,"clones":297,"duplicatedLines":298,"percentage":299},"markdown",32,4622,6,271,5.86,{"format":301,"sources":302,"lines":303,"clones":304,"duplicatedLines":288,"percentage":305},"bash",16,981,1,4.69,{"format":307,"sources":304,"lines":308,"clones":304,"duplicatedLines":309,"percentage":310},"markup",744,9,1.21,{"format":312,"sources":297,"lines":313,"clones":304,"duplicatedLines":314,"percentage":315},"json",339,28,8.26,{"format":317,"sources":304,"lines":318,"clones":319,"duplicatedLines":319,"percentage":319},"python",1828,0,{"format":321,"sources":304,"lines":322,"clones":319,"duplicatedLines":319,"percentage":319},"perl",174,{"format":324,"sources":304,"lines":325,"clones":319,"duplicatedLines":319,"percentage":319},"javascript",162,{"format":327,"sources":304,"lines":328,"clones":319,"duplicatedLines":319,"percentage":319},"text",4,[330,350,377,405,424,439,452,467,480,488],{"format":294,"lines":331,"tokens":332,"first":333,"others":335,"copies":338,"excerpt":339,"kind":349},128,936,{"name":334,"start":304,"end":331},"CODE_OF_CONDUCT.md:markdown",[336],{"name":337,"start":304,"end":331},"base-action\u002FCODE_OF_CONDUCT.md:markdown",2,{"lines":340,"total":331},[341,270,342,270,343,344,345,346,347,348],"# Contributor Covenant Code of Conduct","## Our Pledge","We as members, contributors, and leaders pledge to make participation in our","community a harassment-free experience for everyone, regardless of age, body","size, visible or invisible disability, ethnicity, sex characteristics, gender","identity and expression, level of experience, education, socio-economic status,","nationality, personal appearance, race, religion, or sexual identity","and orientation.","docs",{"format":280,"lines":351,"tokens":352,"first":353,"others":357,"copies":338,"excerpt":361,"excerptSecond":372,"kind":376},69,298,{"name":354,"start":355,"end":356},"src\u002Fmcp\u002Fgithub-file-ops-server.ts",307,375,[358],{"name":354,"start":359,"end":360},468,536,{"lines":362,"total":351},[363,270,364,365,366,367,368,369,370,371],");","\u002F\u002F 4. Create a new tree","const treeUrl = `${GITHUB_API_URL}\u002Frepos\u002F${owner}\u002F${repo}\u002Fgit\u002Ftrees`;","const treeResponse = await fetch(treeUrl, {","  method: \"POST\",","  headers: {","    Accept: \"application\u002Fvnd.github+json\",","    Authorization: `Bearer ${githubToken}`,","    \"X-GitHub-Api-Version\": \"2022-11-28\",",{"lines":373,"total":351},[374,270,375,365,366,367,368,369,370,371],"}));","\u002F\u002F 4. Create a new tree with deletions","code",{"format":280,"lines":378,"tokens":379,"first":380,"others":384,"copies":391,"excerpt":392,"kind":404},23,121,{"name":381,"start":382,"end":383},"test\u002Fdata-fetcher.test.ts",1498,1520,[385,388],{"name":381,"start":386,"end":387},1609,1631,{"name":381,"start":389,"end":390},1645,1667,3,{"lines":393,"total":378},[394,395,396,397,398,399,400,401,402,403],"body: \"PR body\",","author: { login: \"author\" },","createdAt: \"2024-01-15T10:00:00Z\",","additions: 10,","deletions: 5,","state: \"OPEN\",","commits: { totalCount: 1, nodes: [] },","files: { nodes: [] },","comments: { nodes: [] },","reviews: { nodes: [] },","tests",{"format":287,"lines":285,"tokens":406,"first":407,"others":410,"copies":255,"kind":423},52,{"name":408,"start":378,"end":409},".github\u002Fworkflows\u002Ftest-structured-output.yml",30,[411,414,417,420],{"name":408,"start":412,"end":413},86,93,{"name":408,"start":415,"end":416},141,148,{"name":408,"start":418,"end":419},204,211,{"name":408,"start":421,"end":422},248,255,"data",{"format":280,"lines":425,"tokens":273,"first":426,"others":429,"copies":328,"kind":404},14,{"name":427,"start":259,"end":428},"test\u002Fimage-downloader.test.ts",238,[430,433,436],{"name":427,"start":431,"end":432},269,282,{"name":427,"start":434,"end":435},315,328,{"name":427,"start":437,"end":438},506,519,{"format":280,"lines":440,"tokens":441,"first":442,"others":446,"copies":391,"kind":404},20,94,{"name":443,"start":444,"end":445},"test\u002Fmodes\u002Fagent.test.ts",70,89,[447,450],{"name":443,"start":448,"end":449},135,155,{"name":443,"start":451,"end":422},236,{"format":280,"lines":453,"tokens":454,"first":455,"others":457,"copies":328,"kind":404},12,62,{"name":427,"start":456,"end":281},109,[458,461,464],{"name":427,"start":459,"end":460},661,671,{"name":427,"start":462,"end":463},737,747,{"name":427,"start":465,"end":466},1153,1163,{"format":280,"lines":468,"tokens":469,"first":470,"others":473,"copies":391,"kind":404},19,90,{"name":427,"start":471,"end":472},502,520,[474,477],{"name":427,"start":475,"end":476},624,642,{"name":427,"start":478,"end":479},663,681,{"format":287,"lines":481,"tokens":482,"first":483,"others":485,"copies":338,"kind":423},25,178,{"name":484,"start":304,"end":481},".github\u002Fworkflows\u002Fclaude.yml",[486],{"name":487,"start":304,"end":481},"examples\u002Fclaude.yml",{"format":287,"lines":489,"tokens":490,"first":491,"others":495,"copies":338,"kind":423},17,176,{"name":492,"start":493,"end":494},"action.yml",344,360,[496],{"name":497,"start":419,"end":498},"base-action\u002Faction.yml",227,{"score":266,"grade":267,"size":500,"dimensions":504},{"lines":501,"files":502,"class":503},33193,139,"M",[505,515,524],{"id":506,"source":507,"value":508,"adjusted":509,"lines":510,"halfLife":511,"formats":512,"excluded":513,"weight":304,"score":514},"duplication","jscpd",7.4,7.2,2447,8.5,[280,317,301,321,324],[307,327,423],55.8,{"id":516,"source":507,"value":517,"adjusted":518,"lines":519,"halfLife":520,"coverage":521,"weight":522,"score":523},"dead-code",0.5,0.7,171,7.5,96.9,0.969,93.9,{"id":525,"source":507,"value":526,"adjusted":527,"lines":528,"halfLife":529,"weight":304,"score":530},"complexity",41.4,40.3,13758,50,57.2,{"total":532,"mean":533,"files":534},3770,27.1,[535,539,544,548,552,557,561,565,569,573],{"path":536,"complexity":537,"lines":318,"bytes":538},"agent-approval-check\u002Fagent_approval_check.py",343,66769,{"path":540,"complexity":541,"lines":542,"bytes":543},"src\u002Fcreate-prompt\u002Findex.ts",188,1002,41724,{"path":545,"complexity":448,"lines":546,"bytes":547},"test\u002Fvalidate-branch-name.test.ts",264,11071,{"path":381,"complexity":549,"lines":550,"bytes":551},127,1960,64248,{"path":553,"complexity":554,"lines":555,"bytes":556},"src\u002Fentrypoints\u002Fformat-turns.ts",123,474,12877,{"path":558,"complexity":554,"lines":559,"bytes":560},"src\u002Fgithub\u002Fdata\u002Ffetcher.ts",662,21832,{"path":562,"complexity":351,"lines":563,"bytes":564},"base-action\u002Ftest\u002Fvalidate-env.test.ts",363,15525,{"path":566,"complexity":273,"lines":567,"bytes":568},"test\u002Fcreate-prompt.test.ts",1389,46180,{"path":570,"complexity":273,"lines":571,"bytes":572},"test\u002Fsanitizer.test.ts",545,19811,{"path":574,"complexity":575,"lines":576,"bytes":577},"src\u002Fgithub\u002Futils\u002Fimage-downloader.ts",66,385,11438,{"percentage":579,"findings":328,"files":580,"byCategory":581,"largest":586},0.53,125,[582,584],{"category":583,"count":304},"unused-file",{"category":585,"count":391},"unused-export",[587,589,594,597],{"category":583,"path":588,"name":270,"line":304,"lines":325},".claude\u002Fworkflows\u002Fpr-stamp-sweep.js",{"category":585,"path":590,"name":591,"line":592,"lines":593},"src\u002Fgithub\u002Fcontext.ts","isAutomationContext",305,7,{"category":585,"path":595,"name":596,"line":378,"lines":304},"src\u002Fmcp\u002Fgithub-file-ops-schemas.ts","commitFilesPayloadSchema",{"category":585,"path":595,"name":598,"line":599,"lines":304},"deleteFilesPayloadSchema",24,{"sources":265,"lines":601,"tokens":602,"clones":603,"duplicatedLines":604,"duplicatedTokens":605,"percentage":264,"percentageTokens":606,"formats":607,"topClones":617,"generated":726},13914,56507,21,488,1881,3.33,[608,613,614,615,616],{"format":280,"sources":609,"lines":610,"clones":440,"duplicatedLines":611,"percentage":612},60,10769,442,4.1,{"format":301,"sources":302,"lines":303,"clones":304,"duplicatedLines":288,"percentage":305},{"format":317,"sources":304,"lines":318,"clones":319,"duplicatedLines":319,"percentage":319},{"format":321,"sources":304,"lines":322,"clones":319,"duplicatedLines":319,"percentage":319},{"format":324,"sources":304,"lines":325,"clones":319,"duplicatedLines":319,"percentage":319},[618,626,649,668,677,684,694,702,710,719],{"format":280,"lines":351,"tokens":352,"first":619,"others":620,"copies":338,"excerpt":622,"excerptSecond":624,"kind":376},{"name":354,"start":355,"end":356},[621],{"name":354,"start":359,"end":360},{"lines":623,"total":351},[363,270,364,365,366,367,368,369,370,371],{"lines":625,"total":351},[374,270,375,365,366,367,368,369,370,371],{"format":280,"lines":440,"tokens":627,"first":628,"others":630,"copies":338,"excerpt":633,"excerptSecond":643,"kind":376},114,{"name":629,"start":309,"end":314},"src\u002Fgithub\u002Fvalidation\u002Factor.ts",[631],{"name":632,"start":391,"end":481},"src\u002Fgithub\u002Fvalidation\u002Fpermissions.ts",{"lines":634,"total":440},[635,270,636,637,638,639,270,640,641,642],"import type { GitHubContext } from \"..\u002Fcontext\";","function isAllowedBot(actor: string, allowedBots: string): boolean {","  const trimmed = allowedBots.trim();","  if (trimmed === \"*\") return true;","  if (!trimmed) return false;","  const allowedList = trimmed","    .split(\",\")","    .map((bot) =>",{"lines":644,"total":378},[645,270,646,647,648,636,637,638,639,270],"import type { Octokit } from \"@octokit\u002Frest\";","\u002F**"," * Check if a bot actor is in the allowed bots list."," *\u002F",{"format":280,"lines":257,"tokens":650,"first":651,"others":654,"copies":338,"excerpt":658,"kind":376},112,{"name":354,"start":652,"end":653},223,253,[655],{"name":354,"start":656,"end":657},433,463,{"lines":659,"total":257},[660,661,363,270,662,663,664,665,666,667],"    return { fullPath, relativePath };","  }),","\u002F\u002F 1. Get the branch reference (create if doesn't exist)","const baseSha = await getOrCreateBranchRef(","  owner,","  repo,","  branch,","  githubToken,",{"format":280,"lines":409,"tokens":669,"first":670,"others":673,"copies":338,"kind":376},103,{"name":354,"start":671,"end":672},378,407,[674],{"name":354,"start":675,"end":676},537,566,{"format":301,"lines":288,"tokens":678,"first":679,"others":681,"copies":338,"kind":376},102,{"name":680,"start":304,"end":288},"base-action\u002Fscripts\u002Fpre-push",[682],{"name":683,"start":304,"end":288},"scripts\u002Fpre-commit",{"format":280,"lines":599,"tokens":685,"first":686,"others":690,"copies":338,"kind":376},96,{"name":687,"start":688,"end":689},"src\u002Fmcp\u002Fgithub-comment-server.ts",78,101,[691],{"name":354,"start":692,"end":693},553,576,{"format":280,"lines":695,"tokens":441,"first":696,"others":700,"copies":338,"kind":376},29,{"name":697,"start":698,"end":699},"src\u002Fmcp\u002Fgithub-actions-server.ts",266,294,[701],{"name":687,"start":575,"end":413},{"format":280,"lines":440,"tokens":441,"first":703,"others":706,"copies":338,"kind":376},{"name":704,"start":409,"end":705},"src\u002Fmodes\u002Fagent\u002Findex.ts",49,[707],{"name":708,"start":709,"end":412},"src\u002Fmodes\u002Ftag\u002Findex.ts",67,{"format":280,"lines":711,"tokens":445,"first":712,"others":715,"copies":338,"kind":376},27,{"name":697,"start":713,"end":714},119,145,[716],{"name":697,"start":717,"end":718},186,213,{"format":280,"lines":720,"tokens":721,"first":722,"others":723,"copies":338,"kind":376},26,87,{"name":697,"start":281,"end":714},[724],{"name":697,"start":698,"end":725},292,{"files":319,"minified":319,"sample":727},[],"2026-10-07T06:27:22.240Z","5.4.0",{"\u002Ftrending\u002Fanthropics\u002Fclaude-code-action":731},{"views":309,"visits":255},1795510254708]