LearnNewsExamplesServices
Frontmatter
id9327
titleFix commitRatio calculation to exclude private contributions
stateClosed
labels
bugai
assigneestobiu
createdAtFeb 27, 2026, 11:21 AM
updatedAtFeb 27, 2026, 11:42 AM
githubUrlhttps://github.com/neomjs/neo/issues/9327
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 27, 2026, 11:42 AM

Fix commitRatio calculation to exclude private contributions

Closed v12.0.0 bugai
tobiu
tobiu commented on Feb 27, 2026, 11:21 AM

A severe logic flaw was discovered in the calculation of commitRatio within the Contributor model.

Currently, the ratio is calculated as totalCommits / totalContributions. However, the totalCommits data we get from the GitHub API only represents public commits, whereas totalContributions includes private contributions.

Because GitHub's API does not provide a breakdown of private contributions (we don't know if a private contribution is a commit, issue, or PR review), treating them as "non-commits" in the denominator artificially tanks the commitRatio for users with high private activity.

For example, user happy-spark has over 1M total contributions (99.96% private), but their commitRatio displays as 0.04%.

The Fix: The commitRatio must be calculated strictly against public behavior: totalCommits / totalPublicContributions.

tobiu added the bug label on Feb 27, 2026, 11:21 AM
tobiu added the ai label on Feb 27, 2026, 11:21 AM
tobiu referenced in commit 2a5f6d9 - "fix(devindex): Calculate commitRatio using only public contributions (#9327) on Feb 27, 2026, 11:41 AM
tobiu assigned to @tobiu on Feb 27, 2026, 11:42 AM
tobiu
tobiu Feb 27, 2026, 11:42 AM

Input from Gemini 3.1 Pro:

✦ I have refactored the Contributor model to use the new depends framework config. This allowed me to drastically simplify the calculated fields and securely fix the commitRatio bug by dividing totalCommits strictly by totalPublicContributions. The changes have been committed and pushed to dev.

tobiu closed this issue on Feb 27, 2026, 11:42 AM