[{"data":1,"prerenderedAt":1797},["ShallowReactive",2],{"navigation_docs":3,"-guides-semantic-clones":197,"-guides-semantic-clones-surround":1792},[4,50,87,104,140,166,182,187,192],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35,40,45],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration","i-lucide-settings",{"title":26,"path":27,"stem":28,"icon":29},"Supported Formats","\u002Fgetting-started\u002Fsupported-formats","1.getting-started\u002F5.supported-formats","i-lucide-file-code",{"title":31,"path":32,"stem":33,"icon":34},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F6.agent-skill","i-lucide-cpu",{"title":36,"path":37,"stem":38,"icon":39},"Changelog","\u002Fgetting-started\u002Fchangelog","1.getting-started\u002F7.changelog","i-lucide-scroll-text",{"title":41,"path":42,"stem":43,"icon":44},"Migrating from v4 to v5","\u002Fgetting-started\u002Fmigration","1.getting-started\u002F8.migration","i-lucide-arrow-right-left",{"title":46,"path":47,"stem":48,"icon":49},"jscpd v4 (TypeScript)","\u002Fgetting-started\u002Fv4","1.getting-started\u002F9.v4","i-simple-icons-typescript",{"title":51,"path":52,"stem":53,"children":54,"icon":6},"Guides","\u002Fguides","2.guides\u002F1.index",[55,57,62,67,72,77,82],{"title":51,"path":52,"stem":53,"icon":56},"i-lucide-book-open",{"title":58,"path":59,"stem":60,"icon":61},"Types of Code Clones","\u002Fguides\u002Fclone-types","2.guides\u002F2.clone-types","i-lucide-copy",{"title":63,"path":64,"stem":65,"icon":66},"How Detection Works","\u002Fguides\u002Fhow-detection-works","2.guides\u002F3.how-detection-works","i-lucide-scan-search",{"title":68,"path":69,"stem":70,"icon":71},"Duplication Trend over Git History","\u002Fguides\u002Fhistory","2.guides\u002F4.history","i-lucide-chart-no-axes-combined",{"title":73,"path":74,"stem":75,"icon":76},"Project Dashboard","\u002Fguides\u002Fdashboard","2.guides\u002F5.dashboard","i-lucide-layout-dashboard",{"title":78,"path":79,"stem":80,"icon":81},"Project Health Score","\u002Fguides\u002Fhealth","2.guides\u002F6.health","i-lucide-heart-pulse",{"title":83,"path":84,"stem":85,"icon":86},"Semantic Clones","\u002Fguides\u002Fsemantic-clones","2.guides\u002F7.semantic-clones","i-lucide-brain-circuit",{"title":88,"path":89,"stem":90,"children":91,"icon":6},"CI & Hooks","\u002Fci-and-hooks","3.ci-and-hooks\u002F1.index",[92,94,99],{"title":88,"path":89,"stem":90,"icon":93},"i-lucide-git-pull-request",{"title":95,"path":96,"stem":97,"icon":98},"Use jscpd in CI","\u002Fci-and-hooks\u002Fci","3.ci-and-hooks\u002F2.ci","i-lucide-github",{"title":100,"path":101,"stem":102,"icon":103},"Use jscpd in Pre-Commit Hook","\u002Fci-and-hooks\u002Fpre-commit","3.ci-and-hooks\u002F3.pre-commit","i-lucide-git-commit",{"title":105,"path":106,"stem":107,"children":108,"icon":110},"Reporters","\u002Freporters","4.reporters\u002F1.index",[109,111,115,120,125,130,135],{"title":105,"path":106,"stem":107,"icon":110},"i-lucide-file-chart-column",{"title":112,"path":113,"stem":114,"icon":29},"HTML Reporter","\u002Freporters\u002Fhtml","4.reporters\u002F2.html",{"title":116,"path":117,"stem":118,"icon":119},"JSON Reporter","\u002Freporters\u002Fjson","4.reporters\u002F3.json","i-lucide-braces",{"title":121,"path":122,"stem":123,"icon":124},"Badge Reporter","\u002Freporters\u002Fbadge","4.reporters\u002F4.badge","i-lucide-award",{"title":126,"path":127,"stem":128,"icon":129},"SARIF Reporter","\u002Freporters\u002Fsarif","4.reporters\u002F5.sarif","i-lucide-shield-check",{"title":131,"path":132,"stem":133,"icon":134},"CodeClimate \u002F GitLab Reporter","\u002Freporters\u002Fcodeclimate","4.reporters\u002F6.codeclimate","i-lucide-flag-triangle-right",{"title":136,"path":137,"stem":138,"icon":139},"OpenMetrics Reporter","\u002Freporters\u002Fopenmetrics","4.reporters\u002F7.openmetrics","i-lucide-activity",{"title":141,"path":142,"stem":143,"children":144,"icon":6},"Benchmarks","\u002Fbenchmarks","5.benchmarks\u002F1.index",[145,147,152,157,162],{"title":141,"path":142,"stem":143,"icon":146},"i-lucide-gauge",{"title":148,"path":149,"stem":150,"icon":151},"Detection Speed","\u002Fbenchmarks\u002Fdetection-speed","5.benchmarks\u002F2.detection-speed","i-lucide-zap",{"title":153,"path":154,"stem":155,"icon":156},"Multi-Format Detection","\u002Fbenchmarks\u002Fcross-format","5.benchmarks\u002F3.cross-format","i-lucide-layers",{"title":158,"path":159,"stem":160,"icon":161},"AI Token Efficiency","\u002Fbenchmarks\u002Fai-token-efficiency","5.benchmarks\u002F4.ai-token-efficiency","i-lucide-sparkles",{"title":163,"path":164,"stem":165,"icon":86},"Embedding Models","\u002Fbenchmarks\u002Fembedding-models","5.benchmarks\u002F5.embedding-models",{"title":167,"path":168,"stem":169,"children":170,"icon":172},"API","\u002Fapi","6.api\u002F1.index",[171,173,178],{"title":167,"path":168,"stem":169,"icon":172},"i-lucide-code",{"title":174,"path":175,"stem":176,"icon":177},"Rust Crates (v5)","\u002Fapi\u002Fcore","6.api\u002F2.core","i-lucide-box",{"title":179,"path":180,"stem":181,"icon":177},"MCP Server","\u002Fapi\u002Fmcp-server","6.api\u002F4.mcp-server",{"title":183,"path":184,"stem":185,"icon":186},"Trending","\u002Ftrending","7.trending","i-lucide-trending-up",{"title":188,"path":189,"stem":190,"icon":191},"Research","\u002Fresearch","8.research","i-lucide-graduation-cap",{"title":193,"path":194,"stem":195,"icon":196},"Articles","\u002Farticles","9.articles","i-lucide-newspaper",{"id":198,"title":83,"body":199,"description":1783,"extension":1784,"links":1785,"meta":1786,"navigation":1787,"path":84,"seo":1788,"stem":85,"__hash__":1791},"docs\u002F2.guides\u002F7.semantic-clones.md",{"type":200,"value":201,"toc":1761},"minimark",[202,221,230,235,276,287,290,298,310,314,317,333,342,346,351,358,378,389,393,403,437,441,444,469,478,482,500,559,563,569,656,669,673,680,686,703,706,734,737,741,751,760,820,830,869,875,881,891,894,921,928,931,943,987,994,998,1008,1061,1092,1096,1118,1121,1125,1129,1342,1346,1364,1506,1674,1677,1681,1725,1729,1757],[203,204,205,206,211,212,216,217,220],"p",{},"Token matching finds code that someone copied. It cannot find two functions that do the same job with different code, such as a validation rule that a Rust backend enforces and a Svelte frontend repeats, or two helpers that two people wrote for the same task. These are ",[207,208,210],"a",{"href":209},"\u002Fguides\u002Fclone-types#type-4-semantic-clones","Type-4 clones",". ",[213,214,215],"code",{},"--semantic"," looks for them with a code embedding model. jscpd turns every function into a vector and reports two functions as a clone of kind ",[213,218,219],{},"semantic"," when their vectors point the same way.",[222,223,224,225,229],"note",{},"Available from jscpd ",[226,227,228],"strong",{},"5.3.3"," and experimental. Besides real duplicates it reports related code, such as a client function and the server endpoint it calls, so review a pair before you merge two functions.",[231,232,234],"h2",{"id":233},"quick-start","Quick start",[236,237,243],"pre",{"className":238,"code":239,"filename":240,"language":241,"meta":242,"style":242},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd --semantic-download     # once: fetches the model, 548 MB, into the jscpd cache\njscpd --semantic src\u002F         # pairs within one language and across languages\n","Terminal","bash","",[213,244,245,262],{"__ignoreMap":242},[246,247,250,254,258],"span",{"class":248,"line":249},"line",1,[246,251,253],{"class":252},"sBMFI","jscpd",[246,255,257],{"class":256},"sfazB"," --semantic-download",[246,259,261],{"class":260},"sHwdD","     # once: fetches the model, 548 MB, into the jscpd cache\n",[246,263,265,267,270,273],{"class":248,"line":264},2,[246,266,253],{"class":252},[246,268,269],{"class":256}," --semantic",[246,271,272],{"class":256}," src\u002F",[246,274,275],{"class":260},"         # pairs within one language and across languages\n",[203,277,278,279,282,283,286],{},"The model runs inside jscpd on the CPU, so a scan makes no network call. The first scan embeds every function; later scans take the vectors of unchanged functions from the cache. jscpd reads the functions of JavaScript, TypeScript, JSX, TSX, Vue, Svelte, Astro, Python, Rust, Go, Java, Kotlin, C#, C, C++, PHP, Ruby, Scala and Swift files that clear ",[213,280,281],{},"--min-tokens"," and ",[213,284,285],{},"--min-lines",".",[203,288,289],{},"A pair appears in the same report as the token clones:",[236,291,296],{"className":292,"code":294,"language":295},[293],"language-text","Clone found (rust, semantic ~0.73)\n - backend\u002Fsrc\u002Fpricing.rs [34:1 - 58:2] (25 lines, 174 tokens)\n   frontend\u002Fsrc\u002Flib\u002Fcomponents\u002FCartSummary.svelte:typescript [19:3 - 31:4]\n","text",[213,297,294],{"__ignoreMap":242},[203,299,300,301,309],{},"To try it on a ready-made project, run it on ",[207,302,306],{"href":303,"rel":304},"https:\u002F\u002Fgithub.com\u002Fkucherenko\u002Fjscpd\u002Ftree\u002Fmaster\u002Ffixtures\u002Fsemantic-demo",[305],"nofollow",[213,307,308],{},"fixtures\u002Fsemantic-demo",": a Rust API and a SvelteKit frontend with eight rules written on both sides and two features written twice in one language.",[231,311,313],{"id":312},"how-jscpd-pairs-two-functions","How jscpd pairs two functions",[203,315,316],{},"jscpd embeds each function's code without comments, starting at the name the function is declared under. It then reports two functions as a pair when all of these hold:",[318,319,320,324,327,330],"ul",{},[321,322,323],"li",{},"They are in different files, neither calls the other, and the clones the token passes already found do not cover both. A function and the helper it calls are related, not duplicated.",[321,325,326],{},"Each is the other's closest match among the functions of its language, or close to it. A feature written three times makes three pairs, while a function that resembles many others, such as a request handler, pairs once per language at most.",[321,328,329],{},"Their similarity reaches the threshold: one for a pair across languages and a higher one for two functions of one language, because code in one language resembles other code in that language whatever it does.",[321,331,332],{},"The similarity stands at least 3 standard deviations above each function's similarity to the rest of the other function's language, so a family of generated look-alikes does not pair with itself.",[203,334,335,282,338,341],{},[213,336,337],{},"--skip-local",[213,339,340],{},"--skip-isolated"," apply to semantic pairs as they do to token clones.",[231,343,345],{"id":344},"ways-to-use-it","Ways to use it",[347,348,350],"h3",{"id":349},"the-same-feature-written-twice-in-one-language","The same feature written twice in one language",[203,352,353,354,357],{},"Two people solve one problem their own way, and the code base ends up with two slug functions or two e-mail checks. ",[213,355,356],{},"--semantic-scope same"," keeps only the pairs within one language:",[236,359,361],{"className":238,"code":360,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic --semantic-scope same src\u002F\n",[213,362,363],{"__ignoreMap":242},[246,364,365,367,369,372,375],{"class":248,"line":249},[246,366,253],{"class":252},[246,368,269],{"class":256},[246,370,371],{"class":256}," --semantic-scope",[246,373,374],{"class":256}," same",[246,376,377],{"class":256}," src\u002F\n",[203,379,380,381,384,385,286],{},"The bar within one language is higher on purpose. If you know a pair of duplicates that the report leaves out, look at its score and lower ",[213,382,383],{},"--semantic-same-threshold"," a little, as described in ",[207,386,388],{"href":387},"#thresholds","Thresholds",[347,390,392],{"id":391},"a-rule-repeated-across-a-backend-and-a-frontend","A rule repeated across a backend and a frontend",[203,394,395,396,399,400,402],{},"A project with a Rust or Python backend and a TypeScript or Svelte frontend often checks the same rule on both sides. ",[213,397,398],{},"--semantic-scope cross"," keeps only the pairs across languages. When the two halves live in their own folders, scanning them as two paths with ",[213,401,337],{}," keeps only the pairs that cross from one folder to the other:",[236,404,406],{"className":238,"code":405,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic --semantic-scope cross .\njscpd --semantic --skip-local backend\u002F frontend\u002F\n",[213,407,408,422],{"__ignoreMap":242},[246,409,410,412,414,416,419],{"class":248,"line":249},[246,411,253],{"class":252},[246,413,269],{"class":256},[246,415,371],{"class":256},[246,417,418],{"class":256}," cross",[246,420,421],{"class":256}," .\n",[246,423,424,426,428,431,434],{"class":248,"line":264},[246,425,253],{"class":252},[246,427,269],{"class":256},[246,429,430],{"class":256}," --skip-local",[246,432,433],{"class":256}," backend\u002F",[246,435,436],{"class":256}," frontend\u002F\n",[347,438,440],{"id":439},"code-ported-to-another-language","Code ported to another language",[203,442,443],{},"When a library exists in two languages, or a service is moving from one language to another, the pairs across languages show which functions have a counterpart on the other side:",[236,445,447],{"className":238,"code":446,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic --skip-local --kind semantic python\u002F rust\u002F\n",[213,448,449],{"__ignoreMap":242},[246,450,451,453,455,457,460,463,466],{"class":248,"line":249},[246,452,253],{"class":252},[246,454,269],{"class":256},[246,456,430],{"class":256},[246,458,459],{"class":256}," --kind",[246,461,462],{"class":256}," semantic",[246,464,465],{"class":256}," python\u002F",[246,467,468],{"class":256}," rust\u002F\n",[203,470,471,472,474,475,477],{},"A function without a counterpart does not appear in the report. jscpd does not embed functions smaller than ",[213,473,281],{}," or ",[213,476,285],{},", so lower those two for a code base with many short functions.",[347,479,481],{"id":480},"only-semantic-clones-for-an-agent-or-a-script","Only semantic clones, for an agent or a script",[203,483,484,487,488,491,492,495,496,499],{},[213,485,486],{},"--kind semantic"," keeps only the semantic pairs. The ",[213,489,490],{},"ai"," reporter prints one line per pair, and JSON marks each pair with ",[213,493,494],{},"\"kind\": \"semantic\""," and its ",[213,497,498],{},"\"similarity\"",":",[236,501,503],{"className":238,"code":502,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic --kind semantic -r ai src\u002F\n# backend\u002Fsrc\u002Fpricing.rs:34-58 ~ frontend\u002Fsrc\u002Flib\u002Fcomponents\u002FCartSummary.svelte:typescript:19-31 [~0.73 semantic]\n\njscpd --semantic --kind semantic -r json -o report src\u002F\n",[213,504,505,523,528,535],{"__ignoreMap":242},[246,506,507,509,511,513,515,518,521],{"class":248,"line":249},[246,508,253],{"class":252},[246,510,269],{"class":256},[246,512,459],{"class":256},[246,514,462],{"class":256},[246,516,517],{"class":256}," -r",[246,519,520],{"class":256}," ai",[246,522,377],{"class":256},[246,524,525],{"class":248,"line":264},[246,526,527],{"class":260},"# backend\u002Fsrc\u002Fpricing.rs:34-58 ~ frontend\u002Fsrc\u002Flib\u002Fcomponents\u002FCartSummary.svelte:typescript:19-31 [~0.73 semantic]\n",[246,529,531],{"class":248,"line":530},3,[246,532,534],{"emptyLinePlaceholder":533},true,"\n",[246,536,538,540,542,544,546,548,551,554,557],{"class":248,"line":537},4,[246,539,253],{"class":252},[246,541,269],{"class":256},[246,543,459],{"class":256},[246,545,462],{"class":256},[246,547,517],{"class":256},[246,549,550],{"class":256}," json",[246,552,553],{"class":256}," -o",[246,555,556],{"class":256}," report",[246,558,377],{"class":256},[347,560,562],{"id":561},"in-ci","In CI",[203,564,565,566,499],{},"The model download is 548 MB, so keep the jscpd cache between runs. The cache also holds the vectors, and with it a run embeds only the functions that changed. On a Linux runner the cache is ",[213,567,568],{},"~\u002F.cache\u002Fjscpd",[236,570,575],{"className":571,"code":572,"filename":573,"language":574,"meta":242,"style":242},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","- uses: actions\u002Fcache@v4\n  with:\n    path: ~\u002F.cache\u002Fjscpd\n    key: jscpd-${{ runner.os }}-${{ github.run_id }}\n    restore-keys: jscpd-${{ runner.os }}-\n- run: npx jscpd --semantic-download\n- run: npx jscpd --semantic --kind semantic -r ai src\u002F\n",".github\u002Fworkflows\u002Fsemantic.yml","yaml",[213,576,577,592,600,610,620,631,644],{"__ignoreMap":242},[246,578,579,583,587,589],{"class":248,"line":249},[246,580,582],{"class":581},"sMK4o","-",[246,584,586],{"class":585},"swJcz"," uses",[246,588,499],{"class":581},[246,590,591],{"class":256}," actions\u002Fcache@v4\n",[246,593,594,597],{"class":248,"line":264},[246,595,596],{"class":585},"  with",[246,598,599],{"class":581},":\n",[246,601,602,605,607],{"class":248,"line":530},[246,603,604],{"class":585},"    path",[246,606,499],{"class":581},[246,608,609],{"class":256}," ~\u002F.cache\u002Fjscpd\n",[246,611,612,615,617],{"class":248,"line":537},[246,613,614],{"class":585},"    key",[246,616,499],{"class":581},[246,618,619],{"class":256}," jscpd-${{ runner.os }}-${{ github.run_id }}\n",[246,621,623,626,628],{"class":248,"line":622},5,[246,624,625],{"class":585},"    restore-keys",[246,627,499],{"class":581},[246,629,630],{"class":256}," jscpd-${{ runner.os }}-\n",[246,632,634,636,639,641],{"class":248,"line":633},6,[246,635,582],{"class":581},[246,637,638],{"class":585}," run",[246,640,499],{"class":581},[246,642,643],{"class":256}," npx jscpd --semantic-download\n",[246,645,647,649,651,653],{"class":248,"line":646},7,[246,648,582],{"class":581},[246,650,638],{"class":585},[246,652,499],{"class":581},[246,654,655],{"class":256}," npx jscpd --semantic --kind semantic -r ai src\u002F\n",[203,657,658,661,662,282,665,668],{},[213,659,660],{},"--semantic-download"," does nothing when the model is already in the cache. Semantic clones count in the statistics like any clone, so ",[213,663,664],{},"--threshold",[213,666,667],{},"--exit-code"," see them. While the mode is experimental, keep it out of the step that fails the build on duplication and run it as a report of its own.",[231,670,672],{"id":671},"choosing-a-model","Choosing a model",[203,674,675,676,679],{},"Each model scores similarity on its own scale: two functions that one model scores 0.9 another scores 0.5. jscpd keeps calibrated thresholds for nine models, and ",[213,677,678],{},"jscpd --semantic-models"," lists them:",[236,681,684],{"className":682,"code":683,"language":295},[293],"MODEL                         CROSS   SAME    LICENSE       RUNS\nCodeRankEmbed (default)       0.4125  0.6375  MIT           in jscpd, 548 MB\njina-embeddings-v2-base-code  0.6     0.75    Apache-2.0    in jscpd, 324 MB\njina-code-embeddings-0.5b     0.5625  0.7125  CC-BY-NC-4.0  API\nQwen3-Embedding-0.6B          0.5875  0.7625  Apache-2.0    API (Ollama: qwen3-embedding:0.6b)\nSFR-Embedding-Code-400M_R     0.7375  0.8375  CC-BY-NC-4.0  API\ngte-modernbert-base           0.6875  0.85    Apache-2.0    API\ncodesage-small-v2             0.3125  0.5625  Apache-2.0    API\ngranite-embedding-english-r2  0.8625  0.925   Apache-2.0    API\nbge-m3                        0.7     0.8375  MIT           API (Ollama: bge-m3)\n",[213,685,683],{"__ignoreMap":242},[203,687,688,691,692,695,696,699,700,702],{},[213,689,690],{},"CROSS"," is the default threshold for a pair across languages and ",[213,693,694],{},"SAME"," the one for a pair within one language. ",[213,697,698],{},"--semantic-model"," takes a name from the list, its Hugging Face id or its Ollama name, in any letter case, and the thresholds follow the model. ",[207,701,163],{"href":164}," compares the nine models.",[203,704,705],{},"jscpd runs the first two models itself. CodeRankEmbed, the default, found the most real duplicates in the comparison. jina-embeddings-v2-base-code is faster. jscpd's demo takes 6 seconds with it and 8 with CodeRankEmbed.",[236,707,709],{"className":238,"code":708,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic-download jina-embeddings-v2-base-code\njscpd --semantic --semantic-model jina-embeddings-v2-base-code src\u002F\n",[213,710,711,720],{"__ignoreMap":242},[246,712,713,715,717],{"class":248,"line":249},[246,714,253],{"class":252},[246,716,257],{"class":256},[246,718,719],{"class":256}," jina-embeddings-v2-base-code\n",[246,721,722,724,726,729,732],{"class":248,"line":264},[246,723,253],{"class":252},[246,725,269],{"class":256},[246,727,728],{"class":256}," --semantic-model",[246,730,731],{"class":256}," jina-embeddings-v2-base-code",[246,733,377],{"class":256},[203,735,736],{},"The other seven need an embeddings API. jina-code-embeddings-0.5b and SFR-Embedding-Code-400M_R are licensed for non-commercial use only.",[231,738,740],{"id":739},"using-an-embeddings-api","Using an embeddings API",[203,742,743,746,747,750],{},[213,744,745],{},"--semantic-url"," sends the functions to a server that speaks the OpenAI embeddings API instead of running the model in jscpd: Ollama, LM Studio, ",[213,748,749],{},"llama-server --embedding",", text-embeddings-inference or a hosted API. The server gets the model name as typed, so give the name the server knows.",[203,752,753,754,759],{},"With ",[207,755,758],{"href":756,"rel":757},"https:\u002F\u002Follama.com",[305],"Ollama",", the default model of an API is jina-embeddings-v2-base-code under its Ollama name, because Ollama's library has no copy of CodeRankEmbed:",[236,761,763],{"className":238,"code":762,"filename":240,"language":241,"meta":242,"style":242},"ollama pull unclemusclez\u002Fjina-embeddings-v2-base-code\njscpd --semantic --semantic-url http:\u002F\u002Flocalhost:11434\u002Fv1 src\u002F\n\nollama pull qwen3-embedding:0.6b\njscpd --semantic --semantic-url http:\u002F\u002Flocalhost:11434\u002Fv1 --semantic-model qwen3-embedding:0.6b src\u002F\n",[213,764,765,776,790,794,803],{"__ignoreMap":242},[246,766,767,770,773],{"class":248,"line":249},[246,768,769],{"class":252},"ollama",[246,771,772],{"class":256}," pull",[246,774,775],{"class":256}," unclemusclez\u002Fjina-embeddings-v2-base-code\n",[246,777,778,780,782,785,788],{"class":248,"line":264},[246,779,253],{"class":252},[246,781,269],{"class":256},[246,783,784],{"class":256}," --semantic-url",[246,786,787],{"class":256}," http:\u002F\u002Flocalhost:11434\u002Fv1",[246,789,377],{"class":256},[246,791,792],{"class":248,"line":530},[246,793,534],{"emptyLinePlaceholder":533},[246,795,796,798,800],{"class":248,"line":537},[246,797,769],{"class":252},[246,799,772],{"class":256},[246,801,802],{"class":256}," qwen3-embedding:0.6b\n",[246,804,805,807,809,811,813,815,818],{"class":248,"line":622},[246,806,253],{"class":252},[246,808,269],{"class":256},[246,810,784],{"class":256},[246,812,787],{"class":256},[246,814,728],{"class":256},[246,816,817],{"class":256}," qwen3-embedding:0.6b",[246,819,377],{"class":256},[203,821,822,823,826,827,829],{},"A hosted API needs a key. jscpd reads it only from the ",[213,824,825],{},"JSCPD_SEMANTIC_API_KEY"," environment variable and sends it only to a URL given with ",[213,828,745],{}," or to a server on this machine, and never over plain http to another machine. With OpenAI:",[236,831,833],{"className":238,"code":832,"filename":240,"language":241,"meta":242,"style":242},"JSCPD_SEMANTIC_API_KEY=sk-… jscpd --semantic --semantic-url https:\u002F\u002Fapi.openai.com\u002Fv1 \\\n  --semantic-model text-embedding-3-small src\u002F\n",[213,834,835,859],{"__ignoreMap":242},[246,836,837,840,843,846,849,851,853,856],{"class":248,"line":249},[246,838,825],{"class":839},"sTEyZ",[246,841,842],{"class":581},"=",[246,844,845],{"class":256},"sk-…",[246,847,848],{"class":252}," jscpd",[246,850,269],{"class":256},[246,852,784],{"class":256},[246,854,855],{"class":256}," https:\u002F\u002Fapi.openai.com\u002Fv1",[246,857,858],{"class":839}," \\\n",[246,860,861,864,867],{"class":248,"line":264},[246,862,863],{"class":256},"  --semantic-model",[246,865,866],{"class":256}," text-embedding-3-small",[246,868,377],{"class":256},[203,870,871,872,874],{},"OpenAI's models are not in the list of calibrated models, so jscpd uses 0.6 and 0.75 for them and warns that these thresholds are not calibrated. See ",[207,873,388],{"href":387}," for how to set your own.",[203,876,877,878,286],{},"With an API, the code of every function goes to that API. When the code must not leave the machine, use the model that runs in jscpd, or run the API on the machine itself, like Ollama on ",[213,879,880],{},"localhost",[203,882,883,884,887,888,890],{},"A config file can arrive with the code being scanned, for example in a pull request, so it cannot send that code or your key anywhere on its own. A ",[213,885,886],{},"url"," in the config file that is not on this machine is used only when ",[213,889,215],{}," itself is on the command line, and it never receives the key.",[203,892,893],{},"Three config keys matter only for some APIs and models:",[318,895,896,902,908],{},[321,897,898,901],{},[213,899,900],{},"dimensions"," asks the API for shorter vectors. That works with models trained for it, such as OpenAI's text-embedding-3 models and jina-code-embeddings-0.5b. When a server ignores the setting and sends the full vector, jscpd cuts it to that length.",[321,903,904,907],{},[213,905,906],{},"params"," go into every request as they are, for an API that needs more than the model name.",[321,909,910,913,914,916,917,920],{},[213,911,912],{},"prefix"," is the text jscpd puts before every function. Qwen3-Embedding-0.6B and jina-code-embeddings-0.5b get the instruction they were calibrated with. Set ",[213,915,912],{}," for another model that expects one, or to ",[213,918,919],{},"\"\""," when the API adds the instruction itself.",[203,922,923,924,927],{},"If the server cannot be reached, the model is missing or the key is rejected, the run fails with exit code 1 and a hint, such as the ",[213,925,926],{},"ollama pull"," command to run. It never reports such a run as a clean scan.",[231,929,388],{"id":930},"thresholds",[203,932,933,936,937,939,940,942],{},[213,934,935],{},"--semantic-threshold"," is the lowest similarity of a pair across languages, and ",[213,938,383],{}," the lowest similarity of a pair within one language. Both default to the calibrated values of the model: 0.4125 and 0.6375 for CodeRankEmbed. When you set only ",[213,941,935],{},", the bar within one language keeps the model's gap above it: 0.225 for CodeRankEmbed, 0.15 for a model jscpd has not calibrated.",[236,944,946],{"className":238,"code":945,"filename":240,"language":241,"meta":242,"style":242},"jscpd --semantic --semantic-threshold 0.5 src\u002F                                 # stricter; 0.725 within one language\njscpd --semantic --semantic-threshold 0.5 --semantic-same-threshold 0.7 src\u002F   # a bar for each kind of pair\n",[213,947,948,966],{"__ignoreMap":242},[246,949,950,952,954,957,961,963],{"class":248,"line":249},[246,951,253],{"class":252},[246,953,269],{"class":256},[246,955,956],{"class":256}," --semantic-threshold",[246,958,960],{"class":959},"sbssI"," 0.5",[246,962,272],{"class":256},[246,964,965],{"class":260},"                                 # stricter; 0.725 within one language\n",[246,967,968,970,972,974,976,979,982,984],{"class":248,"line":264},[246,969,253],{"class":252},[246,971,269],{"class":256},[246,973,956],{"class":256},[246,975,960],{"class":959},[246,977,978],{"class":256}," --semantic-same-threshold",[246,980,981],{"class":959}," 0.7",[246,983,272],{"class":256},[246,985,986],{"class":260},"   # a bar for each kind of pair\n",[203,988,989,990,993],{},"To set thresholds for a model jscpd does not know, run it on code where you know a few real pairs, read their ",[213,991,992],{},"similarity"," in the JSON report, and set both thresholds a little below them. Scores are comparable only within one model, so a threshold tuned for one model says nothing about another.",[231,995,997],{"id":996},"the-vector-cache","The vector cache",[203,999,1000,1001,282,1004,1007],{},"jscpd caches the vectors, keyed by the model, its settings and the function's text, so a change to a comment embeds nothing. Each set of scanned paths has its own cache folder, so ",[213,1002,1003],{},"jscpd .",[213,1005,1006],{},"jscpd src"," keep separate files. When the vectors of changed and deleted functions make up more than a quarter of a file, the next run that embeds something rewrites the file without them.",[1009,1010,1011,1024],"table",{},[1012,1013,1014],"thead",{},[1015,1016,1017,1021],"tr",{},[1018,1019,1020],"th",{},"System",[1018,1022,1023],{},"Cache directory",[1025,1026,1027,1038,1051],"tbody",{},[1015,1028,1029,1033],{},[1030,1031,1032],"td",{},"macOS",[1030,1034,1035],{},[213,1036,1037],{},"~\u002FLibrary\u002FCaches\u002Fjscpd",[1015,1039,1040,1043],{},[1030,1041,1042],{},"Linux",[1030,1044,1045,1048,1049],{},[213,1046,1047],{},"$XDG_CACHE_HOME\u002Fjscpd",", or ",[213,1050,568],{},[1015,1052,1053,1056],{},[1030,1054,1055],{},"Windows",[1030,1057,1058],{},[213,1059,1060],{},"%LOCALAPPDATA%\\jscpd\\cache",[203,1062,1063,1066,1067,1070,1071,1074,1075,1078,1079,1082,1083,1085,1086,1088,1089,1091],{},[213,1064,1065],{},"JSCPD_CACHE_DIR"," moves the cache elsewhere. The ",[213,1068,1069],{},"models"," folder holds the downloaded models and the ",[213,1072,1073],{},"embeddings"," folder the vectors. ",[213,1076,1077],{},"--semantic-rebuild-cache"," embeds every function again and replaces the cached vectors of the scanned paths, and ",[213,1080,1081],{},"\"cache\": false"," in the config file turns the vector cache off. To free the space, delete the ",[213,1084,1073],{}," folder; deleting ",[213,1087,1069],{}," means ",[213,1090,660],{}," has to fetch the model again.",[231,1093,1095],{"id":1094},"what-it-does-not-do","What it does not do",[203,1097,1098,1099,1102,1103,1102,1106,1102,1109,282,1112,1115,1116,286],{},"jscpd compares whole functions only, so it does not embed top-level code, templates or styles. Only the clone scan embeds: ",[213,1100,1101],{},"--history",", ",[213,1104,1105],{},"--dashboard",[213,1107,1108],{},"--health",[213,1110,1111],{},"--complexity",[213,1113,1114],{},"--mcp"," ignore ",[213,1117,215],{},[203,1119,1120],{},"A score says that two functions look alike to the model, and it cannot tell whether they behave alike. Related code, such as a client call and the endpoint it calls or a route and its test, shows up next to real duplicates.",[231,1122,1124],{"id":1123},"options","Options",[347,1126,1128],{"id":1127},"command-line","Command line",[1009,1130,1131,1144],{},[1012,1132,1133],{},[1015,1134,1135,1138,1141],{},[1018,1136,1137],{},"Option",[1018,1139,1140],{},"Description",[1018,1142,1143],{},"Default",[1025,1145,1146,1158,1181,1206,1221,1238,1263,1274,1293,1317,1330],{},[1015,1147,1148,1152,1155],{},[1030,1149,1150],{},[213,1151,215],{},[1030,1153,1154],{},"Find semantic clones (Type-4, experimental)",[1030,1156,1157],{},"off",[1015,1159,1160,1165,1178],{},[1030,1161,1162],{},[213,1163,1164],{},"--semantic-download [MODEL]",[1030,1166,1167,1168,1171,1172,1174,1175,1177],{},"Download a model jscpd runs itself into the cache directory, checked against its pinned SHA-256: ",[213,1169,1170],{},"MODEL",", the one ",[213,1173,698],{}," names, or CodeRankEmbed. Alone it exits after the download; with ",[213,1176,215],{}," it goes on to scan with that model",[1030,1179,1180],{},"—",[1015,1182,1183,1188,1202],{},[1030,1184,1185],{},[213,1186,1187],{},"--semantic-scope",[1030,1189,1190,1191,1102,1194,1197,1198,1201],{},"Which pairs to report: ",[213,1192,1193],{},"all",[213,1195,1196],{},"same"," (within one language) or ",[213,1199,1200],{},"cross"," (across languages)",[1030,1203,1204],{},[213,1205,1193],{},[1015,1207,1208,1212,1218],{},[1030,1209,1210],{},[213,1211,935],{},[1030,1213,1214,1215],{},"Lowest cosine similarity of a pair across languages, in ",[213,1216,1217],{},"(0, 1]",[1030,1219,1220],{},"the model's calibrated value, 0.4125 for CodeRankEmbed; 0.6 for a model jscpd has not calibrated",[1015,1222,1223,1227,1232],{},[1030,1224,1225],{},[213,1226,383],{},[1030,1228,1229,1230],{},"Lowest cosine similarity of a pair within one language, in ",[213,1231,1217],{},[1030,1233,1234,1235,1237],{},"the model's calibrated value, 0.6375 for CodeRankEmbed; with ",[213,1236,935],{}," set, that value plus the model's gap",[1015,1239,1240,1244,1251],{},[1030,1241,1242],{},[213,1243,698],{},[1030,1245,1246,1247,1250],{},"Embedding model: a name from ",[213,1248,1249],{},"--semantic-models",", its Hugging Face id, or any name an API serves",[1030,1252,1253,1256,1257,1260,1261],{},[213,1254,1255],{},"CodeRankEmbed","; ",[213,1258,1259],{},"unclemusclez\u002Fjina-embeddings-v2-base-code"," with ",[213,1262,745],{},[1015,1264,1265,1269,1272],{},[1030,1266,1267],{},[213,1268,1249],{},[1030,1270,1271],{},"List the models jscpd has calibrated, with their thresholds, licenses and where they run, and exit",[1030,1273,1180],{},[1015,1275,1276,1280,1291],{},[1030,1277,1278],{},[213,1279,745],{},[1030,1281,1282,1283,1286,1287,1290],{},"OpenAI-compatible embeddings API, e.g. ",[213,1284,1285],{},"http:\u002F\u002Flocalhost:11434\u002Fv1"," for Ollama; selects the ",[213,1288,1289],{},"http"," provider",[1030,1292,1180],{},[1015,1294,1295,1300,1310],{},[1030,1296,1297],{},[213,1298,1299],{},"--semantic-provider",[1030,1301,1302,1303,1306,1307,1309],{},"Where embeddings come from: ",[213,1304,1305],{},"local"," (the model run in jscpd) or ",[213,1308,1289],{}," (an embeddings API)",[1030,1311,1312,1256,1314,1316],{},[213,1313,1305],{},[213,1315,1289],{}," when a URL is given",[1015,1318,1319,1323,1328],{},[1030,1320,1321],{},[213,1322,1077],{},[1030,1324,753,1325,1327],{},[213,1326,215],{},", embed every function again and replace the cached vectors of the model in use",[1030,1329,1157],{},[1015,1331,1332,1336,1339],{},[1030,1333,1334],{},[213,1335,486],{},[1030,1337,1338],{},"Report only semantic clones",[1030,1340,1341],{},"all kinds",[347,1343,1345],{"id":1344},"config-file","Config file",[203,1347,1348,1349,1351,1352,1355,1356,1359,1360,1363],{},"The ",[213,1350,219],{}," key in ",[213,1353,1354],{},".jscpd.json"," takes ",[213,1357,1358],{},"true",", or an object with these keys. An object turns the mode on only with ",[213,1361,1362],{},"\"enabled\": true",", so a project can keep its settings in the file and choose the run on the command line.",[236,1365,1369],{"className":1366,"code":1367,"filename":1354,"language":1368,"meta":242,"style":242},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"semantic\": {\n    \"enabled\": true,\n    \"scope\": \"all\",\n    \"model\": \"CodeRankEmbed\",\n    \"threshold\": 0.4125,\n    \"sameThreshold\": 0.6375,\n    \"cache\": true\n  }\n}\n","json",[213,1370,1371,1376,1392,1407,1428,1447,1463,1479,1494,1500],{"__ignoreMap":242},[246,1372,1373],{"class":248,"line":249},[246,1374,1375],{"class":581},"{\n",[246,1377,1378,1381,1384,1387,1389],{"class":248,"line":264},[246,1379,1380],{"class":581},"  \"",[246,1382,219],{"class":1383},"spNyl",[246,1385,1386],{"class":581},"\"",[246,1388,499],{"class":581},[246,1390,1391],{"class":581}," {\n",[246,1393,1394,1397,1400,1402,1404],{"class":248,"line":530},[246,1395,1396],{"class":581},"    \"",[246,1398,1399],{"class":252},"enabled",[246,1401,1386],{"class":581},[246,1403,499],{"class":581},[246,1405,1406],{"class":581}," true,\n",[246,1408,1409,1411,1414,1416,1418,1421,1423,1425],{"class":248,"line":537},[246,1410,1396],{"class":581},[246,1412,1413],{"class":252},"scope",[246,1415,1386],{"class":581},[246,1417,499],{"class":581},[246,1419,1420],{"class":581}," \"",[246,1422,1193],{"class":256},[246,1424,1386],{"class":581},[246,1426,1427],{"class":581},",\n",[246,1429,1430,1432,1435,1437,1439,1441,1443,1445],{"class":248,"line":622},[246,1431,1396],{"class":581},[246,1433,1434],{"class":252},"model",[246,1436,1386],{"class":581},[246,1438,499],{"class":581},[246,1440,1420],{"class":581},[246,1442,1255],{"class":256},[246,1444,1386],{"class":581},[246,1446,1427],{"class":581},[246,1448,1449,1451,1454,1456,1458,1461],{"class":248,"line":633},[246,1450,1396],{"class":581},[246,1452,1453],{"class":252},"threshold",[246,1455,1386],{"class":581},[246,1457,499],{"class":581},[246,1459,1460],{"class":959}," 0.4125",[246,1462,1427],{"class":581},[246,1464,1465,1467,1470,1472,1474,1477],{"class":248,"line":646},[246,1466,1396],{"class":581},[246,1468,1469],{"class":252},"sameThreshold",[246,1471,1386],{"class":581},[246,1473,499],{"class":581},[246,1475,1476],{"class":959}," 0.6375",[246,1478,1427],{"class":581},[246,1480,1482,1484,1487,1489,1491],{"class":248,"line":1481},8,[246,1483,1396],{"class":581},[246,1485,1486],{"class":252},"cache",[246,1488,1386],{"class":581},[246,1490,499],{"class":581},[246,1492,1493],{"class":581}," true\n",[246,1495,1497],{"class":248,"line":1496},9,[246,1498,1499],{"class":581},"  }\n",[246,1501,1503],{"class":248,"line":1502},10,[246,1504,1505],{"class":581},"}\n",[1009,1507,1508,1519],{},[1012,1509,1510],{},[1015,1511,1512,1515,1517],{},[1018,1513,1514],{},"Key",[1018,1516,1140],{},[1018,1518,1143],{},[1025,1520,1521,1535,1558,1576,1588,1599,1612,1626,1638,1649,1661],{},[1015,1522,1523,1527,1530],{},[1030,1524,1525],{},[213,1526,1399],{},[1030,1528,1529],{},"Run the semantic pass",[1030,1531,1532],{},[213,1533,1534],{},"false",[1015,1536,1537,1542,1548],{},[1030,1538,1539],{},[213,1540,1541],{},"provider",[1030,1543,1544,474,1546],{},[213,1545,1305],{},[213,1547,1289],{},[1030,1549,1550,1256,1552,1554,1555,1557],{},[213,1551,1305],{},[213,1553,1289],{}," when ",[213,1556,886],{}," is set",[1015,1559,1560,1564,1572],{},[1030,1561,1562],{},[213,1563,1413],{},[1030,1565,1566,1102,1568,474,1570],{},[213,1567,1193],{},[213,1569,1196],{},[213,1571,1200],{},[1030,1573,1574],{},[213,1575,1193],{},[1015,1577,1578,1582,1585],{},[1030,1579,1580],{},[213,1581,1453],{},[1030,1583,1584],{},"Lowest similarity across languages",[1030,1586,1587],{},"the model's calibrated value",[1015,1589,1590,1594,1597],{},[1030,1591,1592],{},[213,1593,1469],{},[1030,1595,1596],{},"Lowest similarity within one language",[1030,1598,1587],{},[1015,1600,1601,1605,1608],{},[1030,1602,1603],{},[213,1604,1434],{},[1030,1606,1607],{},"Embedding model",[1030,1609,1610],{},[213,1611,1255],{},[1015,1613,1614,1618,1624],{},[1030,1615,1616],{},[213,1617,886],{},[1030,1619,1620,1621,1623],{},"Embeddings API; jscpd uses a URL that is not on this machine only when ",[213,1622,215],{}," is on the command line",[1030,1625,1180],{},[1015,1627,1628,1632,1635],{},[1030,1629,1630],{},[213,1631,900],{},[1030,1633,1634],{},"Vector length to ask the API for",[1030,1636,1637],{},"the model's own",[1015,1639,1640,1644,1647],{},[1030,1641,1642],{},[213,1643,906],{},[1030,1645,1646],{},"Extra fields for every API request",[1030,1648,1180],{},[1015,1650,1651,1655,1658],{},[1030,1652,1653],{},[213,1654,912],{},[1030,1656,1657],{},"Text put before every function",[1030,1659,1660],{},"the model's calibrated instruction, or none",[1015,1662,1663,1667,1670],{},[1030,1664,1665],{},[213,1666,1486],{},[1030,1668,1669],{},"Keep vectors in the cache directory",[1030,1671,1672],{},[213,1673,1358],{},[203,1675,1676],{},"jscpd stops the run when the config file holds an API key.",[347,1678,1680],{"id":1679},"environment-variables","Environment variables",[1009,1682,1683,1693],{},[1012,1684,1685],{},[1015,1686,1687,1690],{},[1018,1688,1689],{},"Variable",[1018,1691,1692],{},"Effect",[1025,1694,1695,1704,1713],{},[1015,1696,1697,1701],{},[1030,1698,1699],{},[213,1700,825],{},[1030,1702,1703],{},"The key for an embeddings API",[1015,1705,1706,1710],{},[1030,1707,1708],{},[213,1709,1065],{},[1030,1711,1712],{},"The directory for models and vectors, instead of the user cache directory",[1015,1714,1715,1720],{},[1030,1716,1717],{},[213,1718,1719],{},"HF_ENDPOINT",[1030,1721,1722,1723],{},"A Hugging Face mirror for ",[213,1724,660],{},[231,1726,1728],{"id":1727},"see-also","See also",[318,1730,1731,1736,1741,1749],{},[321,1732,1733,1735],{},[207,1734,163],{"href":164},": how the nine models compare, and where the thresholds come from.",[321,1737,1738,1740],{},[207,1739,58],{"href":59},": where semantic clones sit next to exact, renamed and near-miss clones.",[321,1742,1743,1748],{},[207,1744,1746],{"href":303,"rel":1745},[305],[213,1747,308],{},": a runnable example with the expected output of every command.",[321,1750,1751,1756],{},[207,1752,1755],{"href":1753,"rel":1754},"https:\u002F\u002Fgithub.com\u002Fkucherenko\u002Fjscpd\u002Fblob\u002Fmaster\u002Fdocs\u002Frust.md#semantic-clones-with---semantic-experimental",[305],"Rust CLI docs",": the full rule set.",[1758,1759,1760],"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 pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":242,"searchDepth":264,"depth":264,"links":1762},[1763,1764,1765,1772,1773,1774,1775,1776,1777,1782],{"id":233,"depth":264,"text":234},{"id":312,"depth":264,"text":313},{"id":344,"depth":264,"text":345,"children":1766},[1767,1768,1769,1770,1771],{"id":349,"depth":530,"text":350},{"id":391,"depth":530,"text":392},{"id":439,"depth":530,"text":440},{"id":480,"depth":530,"text":481},{"id":561,"depth":530,"text":562},{"id":671,"depth":264,"text":672},{"id":739,"depth":264,"text":740},{"id":930,"depth":264,"text":388},{"id":996,"depth":264,"text":997},{"id":1094,"depth":264,"text":1095},{"id":1123,"depth":264,"text":1124,"children":1778},[1779,1780,1781],{"id":1127,"depth":530,"text":1128},{"id":1344,"depth":530,"text":1345},{"id":1679,"depth":530,"text":1680},{"id":1727,"depth":264,"text":1728},"Find functions that do the same job with different code, in one language or across languages, with jscpd --semantic and a code embedding model.","md",null,{},{"icon":86},{"title":1789,"description":1790},"Semantic Clone Detection with jscpd --semantic","Use jscpd --semantic to find functions that do the same thing written differently, with a local code embedding model or an embeddings API, and every option that tunes it.","Adi0RmTMtVZ1ydXSHV6f0dIuEv9oPgAOTA5cYT31w7I",[1793,1795],{"title":78,"path":79,"stem":80,"description":1794,"icon":81,"children":-1},"One 0-100 score with a grade for a codebase, from how much of it is duplicated, dead or concentrated in complex files, extensible with coverage, test and security metrics.",{"title":88,"path":89,"stem":90,"description":1796,"icon":93,"children":-1},"Integrate jscpd into your CI pipeline and git hooks.",1790609746907]