Skip to content

Commit

Permalink
Update GitStats (#61)
Browse files Browse the repository at this point in the history
Fix weighted avg contribution stat
add 100% max/ceil limit per repo contributions rate
  • Loading branch information
R055A authored Jul 20, 2024
1 parent 1fed32c commit 1f95937
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/github_repo_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,14 @@ async def lines_changed(self) -> Tuple[int, int]:
(author_additions + author_deletions) / repo_total_changes
)
author_contribution_percentages_weighted.append(
author_contribution_percentages[-1]
/ (
1
/ len(repo_contributors)
* (2 if len(repo_contributors) > 1 else 1)
min(
1.0,
author_contribution_percentages[-1]
/ (
1
/ len(repo_contributors)
* (2 if len(repo_contributors) > 1 else 1)
),
)
)
repo_total_changes_arr.append(repo_total_changes)
Expand Down

0 comments on commit 1f95937

Please sign in to comment.