|
|
@@ -4,6 +4,8 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
) |
|
|
|
|
|
|
|
const MAX_LINES_RECORD = 100 |
|
|
|
|
|
|
|
func Normalization(value float64, minValue float64, maxValue float64) float64 { |
|
|
|
|
|
|
|
min := int64(minValue * 100) |
|
|
@@ -72,9 +74,12 @@ func GetTeamHealthInitValue(contributors int64, keyContributors int64, newContri |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func GetRepoGrowthInitValue(codelinesGrowth int64, issueGrowth int64, commitsGrowth int64, newContributors int64, commentsGrowth int64) float64 { |
|
|
|
|
|
|
|
return setting.RadarMap.GrowthCodeLines*float64(codelinesGrowth) + |
|
|
|
func GetRepoGrowthInitValue(codeLinesGrowth int64, issueGrowth int64, commitsGrowth int64, newContributors int64, commentsGrowth int64) float64 { |
|
|
|
codeLinesKB := codeLinesGrowth / 1000 |
|
|
|
if codeLinesKB > MAX_LINES_RECORD { |
|
|
|
codeLinesKB = MAX_LINES_RECORD |
|
|
|
} |
|
|
|
return setting.RadarMap.GrowthCodeLines*float64(codeLinesKB) + |
|
|
|
setting.RadarMap.GrowthIssue*float64(issueGrowth) + |
|
|
|
setting.RadarMap.GrowthCommit*float64(commitsGrowth) + |
|
|
|
setting.RadarMap.GrowthContributors*float64(newContributors) + |
|
|
|