[{"data":1,"prerenderedAt":1212},["ShallowReactive",2],{"navigation_docs":3,"-guides-health":188,"-guides-health-surround":1207},[4,50,82,99,135,157,173,178,183],{"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],{"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,"children":86,"icon":6},"CI & Hooks","\u002Fci-and-hooks","3.ci-and-hooks\u002F1.index",[87,89,94],{"title":83,"path":84,"stem":85,"icon":88},"i-lucide-git-pull-request",{"title":90,"path":91,"stem":92,"icon":93},"Use jscpd in CI","\u002Fci-and-hooks\u002Fci","3.ci-and-hooks\u002F2.ci","i-lucide-github",{"title":95,"path":96,"stem":97,"icon":98},"Use jscpd in Pre-Commit Hook","\u002Fci-and-hooks\u002Fpre-commit","3.ci-and-hooks\u002F3.pre-commit","i-lucide-git-commit",{"title":100,"path":101,"stem":102,"children":103,"icon":105},"Reporters","\u002Freporters","4.reporters\u002F1.index",[104,106,110,115,120,125,130],{"title":100,"path":101,"stem":102,"icon":105},"i-lucide-file-chart-column",{"title":107,"path":108,"stem":109,"icon":29},"HTML Reporter","\u002Freporters\u002Fhtml","4.reporters\u002F2.html",{"title":111,"path":112,"stem":113,"icon":114},"JSON Reporter","\u002Freporters\u002Fjson","4.reporters\u002F3.json","i-lucide-braces",{"title":116,"path":117,"stem":118,"icon":119},"Badge Reporter","\u002Freporters\u002Fbadge","4.reporters\u002F4.badge","i-lucide-award",{"title":121,"path":122,"stem":123,"icon":124},"SARIF Reporter","\u002Freporters\u002Fsarif","4.reporters\u002F5.sarif","i-lucide-shield-check",{"title":126,"path":127,"stem":128,"icon":129},"CodeClimate \u002F GitLab Reporter","\u002Freporters\u002Fcodeclimate","4.reporters\u002F6.codeclimate","i-lucide-flag-triangle-right",{"title":131,"path":132,"stem":133,"icon":134},"OpenMetrics Reporter","\u002Freporters\u002Fopenmetrics","4.reporters\u002F7.openmetrics","i-lucide-activity",{"title":136,"path":137,"stem":138,"children":139,"icon":6},"Benchmarks","\u002Fbenchmarks","5.benchmarks\u002F1.index",[140,142,147,152],{"title":136,"path":137,"stem":138,"icon":141},"i-lucide-gauge",{"title":143,"path":144,"stem":145,"icon":146},"Detection Speed","\u002Fbenchmarks\u002Fdetection-speed","5.benchmarks\u002F2.detection-speed","i-lucide-zap",{"title":148,"path":149,"stem":150,"icon":151},"Multi-Format Detection","\u002Fbenchmarks\u002Fcross-format","5.benchmarks\u002F3.cross-format","i-lucide-layers",{"title":153,"path":154,"stem":155,"icon":156},"AI Token Efficiency","\u002Fbenchmarks\u002Fai-token-efficiency","5.benchmarks\u002F4.ai-token-efficiency","i-lucide-sparkles",{"title":158,"path":159,"stem":160,"children":161,"icon":163},"API","\u002Fapi","6.api\u002F1.index",[162,164,169],{"title":158,"path":159,"stem":160,"icon":163},"i-lucide-code",{"title":165,"path":166,"stem":167,"icon":168},"Rust Crates (v5)","\u002Fapi\u002Fcore","6.api\u002F2.core","i-lucide-box",{"title":170,"path":171,"stem":172,"icon":168},"MCP Server","\u002Fapi\u002Fmcp-server","6.api\u002F4.mcp-server",{"title":174,"path":175,"stem":176,"icon":177},"Trending","\u002Ftrending","7.trending","i-lucide-trending-up",{"title":179,"path":180,"stem":181,"icon":182},"Research","\u002Fresearch","8.research","i-lucide-graduation-cap",{"title":184,"path":185,"stem":186,"icon":187},"Articles","\u002Farticles","9.articles","i-lucide-newspaper",{"id":189,"title":78,"body":190,"description":1198,"extension":1199,"links":1200,"meta":1201,"navigation":1202,"path":79,"seo":1203,"stem":80,"__hash__":1206},"docs\u002F2.guides\u002F6.health.md",{"type":191,"value":192,"toc":1184},"minimark",[193,209,226,231,297,305,312,316,319,324,327,338,342,345,397,401,404,410,422,426,432,435,481,484,488,491,497,500,506,548,551,555,567,624,634,637,646,650,679,891,901,905,916,1071,1078,1082,1162,1180],[194,195,196,197,201,202,208],"p",{},"Duplication, dead code and complexity each tell part of the story. ",[198,199,200],"code",{},"--health"," folds them into one number you can put on a README, track over time, or gate on, and ",[203,204,205],"a",{"href":74},[198,206,207],{},"--dashboard"," shows it on top of the screen.",[210,211,212,213,217,218,221,222,225],"note",{},"Available from jscpd ",[214,215,216],"strong",{},"5.3.0",". Dead code is measured for JavaScript, TypeScript and Python, including Vue, Svelte and Astro components, and for Rust when you pass the compiler's diagnostics with ",[198,219,220],{},"--rust-diagnostics",". This page describes the formula as of ",[214,223,224],{},"5.3.2",".",[227,228,230],"h2",{"id":229},"running-it","Running it",[232,233,239],"pre",{"className":234,"code":235,"filename":236,"language":237,"meta":238,"style":238},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jscpd src --health                                   # the badge\njscpd src --health --reporters json,badge            # jscpd-health.json + jscpd-health-badge.svg\njscpd src --health --health-input metrics.json       # with coverage, tests, security\n","Terminal","bash","",[198,240,241,261,279],{"__ignoreMap":238},[242,243,246,250,254,257],"span",{"class":244,"line":245},"line",1,[242,247,249],{"class":248},"sBMFI","jscpd",[242,251,253],{"class":252},"sfazB"," src",[242,255,256],{"class":252}," --health",[242,258,260],{"class":259},"sHwdD","                                   # the badge\n",[242,262,264,266,268,270,273,276],{"class":244,"line":263},2,[242,265,249],{"class":248},[242,267,253],{"class":252},[242,269,256],{"class":252},[242,271,272],{"class":252}," --reporters",[242,274,275],{"class":252}," json,badge",[242,277,278],{"class":259},"            # jscpd-health.json + jscpd-health-badge.svg\n",[242,280,282,284,286,288,291,294],{"class":244,"line":281},3,[242,283,249],{"class":248},[242,285,253],{"class":252},[242,287,256],{"class":252},[242,289,290],{"class":252}," --health-input",[242,292,293],{"class":252}," metrics.json",[242,295,296],{"class":259},"       # with coverage, tests, security\n",[232,298,303],{"className":299,"code":301,"language":302,"meta":238},[300],"language-text","Health  B   74\u002F100  █████████████████▊░░░░░░  93 lines of code (XS)\n  duplication   75  █████████░░░  5.4% in typescript (no text)\n  dead code     72  ████████▋░░░  14.0%\n  complexity    76  █████████▏░░  0.0% in complex files\n","text",[198,304,301],{"__ignoreMap":238},[194,306,307,308,311],{},"Each sub-score is followed by what it was measured from. A dimension that cannot be measured is named (",[198,309,310],{},"dead code n\u002Fa",") rather than scored as perfect.",[227,313,315],{"id":314},"how-it-is-calculated","How it is calculated",[194,317,318],{},"The score is built in five steps. Each one is small, and the JSON report carries every intermediate number, so you can check a score by hand.",[320,321,323],"h3",{"id":322},"_1-count-the-code","1. Count the code",[194,325,326],{},"Only code files count. Prose (Markdown, text), data (JSON, YAML, TOML, CSV, lock files) and markup (HTML, XML, SVG, CSS, templates) are left out of every calculation, on both sides of each fraction. A folder of copied JSON snapshots does not lower the score, and a long unique HTML page does not raise it.",[194,328,329,330,333,334,337],{},"A Vue, Svelte or Astro component is a code file. Its ",[198,331,332],{},"\u003Ctemplate>"," and ",[198,335,336],{},"\u003Cstyle>"," blocks are not counted as duplicated code, even when they repeat.",[320,339,341],{"id":340},"_2-measure-three-shares","2. Measure three shares",[194,343,344],{},"Every dimension is a share of lines, in percent. Because they are shares, a project is not penalized for being large.",[346,347,348,361],"table",{},[349,350,351],"thead",{},[352,353,354,358],"tr",{},[355,356,357],"th",{},"Dimension",[355,359,360],{},"Share",[362,363,364,377,385],"tbody",{},[352,365,366,370],{},[367,368,369],"td",{},"Duplication",[367,371,372,373,376],{},"duplicated lines ÷ code lines. The same lines jscpd's own percentage counts, so the score and ",[198,374,375],{},"--threshold"," talk about one number",[352,378,379,382],{},[367,380,381],{},"Dead code",[367,383,384],{},"dead lines ÷ the lines the dead-code analysis could read",[352,386,387,390],{},[367,388,389],{},"Complexity",[367,391,392,393,396],{},"lines in complex files ÷ code lines. A file is complex from a complexity of 50 (",[198,394,395],{},"complexFile","). Complexity hurts when it piles up in a few files, and a mean would hide that",[320,398,400],{"id":399},"_3-adjust-for-size","3. Adjust for size",[194,402,403],{},"In a small project one finding is a large share: a single clone in 300 lines is 5%. So each share is mixed with 2000 lines of a typical project before it is scored:",[232,405,408],{"className":406,"code":407,"language":302,"meta":238},[300],"adjusted = (share × lines + median × 2000) ÷ (lines + 2000)\n",[198,409,407],{"__ignoreMap":238},[194,411,412,415,416,333,419,225],{},[198,413,414],{},"median"," is what a typical project shows for that dimension (see the table below). At 300 lines the prior dominates. At 50,000 lines it no longer matters. The JSON report has both numbers, ",[198,417,418],{},"value",[198,420,421],{},"adjusted",[320,423,425],{"id":424},"_4-turn-each-share-into-a-sub-score","4. Turn each share into a sub-score",[232,427,430],{"className":428,"code":429,"language":302,"meta":238},[300],"score = 100 × 2^(−adjusted ÷ halfLife)\n",[198,431,429],{"__ignoreMap":238},[194,433,434],{},"The score is 100 at zero, 50 at one half-life and 25 at two. It has no cliff and no dead zone: every extra percent costs something, and no single percent costs everything.",[346,436,437,449],{},[349,438,439],{},[352,440,441,443,446],{},[355,442,357],{},[355,444,445],{},"Median",[355,447,448],{},"Half-life",[362,450,451,461,471],{},[352,452,453,455,458],{},[367,454,369],{},[367,456,457],{},"3.5%",[367,459,460],{},"8.5%",[352,462,463,465,468],{},[367,464,381],{},[367,466,467],{},"3.1%",[367,469,470],{},"7.5%",[352,472,473,475,478],{},[367,474,389],{},[367,476,477],{},"20.9% of lines in complex files",[367,479,480],{},"50%",[194,482,483],{},"The half-lives were chosen so that the median project scores 75 in each dimension. The numbers come from 42 open source projects taken from GitHub trending, from 1.3K to 878K lines of code. 35 of them have JavaScript, TypeScript or Python and were used for dead code. They are constants of the release: they do not change from day to day, so a score only moves when your code does.",[320,485,487],{"id":486},"_5-combine","5. Combine",[194,489,490],{},"The overall score is the weighted geometric mean of the sub-scores:",[232,492,495],{"className":493,"code":494,"language":302,"meta":238},[300],"score = exp( Σ weight × ln(subscore) ÷ Σ weight )\n",[198,496,494],{"__ignoreMap":238},[194,498,499],{},"A geometric mean does not let one good dimension hide a bad one. A project that is 40% dead code is not rescued by low duplication. A sub-score is never taken below 1, so one zero cannot erase every other dimension.",[194,501,502,503,505],{},"All weights are 1 unless you change them, with one exception. Dead code weighs as much as the share of the code it could read: in a project that is 30% TypeScript and 70% Go, the dead-code sub-score gets a weight of 0.3. Rust counts as read once you pass ",[198,504,220],{},". When the languages it can read are under 5% of the code, dead code is skipped and the report says so.",[194,507,508,509,512,513,516,517,520,521,524,525,528,529,532,533,536,537,540,541,544,545,225],{},"Grades: ",[198,510,511],{},"A"," from 85, ",[198,514,515],{},"B"," from 70, ",[198,518,519],{},"C"," from 55, ",[198,522,523],{},"D"," from 40, then ",[198,526,527],{},"E",". The badge also shows a size class: ",[198,530,531],{},"XS"," under 1K lines of code, ",[198,534,535],{},"S"," under 10K, ",[198,538,539],{},"M"," under 100K, ",[198,542,543],{},"L"," under 1M, then ",[198,546,547],{},"XL",[194,549,550],{},"Two scores are comparable only when they are built from the same dimensions.",[320,552,554],{"id":553},"a-worked-example","A worked example",[194,556,557,558,566],{},"The run at the top of this page is ",[203,559,563],{"href":560,"rel":561},"https:\u002F\u002Fgithub.com\u002Fkucherenko\u002Fjscpd\u002Ftree\u002Fmaster\u002Ffixtures\u002Fdashboard-demo#health",[562],"nofollow",[198,564,565],{},"fixtures\u002Fdashboard-demo",": 93 lines of TypeScript, with 5 duplicated lines, 13 dead lines and no complex file.",[346,568,569,583],{},[349,570,571],{},[352,572,573,575,577,580],{},[355,574],{},[355,576,360],{},[355,578,579],{},"Adjusted",[355,581,582],{},"Sub-score",[362,584,585,598,611],{},[352,586,587,589,592,595],{},[367,588,369],{},[367,590,591],{},"5 ÷ 93 = 5.4%",[367,593,594],{},"(5.4 × 93 + 3.5 × 2000) ÷ 2093 = 3.6%",[367,596,597],{},"100 × 2^(−3.6 ÷ 8.5) = 74.7",[352,599,600,602,605,608],{},[367,601,381],{},[367,603,604],{},"13 ÷ 93 = 14.0%",[367,606,607],{},"(14.0 × 93 + 3.1 × 2000) ÷ 2093 = 3.6%",[367,609,610],{},"100 × 2^(−3.6 ÷ 7.5) = 71.8",[352,612,613,615,618,621],{},[367,614,389],{},[367,616,617],{},"0 ÷ 93 = 0.0%",[367,619,620],{},"(0 × 93 + 20.9 × 2000) ÷ 2093 = 20.0%",[367,622,623],{},"100 × 2^(−20.0 ÷ 50) = 75.8",[194,625,626,627,629,630,633],{},"The overall score is the cube root of 74.7 × 71.8 × 75.8, which is 74.1, a ",[198,628,515],{},". These are the numbers in ",[198,631,632],{},"jscpd-health.json",". The adjusted shares are shown rounded here, and jscpd rounds only at the end.",[194,635,636],{},"The example also shows what the size adjustment does. 14% dead code would score 27 on its own. In a project of 93 lines that is thirteen lines, too few to judge by, so the score stays near the typical 75. The same 14% in a project of 50,000 lines scores about 28.",[194,638,639,640,645],{},"jscpd.dev also publishes a rolling sample of GitHub trending projects, measured daily, at ",[203,641,644],{"href":642,"rel":643},"https:\u002F\u002Fjscpd.dev\u002Fhealth-corpus.json",[562],"jscpd.dev\u002Fhealth-corpus.json",". It is there for comparison. The constants above do not follow it.",[227,647,649],{"id":648},"metrics-from-other-tools","Metrics from other tools",[194,651,652,655,656,659,660,663,664,666,667,670,671,674,675,678],{},[198,653,654],{},"--health-input FILE"," (config key ",[198,657,658],{},"healthInput",") adds what jscpd cannot measure. A metric is either a ready 0-100 ",[198,661,662],{},"score",", or a ",[198,665,418],{}," with the ",[198,668,669],{},"halfLife"," that turns it into one; ",[198,672,673],{},"\"direction\": \"higher\""," scores the distance to ",[198,676,677],{},"max"," (default 100).",[232,680,685],{"className":681,"code":682,"filename":683,"language":684,"meta":238,"style":238},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"metrics\": [\n    { \"id\": \"coverage\", \"value\": 81, \"direction\": \"higher\", \"halfLife\": 40 },\n    { \"id\": \"failing-tests\", \"value\": 2, \"halfLife\": 5 },\n    { \"id\": \"security\", \"score\": 100, \"weight\": 2 }\n  ]\n}\n","metrics.json","json",[198,686,687,693,711,782,830,879,885],{"__ignoreMap":238},[242,688,689],{"class":244,"line":245},[242,690,692],{"class":691},"sMK4o","{\n",[242,694,695,698,702,705,708],{"class":244,"line":263},[242,696,697],{"class":691},"  \"",[242,699,701],{"class":700},"spNyl","metrics",[242,703,704],{"class":691},"\"",[242,706,707],{"class":691},":",[242,709,710],{"class":691}," [\n",[242,712,713,716,719,722,724,726,728,731,733,736,738,740,742,744,748,750,752,755,757,759,761,764,766,768,770,772,774,776,779],{"class":244,"line":281},[242,714,715],{"class":691},"    {",[242,717,718],{"class":691}," \"",[242,720,721],{"class":248},"id",[242,723,704],{"class":691},[242,725,707],{"class":691},[242,727,718],{"class":691},[242,729,730],{"class":252},"coverage",[242,732,704],{"class":691},[242,734,735],{"class":691},",",[242,737,718],{"class":691},[242,739,418],{"class":248},[242,741,704],{"class":691},[242,743,707],{"class":691},[242,745,747],{"class":746},"sbssI"," 81",[242,749,735],{"class":691},[242,751,718],{"class":691},[242,753,754],{"class":248},"direction",[242,756,704],{"class":691},[242,758,707],{"class":691},[242,760,718],{"class":691},[242,762,763],{"class":252},"higher",[242,765,704],{"class":691},[242,767,735],{"class":691},[242,769,718],{"class":691},[242,771,669],{"class":248},[242,773,704],{"class":691},[242,775,707],{"class":691},[242,777,778],{"class":746}," 40",[242,780,781],{"class":691}," },\n",[242,783,785,787,789,791,793,795,797,800,802,804,806,808,810,812,815,817,819,821,823,825,828],{"class":244,"line":784},4,[242,786,715],{"class":691},[242,788,718],{"class":691},[242,790,721],{"class":248},[242,792,704],{"class":691},[242,794,707],{"class":691},[242,796,718],{"class":691},[242,798,799],{"class":252},"failing-tests",[242,801,704],{"class":691},[242,803,735],{"class":691},[242,805,718],{"class":691},[242,807,418],{"class":248},[242,809,704],{"class":691},[242,811,707],{"class":691},[242,813,814],{"class":746}," 2",[242,816,735],{"class":691},[242,818,718],{"class":691},[242,820,669],{"class":248},[242,822,704],{"class":691},[242,824,707],{"class":691},[242,826,827],{"class":746}," 5",[242,829,781],{"class":691},[242,831,833,835,837,839,841,843,845,848,850,852,854,856,858,860,863,865,867,870,872,874,876],{"class":244,"line":832},5,[242,834,715],{"class":691},[242,836,718],{"class":691},[242,838,721],{"class":248},[242,840,704],{"class":691},[242,842,707],{"class":691},[242,844,718],{"class":691},[242,846,847],{"class":252},"security",[242,849,704],{"class":691},[242,851,735],{"class":691},[242,853,718],{"class":691},[242,855,662],{"class":248},[242,857,704],{"class":691},[242,859,707],{"class":691},[242,861,862],{"class":746}," 100",[242,864,735],{"class":691},[242,866,718],{"class":691},[242,868,869],{"class":248},"weight",[242,871,704],{"class":691},[242,873,707],{"class":691},[242,875,814],{"class":746},[242,877,878],{"class":691}," }\n",[242,880,882],{"class":244,"line":881},6,[242,883,884],{"class":691},"  ]\n",[242,886,888],{"class":244,"line":887},7,[242,889,890],{"class":691},"}\n",[194,892,893,894,897,898,225],{},"With ",[198,895,896],{},"halfLife: 40",", 81% coverage is 19 short of 100 and scores 72; 60% scores 50. A CI job typically writes this file from its coverage and audit steps, then runs ",[198,899,900],{},"jscpd . --health --health-input metrics.json",[227,902,904],{"id":903},"tuning","Tuning",[194,906,907,908,911,912,915],{},"The same object can live under ",[198,909,910],{},"health"," in ",[198,913,914],{},".jscpd.json",", together with the tuning of the built-in dimensions:",[232,917,919],{"className":681,"code":918,"filename":914,"language":684,"meta":238,"style":238},"{\n  \"health\": {\n    \"duplication\": { \"halfLife\": 5, \"weight\": 2 },\n    \"deadCode\": { \"weight\": 0 },\n    \"complexFile\": 80,\n    \"metrics\": [{ \"id\": \"security\", \"score\": 100 }]\n  }\n}\n",[198,920,921,925,938,977,1003,1019,1061,1066],{"__ignoreMap":238},[242,922,923],{"class":244,"line":245},[242,924,692],{"class":691},[242,926,927,929,931,933,935],{"class":244,"line":263},[242,928,697],{"class":691},[242,930,910],{"class":700},[242,932,704],{"class":691},[242,934,707],{"class":691},[242,936,937],{"class":691}," {\n",[242,939,940,943,946,948,950,953,955,957,959,961,963,965,967,969,971,973,975],{"class":244,"line":281},[242,941,942],{"class":691},"    \"",[242,944,945],{"class":248},"duplication",[242,947,704],{"class":691},[242,949,707],{"class":691},[242,951,952],{"class":691}," {",[242,954,718],{"class":691},[242,956,669],{"class":746},[242,958,704],{"class":691},[242,960,707],{"class":691},[242,962,827],{"class":746},[242,964,735],{"class":691},[242,966,718],{"class":691},[242,968,869],{"class":746},[242,970,704],{"class":691},[242,972,707],{"class":691},[242,974,814],{"class":746},[242,976,781],{"class":691},[242,978,979,981,984,986,988,990,992,994,996,998,1001],{"class":244,"line":784},[242,980,942],{"class":691},[242,982,983],{"class":248},"deadCode",[242,985,704],{"class":691},[242,987,707],{"class":691},[242,989,952],{"class":691},[242,991,718],{"class":691},[242,993,869],{"class":746},[242,995,704],{"class":691},[242,997,707],{"class":691},[242,999,1000],{"class":746}," 0",[242,1002,781],{"class":691},[242,1004,1005,1007,1009,1011,1013,1016],{"class":244,"line":832},[242,1006,942],{"class":691},[242,1008,395],{"class":248},[242,1010,704],{"class":691},[242,1012,707],{"class":691},[242,1014,1015],{"class":746}," 80",[242,1017,1018],{"class":691},",\n",[242,1020,1021,1023,1025,1027,1029,1032,1034,1036,1038,1040,1042,1044,1046,1048,1050,1052,1054,1056,1058],{"class":244,"line":881},[242,1022,942],{"class":691},[242,1024,701],{"class":248},[242,1026,704],{"class":691},[242,1028,707],{"class":691},[242,1030,1031],{"class":691}," [{",[242,1033,718],{"class":691},[242,1035,721],{"class":746},[242,1037,704],{"class":691},[242,1039,707],{"class":691},[242,1041,718],{"class":691},[242,1043,847],{"class":252},[242,1045,704],{"class":691},[242,1047,735],{"class":691},[242,1049,718],{"class":691},[242,1051,662],{"class":746},[242,1053,704],{"class":691},[242,1055,707],{"class":691},[242,1057,862],{"class":746},[242,1059,1060],{"class":691}," }]\n",[242,1062,1063],{"class":244,"line":887},[242,1064,1065],{"class":691},"  }\n",[242,1067,1069],{"class":244,"line":1068},8,[242,1070,890],{"class":691},[194,1072,1073,1074,1077],{},"A weight of ",[198,1075,1076],{},"0"," leaves a dimension out. An unknown key, or a metric that cannot be scored, is an error rather than a silently different score.",[227,1079,1081],{"id":1080},"reporters-and-exit-codes","Reporters and exit codes",[346,1083,1084,1094],{},[349,1085,1086],{},[352,1087,1088,1091],{},[355,1089,1090],{},"Reporter",[355,1092,1093],{},"Output",[362,1095,1096,1106,1119,1130,1142],{},[352,1097,1098,1103],{},[367,1099,1100],{},[198,1101,1102],{},"console",[367,1104,1105],{},"The badge",[352,1107,1108,1113],{},[367,1109,1110],{},[198,1111,1112],{},"ai",[367,1114,1115,1116],{},"One line: ",[198,1117,1118],{},"health 74 B (duplication 75, dead-code 72, complexity 76; 93 code lines)",[352,1120,1121,1125],{},[367,1122,1123],{},[198,1124,684],{},[367,1126,1127,1129],{},[198,1128,632],{},": score, grade, size, and for each dimension its value, adjusted value, lines, half-life, weight and score",[352,1131,1132,1137],{},[367,1133,1134],{},[198,1135,1136],{},"badge",[367,1138,1139],{},[198,1140,1141],{},"jscpd-health-badge.svg",[352,1143,1144,1153],{},[367,1145,1146,1149,1150],{},[198,1147,1148],{},"markdown"," \u002F ",[198,1151,1152],{},"html",[367,1154,1155,1149,1158,1161],{},[198,1156,1157],{},"jscpd-health.md",[198,1159,1160],{},"jscpd-health.html",": the same score and dimension table, for a PR comment or a status page",[194,1163,1164,1165,1167,1168,333,1171,1174,1175,225],{},"The exit gates of a clone run apply: ",[198,1166,375],{},", ",[198,1169,1170],{},"--exit-code",[198,1172,1173],{},"--fail-on-empty",". A runnable example, with a metrics file, is in ",[203,1176,1178],{"href":560,"rel":1177},[562],[198,1179,565],{},[1181,1182,1183],"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 .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}",{"title":238,"searchDepth":263,"depth":263,"links":1185},[1186,1187,1195,1196,1197],{"id":229,"depth":263,"text":230},{"id":314,"depth":263,"text":315,"children":1188},[1189,1190,1191,1192,1193,1194],{"id":322,"depth":281,"text":323},{"id":340,"depth":281,"text":341},{"id":399,"depth":281,"text":400},{"id":424,"depth":281,"text":425},{"id":486,"depth":281,"text":487},{"id":553,"depth":281,"text":554},{"id":648,"depth":263,"text":649},{"id":903,"depth":263,"text":904},{"id":1080,"depth":263,"text":1081},"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.","md",null,{},{"icon":81},{"title":1204,"description":1205},"Project Health Score with jscpd --health","jscpd --health turns duplication, dead code and complexity into one size-aware 0-100 score with an A-E grade. The formula, its constants and a worked example.","ysM-5KdhU_yFfXAllWWM8Ktq4MKXdkHxMrT0Y27-NZw",[1208,1210],{"title":73,"path":74,"stem":75,"description":1209,"icon":76,"children":-1},"One screen with a project's size, duplication, complexity and dead code, from a single jscpd --dashboard run.",{"title":83,"path":84,"stem":85,"description":1211,"icon":88,"children":-1},"Integrate jscpd into your CI pipeline and git hooks.",1790314232663]