Skip to content

Commit 26dbdde

Browse files
authored
fix: health score calculations (#3668)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 9b324fc commit 26dbdde

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

services/libs/tinybird/pipes/health_score_copy.pipe

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,19 @@ SQL >
114114
SELECT
115115
*,
116116
round(
117-
100.0 * arraySum(contributorBenchmarks) / (5 * length(contributorBenchmarks))
117+
100.0
118+
* arraySum(contributorBenchmarks)
119+
/ if(length(contributorBenchmarks) = 0, 1, 5 * length(contributorBenchmarks))
118120
) AS contributorPercentage,
119121
round(
120-
100.0 * arraySum(popularityBenchmarks) / (5 * length(popularityBenchmarks))
122+
100.0
123+
* arraySum(popularityBenchmarks)
124+
/ if(length(popularityBenchmarks) = 0, 1, 5 * length(popularityBenchmarks))
121125
) AS popularityPercentage,
122126
round(
123-
100.0 * arraySum(developmentBenchmarks) / (5 * length(developmentBenchmarks))
127+
100.0
128+
* arraySum(developmentBenchmarks)
129+
/ if(length(developmentBenchmarks) = 0, 1, 5 * length(developmentBenchmarks))
124130
) AS developmentPercentage,
125131
round(
126132
(contributorPercentage + popularityPercentage + developmentPercentage + securityPercentage)

0 commit comments

Comments
 (0)