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

Change language statistics to save size instead of percentage #11681

Merged
merged 4 commits into from
May 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Do not exclude if only language
  • Loading branch information
lafriks committed May 29, 2020
commit d76f7a1078b60b37ae9d4e26ea85f8c5074e5976
4 changes: 2 additions & 2 deletions models/repo_language_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func (stats LanguageStatList) getLanguagePercentages() map[string]float32 {
var total int64
for _, stat := range stats {
lafriks marked this conversation as resolved.
Show resolved Hide resolved
// Exclude specific languages from percentage calculation
if _, ok := specialLanguages[stat.Language]; ok {
if _, ok := specialLanguages[stat.Language]; ok && len(stats) > 1 {
continue
}
total += stat.Size
}
for _, stat := range stats {
// Exclude specific languages from percentage calculation
if _, ok := specialLanguages[stat.Language]; ok {
if _, ok := specialLanguages[stat.Language]; ok && len(stats) > 1 {
continue
}
perc := float32(math.Round(float64(stat.Size)/float64(total)*1000) / 10)
Expand Down