All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
22 lines
488 B
CoffeeScript
22 lines
488 B
CoffeeScript
$ ->
|
|
# run foundation scripts
|
|
console.log('Ready.')
|
|
|
|
averageResults = (results, decimals = 2) ->
|
|
avgScore = 0
|
|
minScore = Infinity
|
|
maxScore = -Infinity
|
|
|
|
factor = (10 ^ decimals)
|
|
|
|
for result in results
|
|
avgScore += result.avg_score
|
|
minScore = Math.min(minScore, result.min_score)
|
|
maxScore = Math.max(maxScore, result.max_score)
|
|
|
|
return {
|
|
avgScore: Math.round((avgScore / results.length) * factor) / factor,
|
|
minScore: minScore,
|
|
maxScore: maxScore,
|
|
}
|