peterhudec/authomatic

View on GitHub
examples/gae/showcase/static/js/foundation/foundation.joyride.js

Summary

Maintainability
F
3 days
Test Coverage

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

/*jslint unparam: true, browser: true, indent: 2 */

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

Severity: Minor
Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 7 hrs to fix

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

        show : function (init) {
          var $timer = null;
    
          // are we paused?
          if (this.settings.$li === undefined
    Severity: Major
    Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 2 hrs to fix

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

          pos_default : function (init) {
            var half_fold = Math.ceil($(window).height() / 2),
                tip_position = this.settings.$next_tip.offset(),
                $nub = this.settings.$next_tip.find('.joyride-nub'),
                nub_height = Math.ceil(this.outerHeight($nub) / 2),
      Severity: Minor
      Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 1 hr to fix

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

            start : function () {
              var self = this,
                  $this = $(this.scope).find('[data-joyride]'),
                  integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
                  int_settings_count = integer_settings.length;
        Severity: Minor
        Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 1 hr to fix

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

              events : function () {
                var self = this;
          
                $(this.scope)
                  .on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
          Severity: Minor
          Found in examples/gae/showcase/static/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.outerHeight(this.settings.$next_tip),
                      tip_offset = this.settings.$next_tip.offset(),
                      target_height = this.outerHeight(this.settings.$target),
                      $nub = $('.joyride-nub', this.settings.$next_tip),
            Severity: Minor
            Found in examples/gae/showcase/static/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.tipAnimationFadeSpeed)
                              .show();
              Severity: Major
              Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 45 mins to fix

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

                              this.delay(function () {
                                $timer.animate({
                                  width: $timer.parent().width()
                                }, this.settings.timer, 'linear');
                              }.bind(this), this.settings.tipAnimationFadeSpeed);
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 272..276

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

                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.delay(function () {
                                $timer.animate({
                                  width: $timer.parent().width()
                                }, this.settings.timer, 'linear');
                              }.bind(this), this.settings.tipAnimationFadeSpeed);
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 250..254

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

                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 (typeof method != 'string') {
                        if (!this.settings.init) this.events();
                
                        return this.settings.init;
                      } else {
                examples/gae/showcase/static/js/foundation/foundation.alerts.js on lines 23..29

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

                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.top()) {
                
                            this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
                            $nub.addClass('bottom');
                
                
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 478..483

                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

                        } else {
                
                          this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
                          $nub.addClass('top');
                
                
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 473..478

                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

                              top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height),
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 419..419

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

                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

                              left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_height)});
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 402..402

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

                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 (toggle) {
                        this.settings.$next_tip.hide();
                        this.settings.$next_tip.css('visibility', 'visible');
                      }
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 446..449

                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

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

                      if (toggle) {
                        this.settings.$next_tip.hide();
                        this.settings.$next_tip.css('visibility', 'visible');
                      }
                examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 489..492

                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