Skip to content

Rank doesn't take into account whether include_all_commits is taken into account #1260

Closed
@jmarrec

Description

@jmarrec

Describe the bug

What is passed to the calculateRank function depends on whether include_all_commits was orignally true or not.
So if you pass include_all_commits=True you generally get a much better rank than if you do not.

In my case normal commits (for the current year) was ~2000 giving me an A++ rank. If I use include_all_commits=true then 12000 is passed and I get an S rank.

// normal commits
stats.totalCommits = user.contributionsCollection.totalCommitContributions;
// if include_all_commits then just get that,
// since totalCommitsFetcher already sends totalCommits no need to +=
if (include_all_commits) {
stats.totalCommits = await totalCommitsFetcher(username);
}
// if count_private then add private commits to totalCommits so far.
if (count_private) {
stats.totalCommits +=
user.contributionsCollection.restrictedContributionsCount;
}
stats.totalPRs = user.pullRequests.totalCount;
stats.contributedTo = user.repositoriesContributedTo.totalCount;
stats.totalStars = user.repositories.nodes.reduce((prev, curr) => {
return prev + curr.stargazers.totalCount;
}, 0);
stats.rank = calculateRank({
totalCommits: stats.totalCommits,

Expected behavior

one of these two values (total for the year, or total for all periods) should be passed to the function probably.

Screenshots / Live demo link (paste the github-readme-stats link as markdown image)
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.ranksFeature, Bug fix, improvement related to ranking system.stats-cardFeature, Enhancement, Fixes related to stats the stats card.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions