Skip to content

Commit

Permalink
Fix codeclimate warning
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 14, 2019
1 parent 30157ba commit 55bcece
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/core/core.scale.js
Expand Up @@ -237,13 +237,15 @@ function calculateSpacing(majorIndices, ticks, axisLength, ticksLimit) {

// If the major ticks are evenly spaced apart, place the minor ticks
// so that they divide the major ticks into even chunks
if (evenMajorSpacing) {
factors = helpers.math._factorize(evenMajorSpacing);
for (i = 0, ilen = factors.length - 1; i < ilen; i++) {
factor = factors[i];
if (factor > spacing) {
return factor;
}
if (!evenMajorSpacing) {
return Math.max(spacing, 1);
}

factors = helpers.math._factorize(evenMajorSpacing);
for (i = 0, ilen = factors.length - 1; i < ilen; i++) {
factor = factors[i];
if (factor > spacing) {
return factor;
}
}
return Math.max(spacing, 1);
Expand Down

0 comments on commit 55bcece

Please sign in to comment.