drhenner/ror_ecommerce

View on GitHub
app/assets/javascripts/admin/jquery.orbit-1.4.0.js

Summary

Maintainability
F
5 days
Test Coverage

File jquery.orbit-1.4.0.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery Orbit Plugin 1.4.0
 * www.ZURB.com/playground
 * Copyright 2010, ZURB
 * Free to use under the MIT license.
Severity: Major
Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 day to fix

    Function shift has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        shift: function (direction) {
          var slideDirection = direction;
    
          //remember previous activeSlide
          this.prevActiveSlide = this.activeSlide;
    Severity: Major
    Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 4 hrs to fix

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

          init: function (element, options) {
            var $imageSlides,
                imagesLoadedCount = 0,
                self = this;
      
      
      Severity: Minor
      Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

        Function setDimentionsFromLargestSlide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setDimentionsFromLargestSlide: function () {
              //Collect all slides and set slider size of largest image
              var self = this,
                  $fluidPlaceholder;
        
        
        Severity: Minor
        Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

          Function setCaption has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              setCaption: function () {
                var captionLocation = this.currentSlide().attr('data-caption'),
                    captionHTML;
          
                if (!this.options.captions) {
          Severity: Minor
          Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

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

                    if (this.options.animation == "vertical-slide") {
                      if (slideDirection == "prev") {
                        this.$slides
                          .eq(this.activeSlide)
                          .css({"top": this.orbitHeight, "z-index" : 3})
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 491..504

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

            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.options.animation == "horizontal-slide") {
                      if (slideDirection == "next") {
                        this.$slides
                          .eq(this.activeSlide)
                          .css({"left": this.orbitWidth, "z-index" : 3})
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 507..520

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

            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.$wrapper.find('.right').click(function () {
                    self.stopClock();
                    if (self.options.resetTimerOnClick) {
                      self.rotateTimer(true);
                      self.startClock();
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 372..379

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

            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.$wrapper.find('.left').click(function () {
                    self.stopClock();
                    if (self.options.resetTimerOnClick) {
                      self.rotateTimer(true);
                      self.startClock();
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 381..388

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

            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

                    switch (this.options.captionAnimation) {
                      case 'none':
                        this.$caption.hide();
                        break;
                      case 'fade':
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 336..346

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

            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

                    switch (this.options.captionAnimation) {
                      case 'none':
                        this.$caption.show();
                        break;
                      case 'fade':
            Severity: Major
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 349..359

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

            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

                  self.$element.add(self.$wrapper).width(this.$slides.first().width());
            Severity: Minor
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 157..157

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

            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

                  self.$element.add(self.$wrapper).height(this.$slides.first().height());
            Severity: Minor
            Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 156..156

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

            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