Closed Olivier-Descout closed 1 year ago
Yes you are right , following a pull request , i worked on a correction regarding this topic a year ago and never merged it : https://github.com/cnumr/GreenIT-Analysis/commit/350ca5a16df4102edbac1531160d31d5632b997b
I will have a look
Thanks Olivier (and Rachel) for this point. IT's obvious we should implent this patch asap. The good news is that this will have a negligeable side effect to already computed EcoIndex evaluation.
The patch is integrated in release 3.1.0 available on chrome web store and firefox add ons
Merci !
Le sam., sept. 10, 2022 à 18:04, @.***> a écrit:
The patch is integrated in release 3.1.0 available on chrome web store and firefox add ons
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Hi, I suspect there is an issue (or an inconsistency against the Ecoindex specification) in the current EcoIndex implementation located in the file
ecoIndex.js
.As it is currently computed, EcoIndex value is between -5 and 94 rather than between 0 and 99 :
<html></html>
containing 3 DOM objects (page + empty header + empty body), generating 1 HTTP request and being 13-byte long) gets an EcoIndex equal to 94.00 (if rounded to 2 digits after the decimal point).Rachel Pellin's EcoIndex simulator (https://rachelwe.github.io/Simulateur-ecoindex/), which uses
ecoIndex.js
current implementation, helps highligting this behaviour:In my opinion, the issue lies in the
calculateIndex
function, which should return:return ((i - 1) + (value - quantiles[i - 1]) / (quantiles[i] - quantiles[i - 1]));
andreturn quantiles.length - 1;
instead of:return (i + (value - quantiles[i - 1]) / (quantiles[i] - quantiles[i - 1]));
andreturn quantiles.length;
If such a change were to be made, the grade computation would obviously have to be also altered, by adding 5 to every threshold:
case score >= 80: return 'A';
// instead of 75case score >= 70: return 'B';
// instead of 65...
case score >= 10: return 'F';
// instead of 5Best Regards, Olivier Descout