gonzedge/rambling-slider-rails

View on GitHub
app/assets/javascripts/jquery.rambling.slider.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.rambling.slider.js has 1335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery Rambling Slider v0.4.0
 * http://github.com/gonzedge/rambling.slider
 * http://ramblinglabs.com
 *
Severity: Major
Found in app/assets/javascripts/jquery.rambling.slider.js - About 3 days to fix

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

        $.fn.ramblingSlider = function() {
          var isCallingGetter, methodExists, options, optionsIsString, others, ramblingSlider, value;
          options = arguments[0], others = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
          methodExists = __indexOf.call(publicMethods, options) >= 0;
          optionsIsString = typeof options === 'string';
    Severity: Minor
    Found in app/assets/javascripts/jquery.rambling.slider.js - About 1 hr to fix

      Function getRamblingBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          RamblingBoxer.prototype.getRamblingBox = function(boxWidth, boxHeight, row, column, settings, vars) {
      Severity: Minor
      Found in app/assets/javascripts/jquery.rambling.slider.js - About 45 mins to fix

        Function getRamblingSlice has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            RamblingSlicer.prototype.getRamblingSlice = function(sliceWidth, position, total, slideElement, settings) {
        Severity: Minor
        Found in app/assets/javascripts/jquery.rambling.slider.js - About 35 mins to fix

          Function getBox has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              RamblingBoxer.prototype.getBox = function(boxWidth, boxHeight, row, column, settings) {
          Severity: Minor
          Found in app/assets/javascripts/jquery.rambling.slider.js - About 35 mins to fix

            Avoid too many return statements within this function.
            Open

                        return settings[option];
            Severity: Major
            Found in app/assets/javascripts/jquery.rambling.slider.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return settings[option] = value;
              Severity: Major
              Found in app/assets/javascripts/jquery.rambling.slider.js - About 30 mins to fix

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

                    allAroundTransitions.suffixes = [
                      {
                        name: 'Right',
                        sorter: void 0
                      }, {
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1202..1219

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

                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

                    boxTransitions.suffixes = [
                      {
                        name: 'Forward',
                        sorter: void 0
                      }, {
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1175..1192

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

                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

                      slideDownSlices = function(sortCallback) {
                        return animateSlices((function(index, element) {
                          this.css({
                            top: 0
                          });
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1003..1013

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

                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

                      slideUpSlices = function(sortCallback) {
                        return animateSlices((function(index, element) {
                          this.css({
                            bottom: 0
                          });
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 992..1002

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

                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

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

                      for (_i = 0, _len = this.length; _i < _len; _i++) {
                        element = this[_i];
                        if (predicate(element)) {
                          _results.push(element);
                        }
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 37..42

                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

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

                    for (_i = 0, _len = this.length; _i < _len; _i++) {
                      element = this[_i];
                      if (predicate(element)) {
                        _results.push(element);
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 56..61

                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

                      fadeOut: function(slider) {
                        this.css({
                          height: '100%',
                          width: slider.width(),
                          position: 'absolute',
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1222..1233

                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

                      fadeIn: function(slider) {
                        this.css({
                          height: '100%',
                          width: slider.width(),
                          position: 'absolute',
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1234..1245

                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

                    function RamblingSliceGenerator(slider, settings, vars) {
                      this.slider = slider;
                      this.settings = settings;
                      this.vars = vars;
                      this.slicer = new RamblingSlicer(this.slider);
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 182..187

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

                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

                    function RamblingBoxGenerator(slider, settings, vars) {
                      this.slider = slider;
                      this.settings = settings;
                      this.vars = vars;
                      this.boxer = new RamblingBoxer(this.slider);
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 273..278

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

                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

                      for (i = _i = 0; 0 <= slices ? _i < slices : _i > slices; i = 0 <= slices ? ++_i : --_i) {
                        _fn(i);
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 113..115
                app/assets/javascripts/jquery.rambling.slider.js on lines 211..213

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

                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

                      for (row = _i = 0; 0 <= boxRows ? _i < boxRows : _i > boxRows; row = 0 <= boxRows ? ++_i : --_i) {
                        _fn(row);
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 113..115
                app/assets/javascripts/jquery.rambling.slider.js on lines 301..303

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

                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

                    for (i = _i = 0; 0 <= halfLength ? _i < halfLength : _i > halfLength; i = 0 <= halfLength ? ++_i : --_i) {
                      _fn(i);
                    }
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 211..213
                app/assets/javascripts/jquery.rambling.slider.js on lines 301..303

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

                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

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

                        this.find('img').css({
                          left: -slider.width()
                        }).animate({
                          left: 0
                        }, settings.speed * 2);
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1261..1265

                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

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

                        this.find('img').css({
                          left: -slider.width()
                        }).animate({
                          left: 0
                        }, settings.speed * 2);
                Severity: Major
                Found in app/assets/javascripts/jquery.rambling.slider.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.rambling.slider.js on lines 1276..1280

                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

                There are no issues that match your filters.

                Category
                Status