seiyria/bootstrap-slider

View on GitHub

Showing 27 of 62 total issues

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 Modernizr has 605 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.8.3',
    
        Modernizr = {},
    Severity: Major
    Found in dependencies/js/modernizr.js - About 3 days to fix

      Function Modernizr has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
      Open

      window.Modernizr = (function( window, document, undefined ) {
      
          var version = '2.8.3',
      
          Modernizr = {},
      Severity: Minor
      Found in dependencies/js/modernizr.js - About 2 days to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      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 exports has 307 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(grunt) {
        
          var packageJSON = grunt.file.readJSON('package.json');
          var bumpFiles = ["package.json", "bower.json", "composer.json"];
          var commitFiles = bumpFiles.concat(["./dist/*"]);
        Severity: Major
        Found in Gruntfile.js - About 1 day to fix

          File modernizr.js has 607 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * Modernizr v2.8.3
           * www.modernizr.com
           *
           * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
          Severity: Major
          Found in dependencies/js/modernizr.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

              File Gruntfile.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*global module:false*/
              module.exports = function(grunt) {
              
                var packageJSON = grunt.file.readJSON('package.json');
                var bumpFiles = ["package.json", "bower.json", "composer.json"];
              Severity: Minor
              Found in Gruntfile.js - About 3 hrs 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 webforms has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function webforms() {
                                      /*>>input*/
                                      // Run through HTML5's new input attributes to see if the UA understands any.
                                      // We're using f which is the <input> element created early on
                                      // Mike Taylr has created a comprehensive resource for testing these attributes
                              Severity: Minor
                              Found in dependencies/js/modernizr.js - About 1 hr to fix

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

                                    injectElementWithStyles = function( rule, callback, nodes, testnames ) {
                                
                                      var style, ret, node, docOverflow,
                                          div = document.createElement('div'),
                                          // After page load injecting a fake body doesn't work so check if body exists
                                Severity: Minor
                                Found in dependencies/js/modernizr.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

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

                                            Function.prototype.bind = function bind(that) {
                                      
                                              var target = this;
                                      
                                              if (typeof target != "function") {
                                      Severity: Minor
                                      Found in dependencies/js/modernizr.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language