Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 4f3e453

Browse files
author
Roman Labunsky
committed
fix: fixed score calculation with usage
1 parent 05171f0 commit 4f3e453

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/score.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function calculatePackageScore (pkg, weights, includeUsage) {
1+
function calculatePackageScore(pkg, weights, includeUsage) {
22
let score = 0
33
// base assumption is that we have 3 weights
44
let weightPercentage = 0.33
@@ -20,7 +20,7 @@ function calculatePackageScore (pkg, weights, includeUsage) {
2020
score += weightPercentage * pkg.score.detail.quality
2121
} else {
2222
if (includeUsage) {
23-
score += usageWeight / weightSums * pkg.usage
23+
score += usageWeight / weightSums * pkg.internalUsage.usage
2424
}
2525
score += popularityWeight / weightSums * pkg.score.detail.popularity
2626
score += maintenanceWeight / weightSums * pkg.score.detail.maintenance

0 commit comments

Comments
 (0)