refactor: cleanup variables namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 8 May 2023 23:25:01 +0000 (01:25 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 8 May 2023 23:25:01 +0000 (01:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/Utils.ts

index be372de697f43b384a6929a14884567fa23b72d0..37f7691198771bdb7832bad6553afa7bac6a7138 100644 (file)
@@ -366,15 +366,15 @@ export class Utils {
       return sortedDataSet[sortedDataSet.length - 1];
     }
     const percentileIndexBase = (percentile / 100) * (sortedDataSet.length - 1);
-    const percentileIntegerIndex = Math.floor(percentileIndexBase);
-    if (!Utils.isNullOrUndefined(sortedDataSet[percentileIntegerIndex + 1])) {
+    const percentileIndexInteger = Math.floor(percentileIndexBase);
+    if (!Utils.isNullOrUndefined(sortedDataSet[percentileIndexInteger + 1])) {
       return (
-        sortedDataSet[percentileIntegerIndex] +
-        (percentileIndexBase - percentileIntegerIndex) *
-          (sortedDataSet[percentileIntegerIndex + 1] - sortedDataSet[percentileIntegerIndex])
+        sortedDataSet[percentileIndexInteger] +
+        (percentileIndexBase - percentileIndexInteger) *
+          (sortedDataSet[percentileIndexInteger + 1] - sortedDataSet[percentileIndexInteger])
       );
     }
-    return sortedDataSet[percentileIntegerIndex];
+    return sortedDataSet[percentileIndexInteger];
   }
 
   public static stdDeviation(dataSet: number[]): number {