seiyria/bootstrap-slider

View on GitHub
src/js/bootstrap-slider.js

Summary

Maintainability
F
1 wk
Test Coverage

File bootstrap-slider.js has 1624 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! =========================================================
 * bootstrap-slider.js
 *
 * Maintainers:
 *        Kyle Kemp
Severity: Major
Found in src/js/bootstrap-slider.js - About 4 days to fix

    Function createNewSlider has 372 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function createNewSlider(element, options) {
    
                /*
                    The internal state object is used to store data about the current 'state' of slider.
                    This includes values such as the `value`, `enabled`, etc...
    Severity: Major
    Found in src/js/bootstrap-slider.js - About 1 day to fix

      Function _layout has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  _layout: function() {
                      var positionPercentages;
                      var formattedValue;
      
                      if(this.options.reversed) {
      Severity: Major
      Found in src/js/bootstrap-slider.js - About 1 day to fix

        Function _keydown has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    _keydown: function(handleIdx, ev) {
                        if(!this._state.enabled) {
                            return false;
                        }
        
        
        Severity: Major
        Found in src/js/bootstrap-slider.js - About 2 hrs to fix

          Function defineBridget has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function defineBridget( $ ) {
          
                      // bail if no jQuery
                      if ( !$ ) {
                          return;
          Severity: Major
          Found in src/js/bootstrap-slider.js - About 2 hrs to fix

            Function setValue has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        setValue: function(val, triggerSlideEvent, triggerChangeEvent) {
                            if (!val) {
                                val = 0;
                            }
                            var oldValue = this.getValue();
            Severity: Major
            Found in src/js/bootstrap-slider.js - About 2 hrs to fix

              Function _removeSliderEventHandlers has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          _removeSliderEventHandlers: function() {
                              // Remove keydown event listeners
                              this.handle1.removeEventListener("keydown", this.handle1Keydown, false);
                              this.handle2.removeEventListener("keydown", this.handle2Keydown, false);
              
              
              Severity: Major
              Found in src/js/bootstrap-slider.js - About 2 hrs to fix

                Function _mousedown has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            _mousedown: function(ev) {
                                if(!this._state.enabled) {
                                    return false;
                                }
                
                
                Severity: Minor
                Found in src/js/bootstrap-slider.js - About 1 hr to fix

                  Function bridge has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function bridge( namespace, PluginClass ) {
                                // add to jQuery fn namespace
                                $.fn[ namespace ] = function( options ) {
                                  if ( typeof options === 'string' ) {
                                    // call plugin method when first argument is a string
                  Severity: Minor
                  Found in src/js/bootstrap-slider.js - About 1 hr to fix

                    Function namespace has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                  $.fn[ namespace ] = function( options ) {
                                    if ( typeof options === 'string' ) {
                                      // call plugin method when first argument is a string
                                      // get arguments for method
                                      var args = slice.call( arguments, 1 );
                    Severity: Minor
                    Found in src/js/bootstrap-slider.js - About 1 hr to fix

                      Function _addTickListener has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  _addTickListener: function _addTickListener() {
                                      return {
                                          addMouseEnter: function(reference, element, index){
                                              var enter = function(){
                                                  let tempState = reference._copyState();
                      Severity: Minor
                      Found in src/js/bootstrap-slider.js - About 1 hr to fix

                        Function _setTooltipPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    _setTooltipPosition: function(){
                                        var tooltips = [this.tooltip, this.tooltip_min, this.tooltip_max];
                                        if (this.options.orientation === 'vertical'){
                                            var tooltipPos;
                                            if(this.options.tooltip_position) {
                        Severity: Minor
                        Found in src/js/bootstrap-slider.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (this.options.selection === 'after' && percentage >= positionPercentages[0]) {
                                                              this._addClass(this.tickLabels[i], 'label-in-selection');
                                                          } else if (this.options.selection === 'before' && percentage <= positionPercentages[0]) {
                                                              this._addClass(this.tickLabels[i], 'label-in-selection');
                                                          }
                          Severity: Major
                          Found in src/js/bootstrap-slider.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (percentage === positionPercentages[0]) {
                                                                this._addClass(this.tickLabels[i], 'label-is-selection');
                                                            }
                            Severity: Major
                            Found in src/js/bootstrap-slider.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                              if (this.tickLabelContainer.childNodes[i].offsetHeight > extraMargin) {
                                                                  extraMargin = this.tickLabelContainer.childNodes[i].offsetHeight;
                                                              }
                              Severity: Major
                              Found in src/js/bootstrap-slider.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if(this.options.rtl){
                                                                    this.tickLabels[i].style['marginRight'] = `${this.sliderElem.offsetWidth }px`;
                                                                }else{
                                                                    this.tickLabels[i].style['marginLeft'] = `${this.sliderElem.offsetWidth }px`;
                                                                }
                                Severity: Major
                                Found in src/js/bootstrap-slider.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              } else if (percentage >= positionPercentages[0] && percentage <= positionPercentages[1]) {
                                                                  this._addClass(this.tickLabels[i], 'label-in-selection');
                                                                  if (percentage === positionPercentages[0] || positionPercentages[1]) {
                                                                      this._addClass(this.tickLabels[i], 'label-is-selection');
                                                                  }
                                  Severity: Major
                                  Found in src/js/bootstrap-slider.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if(this.options.rtl){
                                                                        this.rangeHighlightElements[i].style.right = `${currentRange.start}%`;
                                                                    } else {
                                                                        this.rangeHighlightElements[i].style.left = `${currentRange.start}%`;
                                                                    }
                                    Severity: Major
                                    Found in src/js/bootstrap-slider.js - About 45 mins to fix

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                                      if (this.options.selection === 'after' && percentage >= positionPercentages[0]) {
                                                                          this._addClass(this.tickLabels[i], 'label-in-selection');
                                                                      } else if (this.options.selection === 'before' && percentage <= positionPercentages[0]) {
                                                                          this._addClass(this.tickLabels[i], 'label-in-selection');
                                                                      }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 3 hrs to fix
                                      src/js/bootstrap-slider.js on lines 1416..1420

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 103.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                                  if (this.options.selection === 'after' && percentage >= positionPercentages[0]){
                                                                      this._addClass(this.ticks[i], 'in-selection');
                                                                  } else if (this.options.selection === 'before' && percentage <= positionPercentages[0]) {
                                                                      this._addClass(this.ticks[i], 'in-selection');
                                                                  }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 3 hrs to fix
                                      src/js/bootstrap-slider.js on lines 1444..1448

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 103.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          this.trackHigh.style.width = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1494..1494

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 68.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          this.trackHigh.style.height = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1516..1516

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 68.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          this._state.value[1] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[1]));
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 943..943

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 65.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          this._state.value[0] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[0]));
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 944..944

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 65.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          else if (this._state.keyCtrl === 0 && (this._toPercentage(this._state.value[1]) < percentage)) {
                                                              this._state.percentage[0] = this._state.percentage[1];
                                                              this._state.keyCtrl = 1;
                                                              this.handle2.focus();
                                                          }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1790..1794

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 64.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          else if (this._state.keyCtrl === 1 && (this._toPercentage(this._state.value[0]) > percentage)) {
                                                              this._state.percentage[1] = this._state.percentage[0];
                                                              this._state.keyCtrl = 0;
                                                              this.handle1.focus();
                                                          }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1785..1794

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 64.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          if(this.stylePos==='right') {
                                                              this.trackLow.style.right = '0';
                                                          } else {
                                                              this.trackLow.style.left = '0';
                                                          }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1511..1515

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 57.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          if(this.stylePos==='right') {
                                                              this.trackHigh.style.left = '0';
                                                          } else {
                                                              this.trackHigh.style.right = '0';
                                                          }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 1 hr to fix
                                      src/js/bootstrap-slider.js on lines 1497..1501

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 57.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                      Open

                                                      if (this._state.inDrag === false && this._alwaysShowTooltip !== true) {
                                                          this._removeClass(this.tooltip, 'show');
                                                          this._removeClass(this.tooltip_min, 'show');
                                                          this._removeClass(this.tooltip_max, 'show');
                                                      }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 3 other locations - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 727..737
                                      src/js/bootstrap-slider.js on lines 733..737
                                      src/js/bootstrap-slider.js on lines 797..853

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 52.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                      Open

                                                  else if (this.options.selection === 'after' || this.options.selection === 'before') {
                                                      this._removeClass(this.trackLow, 'hide');
                                                      this._removeClass(this.trackSelection, 'hide');
                                                      this._removeClass(this.trackHigh, 'hide');
                                                  }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 3 other locations - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 727..737
                                      src/js/bootstrap-slider.js on lines 797..853
                                      src/js/bootstrap-slider.js on lines 1232..1236

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 52.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                      Open

                                                  if(this.options.tooltip === 'hide') {
                                                      this._addClass(this.tooltip, 'hide');
                                                      this._addClass(this.tooltip_min, 'hide');
                                                      this._addClass(this.tooltip_max, 'hide');
                                                  }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 3 other locations - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 727..737
                                      src/js/bootstrap-slider.js on lines 733..737
                                      src/js/bootstrap-slider.js on lines 1232..1236

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 52.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                      Open

                                                  if (this.options.selection === 'none') {
                                                      this._addClass(this.trackLow, 'hide');
                                                      this._addClass(this.trackSelection, 'hide');
                                                      this._addClass(this.trackHigh, 'hide');
                                                  }
                                      Severity: Major
                                      Found in src/js/bootstrap-slider.js and 3 other locations - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 733..737
                                      src/js/bootstrap-slider.js on lines 797..853
                                      src/js/bootstrap-slider.js on lines 1232..1236

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 52.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                              this._state.value[1] = this.options.ticks[this._getClosestTickIndex(this._state.value[1])];
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 939..939

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 51.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                              this._state.value[0] = this.options.ticks[this._getClosestTickIndex(this._state.value[0])];
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 50 mins to fix
                                      src/js/bootstrap-slider.js on lines 940..940

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 51.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          if (this._state.dragged === 0 && this._applyToFixedAndParseFloat(this._state.percentage[1], precision) < percentageWithAdjustedPrecision) {
                                                              this._state.percentage[0] = this._state.percentage[1];
                                                              this._state.dragged = 1;
                                                          } else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
                                                              this._state.percentage[1] = this._state.percentage[0];
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 45 mins to fix
                                      src/js/bootstrap-slider.js on lines 1781..1794

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 50.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                          } else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
                                                              this._state.percentage[1] = this._state.percentage[0];
                                                              this._state.dragged = 0;
                                                          }
                                                          else if (this._state.keyCtrl === 0 && (this._toPercentage(this._state.value[1]) < percentage)) {
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 45 mins to fix
                                      src/js/bootstrap-slider.js on lines 1778..1794

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 50.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (this.touchCapable) {
                                                          // Touch: Unbind touch event handlers:
                                                          document.removeEventListener("touchmove", this.mousemove, false);
                                                          document.removeEventListener("touchend", this.mouseup, false);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 40 mins to fix
                                      src/js/bootstrap-slider.js on lines 1616..1620

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 49.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (this.touchCapable) {
                                                          // Touch: Bind touch events:
                                                          document.addEventListener("touchmove", this.mousemove, false);
                                                          document.addEventListener("touchend", this.mouseup, false);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 40 mins to fix
                                      src/js/bootstrap-slider.js on lines 1806..1810

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 49.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (isLabelledbyArray && this.options.labelledby[1]) {
                                                          sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby[1]);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 509..511

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 47.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (isLabelledbyArray && this.options.labelledby[0]) {
                                                          sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby[0]);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 512..514

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 47.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                  if(this.options.orientation === "vertical" && (this.options.tooltip_position === "top" || this.options.tooltip_position === "bottom")) {
                                                      if(this.options.rtl) {
                                                          this.options.tooltip_position = "left";
                                                      }else{
                                                          this.options.tooltip_position = "right";
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 426..430

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 46.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                  else if(this.options.orientation === "horizontal" && (this.options.tooltip_position === "left" || this.options.tooltip_position === "right")) {
                                      
                                                      this.options.tooltip_position = "top";
                                      
                                                  }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 419..430

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 46.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                                          if (this.hideTooltip) {
                                                              this.handle1.removeEventListener("touchend", this.hideTooltip, false);
                                                              this.handle2.removeEventListener("touchend", this.hideTooltip, false);
                                                          }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 2 other locations - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 784..787
                                      src/js/bootstrap-slider.js on lines 1180..1183

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 46.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                                          if (this.showTooltip) {
                                                              this.sliderElem.removeEventListener("touchstart", this.showTooltip, false);
                                                              this.sliderElem.removeEventListener("touchmove", this.showTooltip, false);
                                                          }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 2 other locations - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 784..787
                                      src/js/bootstrap-slider.js on lines 1174..1177

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 46.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                      Open

                                                  if (this.touchCapable) {
                                                      this.sliderElem.addEventListener("touchstart", this.touchstart, false);
                                                      this.sliderElem.addEventListener("touchmove", this.touchmove, false);
                                                  }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 2 other locations - About 35 mins to fix
                                      src/js/bootstrap-slider.js on lines 1174..1177
                                      src/js/bootstrap-slider.js on lines 1180..1183

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 46.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (!isMaxSet) {
                                                          this.options.max = Math.max.apply(Math, this.options.ticks);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 30 mins to fix
                                      src/js/bootstrap-slider.js on lines 706..708

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                      if (!isMinSet) {
                                                          this.options.min = Math.min.apply(Math, this.options.ticks);
                                                      }
                                      Severity: Minor
                                      Found in src/js/bootstrap-slider.js and 1 other location - About 30 mins to fix
                                      src/js/bootstrap-slider.js on lines 703..705

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 45.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status