Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 26, 2021
1 parent 7a7045b commit 2cc66dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stats/outliers.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ const getThresholdsIndexes = function (quantiles, quantilesCount) {
const reversedQuantiles = [...quantiles].reverse()
const outliersLimit = getOutliersLimit(quantilesCount)

const outliersThresholds = getOutliersThresholds()
return outliersThresholds.reduce(
return OUTLIERS_THRESHOLDS.reduce(
(thresholdsIndexes, outliersThreshold) =>
getThresholdIndexes(thresholdsIndexes, outliersThreshold, {
quantiles,
Expand Down Expand Up @@ -382,6 +381,8 @@ const getOutliersThreshold = function (_, index) {
return THRESHOLDS_BASE * THRESHOLDS_FACTOR ** thresholdExponent
}

const OUTLIERS_THRESHOLDS = getOutliersThresholds()

// Compute the final outliersMin|outliersMax percentage
const computePercentage = function (outliersIndexSum, quantilesCount) {
const outliersIndexMean = outliersIndexSum / THRESHOLDS_COUNT
Expand Down

0 comments on commit 2cc66dc

Please sign in to comment.