calblueprint/ashby-village

View on GitHub
app/assets/javascripts/jquery.joyride-2.1.js

Summary

Maintainability
F
6 days
Test Coverage

File jquery.joyride-2.1.js has 726 lines of code (exceeds 250 allowed). Consider refactoring.
Open

  /*
 * jQuery Foundation Joyride Plugin 2.1
 * http://foundation.zurb.com
 * Copyright 2013, ZURB
 * Free to use under the MIT license.
Severity: Major
Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 day to fix

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

          init : function (opts) {
            return this.each(function () {
    
              if ($.isEmptyObject(settings)) {
                settings = $.extend(true, defaults, opts);
    Severity: Major
    Found in app/assets/javascripts/jquery.joyride-2.1.js - About 3 hrs to fix

      Function show has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            show : function (init) {
              var opts = {}, ii, opts_arr = [], opts_len = 0, p,
                  $timer = null;
      
              // are we paused?
      Severity: Major
      Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

        Function pos_default has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              pos_default : function (init) {
                var half_fold = Math.ceil(settings.$window.height() / 2),
                    tip_position = settings.$next_tip.offset(),
                    $nub = $('.joyride-nub', settings.$next_tip),
                    nub_width = Math.ceil($nub.outerWidth() / 2),
        Severity: Major
        Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

          Function expose has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                expose: function(){
                  var expose,
                    exposeCover,
                    el,
                    origCSS,
          Severity: Major
          Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

            Function un_expose has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  un_expose: function(){
                    var exposeId,
                      el,
                      expose ,
                      origCSS,
            Severity: Minor
            Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 hr to fix

              Function pos_phone has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    pos_phone : function (init) {
                      var tip_height = settings.$next_tip.outerHeight(),
                          tip_offset = settings.$next_tip.offset(),
                          target_height = settings.$target.outerHeight(),
                          $nub = $('.joyride-nub', settings.$next_tip),
              Severity: Minor
              Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                              if (settings.timer > 0) {
                
                                settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
                
                                settings.$next_tip.show();
                Severity: Major
                Found in app/assets/javascripts/jquery.joyride-2.1.js - About 45 mins to fix

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

                              if (settings.$li.next().length < 1) {
                              methods.end();
                              } else if (settings.timer > 0) {
                              clearTimeout(settings.automate);
                              methods.hide();
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 4 hrs to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 116..126

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

                  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

                                if (settings.$li.next().length < 1) {
                                  methods.end();
                                } else if (settings.timer > 0) {
                                  clearTimeout(settings.automate);
                                  methods.hide();
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 4 hrs to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 166..176

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

                  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

                          if (arguments.length>0 && arguments[0] instanceof $){
                            el = arguments[0];
                          } else if(settings.$target && !/body/i.test(settings.$target.selector)){
                            el = settings.$target;
                          }  else {
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 674..680

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

                  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

                          if (arguments.length>0 && arguments[0] instanceof $){
                            el = arguments[0];
                          } else if(settings.$target && !/body/i.test(settings.$target.selector)){
                            el = settings.$target;
                          }  else {
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 619..625

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

                  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

                          exposeCover.css({
                            top: el.offset().top,
                            left: el.offset().left,
                            width: el.outerWidth(true),
                            height: el.outerHeight(true)
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 634..639

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

                  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

                          expose.css({
                            top: el.offset().top,
                            left: el.offset().left,
                            width: el.outerWidth(true),
                            height: el.outerHeight(true)
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 650..655

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

                  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

                            if (!settings.startTimerOnClick && settings.timer > 0) {
                              methods.show('init');
                              methods.startTimer();
                            } else {
                              methods.show('init');
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 103..108

                  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

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

                                  if (!settings.startTimerOnClick && settings.timer > 0) {
                                    methods.show('init');
                                    methods.startTimer();
                                  } else {
                                    methods.show('init');
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 449..454

                  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

                            } else {
                  
                              settings.$next_tip.offset({top: settings.$target.offset().top + target_height + nub_height});
                              $nub.addClass('top');
                  
                  
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 569..574

                  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

                            if (methods.top()) {
                  
                                settings.$next_tip.offset({top: settings.$target.offset().top - tip_height - nub_height});
                                $nub.addClass('bottom');
                  
                  
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 574..579

                  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

                  There are no issues that match your filters.

                  Category
                  Status