seiyria/bootstrap-slider

View on GitHub

Showing 27 of 62 total issues

Function isEventSupported has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    isEventSupported = (function() {

      var TAGNAMES = {
        'select': 'input', 'change': 'input',
        'submit': 'form', 'reset': 'form',
Severity: Minor
Found in dependencies/js/modernizr.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
                Severity
                Category
                Status
                Source
                Language