Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jmarrec opened this issue Aug 18, 2021 · 1 comment · Fixed by #1186
Closed

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

jmarrec opened this issue Aug 18, 2021 · 1 comment · Fixed by #1186
Labels
enhancement New feature or request. ranks Feature, Bug fix, improvement related to ranking system. stats-card Feature, Enhancement, Fixes related to stats the stats card.

Comments

@jmarrec
Copy link

jmarrec commented Aug 18, 2021

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.

@rickstaa rickstaa added enhancement New feature or request. stats-card Feature, Enhancement, Fixes related to stats the stats card. ranks Feature, Bug fix, improvement related to ranking system. labels Mar 9, 2022
@rickstaa
Copy link
Collaborator

rickstaa commented May 6, 2023

Will be fixed when #1186 is merged.

@rickstaa rickstaa linked a pull request May 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request. ranks Feature, Bug fix, improvement related to ranking system. stats-card Feature, Enhancement, Fixes related to stats the stats card.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants