seiyria/bootstrap-slider

View on GitHub

Showing 62 of 62 total issues

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

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

    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

    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

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

            tests['svgclippaths'] = function() {
                return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
            };
        Severity: Major
        Found in dependencies/js/modernizr.js and 1 other location - About 1 hr to fix
        dependencies/js/modernizr.js on lines 833..835

        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 59.

        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

            tests['smil'] = function() {
                return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
            };
        Severity: Major
        Found in dependencies/js/modernizr.js and 1 other location - About 1 hr to fix
        dependencies/js/modernizr.js on lines 842..844

        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 59.

        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

        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

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

              tests['localstorage'] = function() {
                  try {
                      localStorage.setItem(mod, mod);
                      localStorage.removeItem(mod);
                      return true;
          Severity: Major
          Found in dependencies/js/modernizr.js and 1 other location - About 1 hr to fix
          dependencies/js/modernizr.js on lines 798..806

          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 58.

          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

              tests['sessionstorage'] = function() {
                  try {
                      sessionStorage.setItem(mod, mod);
                      sessionStorage.removeItem(mod);
                      return true;
          Severity: Major
          Found in dependencies/js/modernizr.js and 1 other location - About 1 hr to fix
          dependencies/js/modernizr.js on lines 788..796

          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 58.

          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

          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

            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

            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

              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

                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

                Severity
                Category
                Status
                Source
                Language