Vercel Doctor

स्कोरिंग

Vercel Doctor आपके प्रोजेक्ट के health score की गणना कैसे करता है।

प्रत्येक स्कैन 0 से 100 तक का स्कोर उत्पन्न करता है। स्कोर reflect करता है कि severity से weighted आपके प्रोजेक्ट ने कितने unique rules trigger किए।

गणना

score = max(0, round(100 - penalties))

जहाँ penalties हैं:

Severityप्रति unique rule penalty
Error1.5 अंक
Warning0.75 अंक

स्कोर triggered unique rules पर आधारित है, diagnostics की कुल संख्या पर नहीं। अगर एक ही rule 10 फाइलों पर fire होती है, तो केवल एक बार गिना जाता है।

Labels

ScoreLabel
75–100Great
50–74Needs work
0–49Critical

उदाहरण

2 error rules और 8 warning rules वाले प्रोजेक्ट के लिए:

penalty = (2 × 1.5) + (8 × 0.75) = 3 + 6 = 9
score = max(0, round(100 - 9)) = 91 → Great

अपना स्कोर शेयर करें

Vercel Doctor चलाने के बाद, आपका स्कोर social sharing buttons और embeddable badge वाले shareable पेज पर उपलब्ध है।

Badge

अपने README.md में badge जोड़ें:

[![Vercel Doctor](https://www.vercel-doctor.com/share/badge?s=91)](https://www.vercel-doctor.com/share?s=91)

API

आप programmatically भी स्कोर की गणना कर सकते हैं:

curl -X POST https://www.vercel-doctor.com/api/score \
  -H "Content-Type: application/json" \
  -d '{"diagnostics": [...]}'

रिटर्न करता है:

{
  "score": 91,
  "label": "Great"
}

/api/estimate-score एंडपॉइंट अनुमान लगाता है कि issues ठीक करने के बाद आपका स्कोर क्या होगा, errors के लिए 85% और warnings के लिए 80% की estimated fix rates का उपयोग करके।

Edit on GitHub

Last updated on

On this page