fiedl/wingolfsplattform

View on GitHub
public/commander/foundation-5/js/foundation/foundation.joyride.js

Summary

Maintainability
F
2 mos
Test Coverage

File foundation.joyride.js has 732 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function ($, window, document, undefined) {
  'use strict';

  var Modernizr = Modernizr || false;

Severity: Major
Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 1 day to fix

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

        show : function (init, is_prev) {
          var $timer = null;
    
          // are we paused?
          if (this.settings.$li === undefined || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
    Severity: Major
    Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 2 hrs to fix

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

          pos_default : function (init) {
            var $nub = this.settings.$next_tip.find('.joyride-nub'),
                nub_width = Math.ceil($nub.outerWidth() / 2),
                nub_height = Math.ceil($nub.outerHeight() / 2),
                toggle = init || false;
      Severity: Major
      Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 2 hrs to fix

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

            expose : function () {
              var expose,
                  exposeCover,
                  el,
                  origCSS,
        Severity: Major
        Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 2 hrs to fix

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

              events : function () {
                var self = this;
          
                $(this.scope)
                  .off('.joyride')
          Severity: Major
          Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 2 hrs to fix

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

                un_expose : function () {
                  var exposeId,
                      el,
                      expose,
                      origCSS,
            Severity: Minor
            Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 1 hr to fix

              Function start has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  start : function () {
                    var self = this,
                        $this = $('[' + this.attr_name() + ']', this.scope),
                        integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
                        int_settings_count = integer_settings.length;
              Severity: Minor
              Found in public/commander/foundation-5/js/foundation/foundation.joyride.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 = this.settings.$next_tip.outerHeight(),
                          tip_offset = this.settings.$next_tip.offset(),
                          target_height = this.settings.$target.outerHeight(),
                          $nub = $('.joyride-nub', this.settings.$next_tip),
                Severity: Minor
                Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (this.settings.timer > 0) {
                  
                                this.settings.$next_tip
                                  .fadeIn(this.settings.tip_animation_fade_speed)
                                  .show();
                  Severity: Major
                  Found in public/commander/foundation-5/js/foundation/foundation.joyride.js - About 45 mins to fix

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

                    ;(function ($, window, document, undefined) {
                      'use strict';
                    
                      var Modernizr = Modernizr || false;
                    
                    
                    public/commander/foundation-5/js/foundation.min.js on lines 1007..1938

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

                    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