mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-09-05 00:18:20 +00:00
fix: adding docstrings to the files where it was missing (#2101)
* fix: adding docstrings to missing files * style: format code * style: improve formatting Co-authored-by: Jagruti Tiwari <jagrutit@cdac.in> Co-authored-by: rickstaa <rick.staa@outlook.com>
This commit is contained in:
co-authored by
Jagruti Tiwari
rickstaa
parent
9e1fc0b7da
commit
c03bb2f250
+23
-1
@@ -1,4 +1,14 @@
|
||||
// https://stackoverflow.com/a/5263759/10629172
|
||||
/**
|
||||
* Calculates the probability of x taking on x or a value less than x in a normal distribution
|
||||
* with mean and standard deviation.
|
||||
*
|
||||
* @see https://stackoverflow.com/a/5263759/10629172
|
||||
*
|
||||
* @param {string} mean
|
||||
* @param {number} sigma
|
||||
* @param {number} to
|
||||
* @returns {number} Probability.
|
||||
*/
|
||||
function normalcdf(mean, sigma, to) {
|
||||
var z = (to - mean) / Math.sqrt(2 * sigma * sigma);
|
||||
var t = 1 / (1 + 0.3275911 * Math.abs(z));
|
||||
@@ -16,6 +26,18 @@ function normalcdf(mean, sigma, to) {
|
||||
return (1 / 2) * (1 + sign * erf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the users rank.
|
||||
*
|
||||
* @param {number} totalRepos
|
||||
* @param {number} totalCommits
|
||||
* @param {number} contributions
|
||||
* @param {number} followers
|
||||
* @param {number} prs
|
||||
* @param {number} issues
|
||||
* @param {number} stargazers
|
||||
* @returns {{level: string, score: number}}} The users rank.
|
||||
*/
|
||||
function calculateRank({
|
||||
totalRepos,
|
||||
totalCommits,
|
||||
|
||||
Reference in New Issue
Block a user