DEV Community

Cover image for The Github Contribution Stats

The Github Contribution Stats

Dash Reyes on July 20, 2020

Hello, World! I just want to share this project about how you can dynamically generate a template of your Github contribution stats base...
Collapse
 
benwtrent profile image
Benjamin Trent

It's disappointing to see that only commits are taken into account.

PR reviews and creating issues are vital contributions to projects.

I wouldn't know how to weigh them all together though.

Collapse
 
lorddashme profile image
Dash Reyes • Edited

Hello! thanks for the comment, really appreciated 😊. Actually yes, right now commits are only counted for the ratings and the other 3 vitals for contribution are not yet included (Issues, Code Review, Pull Requests). But yes I will include all of them now 😊

Collapse
 
benwtrent profile image
Benjamin Trent

I am glad the score exists :). It would be an interesting statistical analysis on how to weight each of them differently.

Thread Thread
 
lorddashme profile image
Dash Reyes

Here's the interesting part if we just use the following common statistic formula (I also explained it here in another comment: dev.to/lorddashme/comment/129i9) then we can get the ratings for the 4 vital metrics for the contribution (Commits, Code Review, PR, Issues) and give each metrics a ratings multiplier for example for the Commits it's pretty common so I will give it a 0.8 and then the Code Review with a 2 so this mean the Code Review is much higher weight compare to Commits 😄

Collapse
 
hamzaanis profile image
Info Comment hidden by post author - thread only accessible via permalink
Hamza Anis

For the badge which includes PR and issues like this

alt

You can do something like this.

<img src=https://github-readme-stats.vercel.app/api?username={username}&show_icons=true alt={username} />
Collapse
 
anuraghazra profile image
Anurag Hazra • Edited

This one is my project, github-readme-stats btw :)

GitHub logo anuraghazra / github-readme-stats

Dynamically generated stats for your github readmes

Github Readme Stats

GitHub Readme Stats

Get dynamically generated GitHub stats on your readmes!

Tests Passing Issues GitHub pull requests

View Demo · Report Bug · Request Feature

简体中文 · Español

Loved the project? Please consider donating to help it improve!

Features

GitHub Stats Card

Copy paste this into your markdown content, and that's it. Simple!

Change the ?username= value to your GitHub's username.

[![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)

Note: Ranks are calculated based on user's stats, see src/calculateRank.js

Hiding individual stats

To hide any specific stats, you can pass a query parameter ?hide= with an array of items you wanna hide.

Options: &hide=["stars","commits","prs","issues","contribs"]

![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide=["contribs","prs"])

Showing icons

To enable icons, you can pass show_icons=true in the query param, like so:

![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true)

Themes

With inbuilt themes you can customize the look of the card…




People don't usually know the origin because lot of people do not attribute the project.

Collapse
 
mzaini30 profile image
Zen

My Github stats

Wew 😅

Collapse
 
lorddashme profile image
Dash Reyes

Ohh my! Congrats you got the S score! 🎉 😄 HAHAHAHAHAHAHA

Collapse
 
mzaini30 profile image
Zen

Hahahaha.... 😂😂😂

Collapse
 
hamzaanis profile image
Info Comment hidden by post author - thread only accessible via permalink
Hamza Anis

In addition to this I would like to add the reference for Github README Profile generator which also includes this post.

Collapse
 
____marcell profile image
Marcell Cruz

Nice project, but I think the contribution results are not making much sense right now, I think it should be more focused on the overall contribution, how is the calculation done ?

Collapse
 
lorddashme profile image
Dash Reyes • Edited

Hello! thanks for the comment, appreciated 😄. For the ratings calculation we've used some of the common statistic formula to get the final result, for example getting the Mean of the 3 data sets (which in our case the This Year, This Month, and This Week), when you have the Mean you can use it together with the Standard Deviation (Basically I considered this as the threshold for the score) to calculate the Z-Score which will be the basis for the ratings 😄. For more technical details you can also check the ContributionRatings.js which holds all the information for the calculation 😄.

Some comments have been hidden by the post's author - find out more