Files
dsabot/functions/CalculateQuality.js
TobenderZephyr d45e4faad6 Security fixes (#32)
* Generic Object Injection Sink

* (fix) "Character" is not defined.

* added eslint

* improve code quality, use refactored function

* (fix) eslint jest

* "Character" is not defined

* removed unused file Compare.js

* (fix) PointsUsed is not defined

* (fix) eslint moans jsconfig

* turn off "no-prototype-builtins"

* push code coverage
2021-05-01 20:13:15 +02:00

10 lines
428 B
JavaScript

const CalculateQuality = (PointsAvailable = 0) => {
if (PointsAvailable <= 3) return 1;
else if (PointsAvailable > 3 && PointsAvailable <= 6) return 2;
else if (PointsAvailable > 6 && PointsAvailable <= 9) return 3;
else if (PointsAvailable > 9 && PointsAvailable <= 12) return 4;
else if (PointsAvailable > 12 && PointsAvailable <= 15) return 5;
else return 6;
};
module.exports = { CalculateQuality };