SysMO-DB/seek

View on GitHub
app/assets/javascripts/jquery.bxslider.js

Summary

Maintainability
F
1 wk
Test Coverage

Function bxSlider has 723 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.bxSlider = function(options){

        if(this.length == 0) return this;

        // support mutltiple elements
Severity: Major
Found in app/assets/javascripts/jquery.bxslider.js - About 3 days to fix

    File jquery.bxslider.js has 784 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * BxSlider v4.1.1 - Fully loaded, responsive content slider
     * http://bxslider.com
     *
     * Copyright 2013, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
    Severity: Major
    Found in app/assets/javascripts/jquery.bxslider.js - About 1 day to fix

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

              el.goToSlide = function(slideIndex, direction){
                  // if plugin is currently in motion, ignore request
                  if(slider.working || slider.active.index == slideIndex) return;
                  // declare that plugin is in motion
                  slider.working = true;
      Severity: Major
      Found in app/assets/javascripts/jquery.bxslider.js - About 2 hrs to fix

        Function setup has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var setup = function(){
                    // wrap el in a wrapper
                    el.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>');
                    // store a namspace reference to .bx-viewport
                    slider.viewport = el.parent();
        Severity: Major
        Found in app/assets/javascripts/jquery.bxslider.js - About 2 hrs to fix

          Function setPositionProperty has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var setPositionProperty = function(value, type, duration, params){
                      // use CSS transform
                      if(slider.usingCSS){
                          // determine the translate3d value
                          var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
          Severity: Minor
          Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

            Function init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var init = function(){
                        // merge user-supplied options with the defaults
                        slider.settings = $.extend({}, defaults, options);
                        // parse slideWidth setting
                        slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
            Severity: Minor
            Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

              Function getViewportHeight has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      var getViewportHeight = function(){
                          var height = 0;
                          // first determine which children (slides) should be used in our height calculation
                          var children = $();
                          // if mode is not "vertical" and adaptiveHeight is false, include all children
              Severity: Minor
              Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

                Function onTouchEnd has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var onTouchEnd = function(e){
                            slider.viewport.unbind('touchmove', onTouchMove);
                            var orig = e.originalEvent;
                            var value = 0;
                            // record end x, y positions
                Severity: Minor
                Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

                  Function initTicker has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          var initTicker = function(){
                              var startPosition = 0;
                              // if autoDirection is "next", append a clone of the entire slider
                              if(slider.settings.autoDirection == 'next'){
                                  el.append(slider.children.clone().addClass('bx-clone'));
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

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

                            var clickPrevBind = function(e){
                                // if auto show is running, stop it
                                if (slider.settings.auto) el.stopAuto();
                                el.goToPrevSlide();
                                e.preventDefault();
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 700..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 61.

                    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

                            var clickNextBind = function(e){
                                // if auto show is running, stop it
                                if (slider.settings.auto) el.stopAuto();
                                el.goToNextSlide();
                                e.preventDefault();
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 713..718

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

                    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

                                slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 141..141

                    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

                                slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 140..140

                    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

                                    }else{
                                        distance = slider.touch.end.y - slider.touch.start.y;
                                        value = slider.touch.originalPos.top;
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 1037..1040

                    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(slider.settings.mode == 'horizontal'){
                                        distance = slider.touch.end.x - slider.touch.start.x;
                                        value = slider.touch.originalPos.left;
                                    }else{
                    Severity: Major
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 1040..1043

                    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

                                }else if(direction == 'prev'){
                                    slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
                                }
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 55 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 1114..1118

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

                    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(direction == 'next'){
                                    slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
                                }else if(direction == 'prev'){
                                    slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
                                }
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 55 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 1116..1118

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

                    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

                                slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 50 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 1113..1113

                    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

                                slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 50 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 804..804

                    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(slider.settings.prevSelector){
                                    $(slider.settings.prevSelector).append(slider.controls.prev);
                                }
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 45 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 632..634

                    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(slider.settings.nextSelector){
                                    $(slider.settings.nextSelector).append(slider.controls.next);
                                }
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 45 mins to fix
                    app/assets/javascripts/jquery.bxslider.js on lines 636..638

                    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

                    There are no issues that match your filters.

                    Category
                    Status