Skip to content

Commit

Permalink
Cyberleague: [premieroctet#159] improve readability of ratio computin…
Browse files Browse the repository at this point in the history
…g code in statistic.js
  • Loading branch information
Bastien-Wappizy committed Oct 15, 2024
1 parent d792aa6 commit 45d73a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/web/server/plugins/cyberleague/statistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ const computeBellwetherStatistics = async (filters) => {

//Compute ratios for bellwether / benchmark
fields.forEach((field) => {

//Adapt value of field that need to be in [0,10]
if (lodash.includes(BENCHMARK_FIELDS_10, field)) {
res[field] = Math.round(bellwetherData[field].value / bellwetherData[field].count * 10)

//Adapt value of field that need to be in [0,5]
} else if (lodash.includes(BENCHMARK_FIELDS_5, field)) {
res[field] = Math.round(bellwetherData[field].value / bellwetherData[field].count * 5)
} else {
Expand Down

0 comments on commit 45d73a0

Please sign in to comment.