[英]How npmjs.com calculates the code quality
When we publish a package to npm, it will show us some data such as popularity, quality, and maintenance in the search page (The example image is blow).当我们将一个包发布到 npm 时,它会在搜索页面中向我们展示一些诸如流行度、质量、维护等数据(示例图片是吹的)。 I just wonder how npm calculates the quality?
我只是想知道 npm 如何计算质量? Really appreciate if someone can give some clue.
如果有人可以提供一些线索,真的很感激。
You can see this if you look on the search page.如果您查看搜索页面,您可以看到这一点。 See the right side of search page: npm search for "react"
查看搜索页面右侧: npm search for "react"
Edit, january 2020: NPM does not show "Powered by npms.io" anymore.编辑,2020 年 1 月: NPM 不再显示“Powered by npms.io” 。 I don't know if this is still accurate.
我不知道这是否仍然准确。
Original answer原答案
npm shows these graphs in search results, but they do not calculate these values themselves. npm在搜索结果中显示这些图表,但它们本身不计算这些值。 If you look below the search results, you'll see "Powered by npms.io ".
如果您查看搜索结果下方的内容,您将看到“Powered by npms.io ”。
According to this service, they don't inspect the code, but use the following metrics to measure code quality:根据这项服务,他们不检查代码,而是使用以下指标来衡量代码质量:
.gitignore
and friends?.gitignore
和朋友吗?> 1.xx
)?> 1.xx
)? Is it deprecated? Source: https://npms.io/about来源: https : //npms.io/about
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.