Skip to content

Commit

Permalink
Replace contributions by commits
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Jul 13, 2021
1 parent 2c4331d commit 7a652bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/calculateRank.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ function calculateRank({
stargazers,
}) {
const REPOS_MEAN = 10, REPOS_WEIGHT = 0.125;
const CONTRIBS_MEAN = 1000, CONTRIBS_WEIGHT = 0.125;
const COMMITS_MEAN = 1000, COMMITS_WEIGHT = 0.125;
const FOLLOWERS_MEAN = 50, FOLLOWERS_WEIGHT = 0.5;
const PRS_ISSUES_MEAN = 50, PRS_ISSUES_WEIGHT = 0.25;
const STARS_MEAN = 100, STARS_WEIGHT = 1.0;

const TOTAL_WEIGHT = (
REPOS_WEIGHT +
CONTRIBS_WEIGHT +
COMMITS_WEIGHT +
FOLLOWERS_WEIGHT +
PRS_ISSUES_WEIGHT +
STARS_WEIGHT
);

const rank = (
REPOS_WEIGHT * expsf(totalRepos / REPOS_MEAN) +
CONTRIBS_WEIGHT * expsf(contributions / CONTRIBS_MEAN) +
FOLLOWERS_WEIGHT * expsf(followers / FOLLOWERS_MEAN) +
PRS_ISSUES_WEIGHT * expsf((prs + issues) / PRS_ISSUES_MEAN) +
STARS_WEIGHT * expsf(stargazers / STARS_MEAN)
REPOS_WEIGHT * expsf(totalRepos, 1 / REPOS_MEAN) +
COMMITS_WEIGHT * expsf(totalCommits, 1 / COMMITS_MEAN) +
FOLLOWERS_WEIGHT * expsf(followers, 1 / FOLLOWERS_MEAN) +
PRS_ISSUES_WEIGHT * expsf(prs + issues, 1 / PRS_ISSUES_MEAN) +
STARS_WEIGHT * expsf(stargazers, 1 / STARS_MEAN)
) / TOTAL_WEIGHT;

const RANK_S_PLUS = 0.01;
Expand Down

0 comments on commit 7a652bf

Please sign in to comment.