ocadotechnology/rapid-router

View on GitHub
game/static/game/js/foundation/foundation/foundation.orbit.js

Summary

Maintainability
F
4 days
Test Coverage

Function Orbit has 257 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var Orbit = function (el, settings) {
    // Don't reinitialize plugin
    if (el.hasClass(settings.slides_container_class)) {
      return this;
    }
Severity: Major
Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 1 day to fix

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

    ;(function ($, window, document, undefined) {
      'use strict';
    
      var noop = function () {};
    
    
    Severity: Minor
    Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 5 hrs to fix

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

          self.init = function () {
            self.build_markup();
            if (settings.timer) {
              timer = self.create_timer();
              Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
      Severity: Major
      Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 2 hrs to fix

        Function _goto has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            self._goto = function (next_idx, start_timer) {
              // if (locked) {return false;}
              if (next_idx === idx) {return false;}
              if (typeof timer === 'object') {timer.restart();}
              var slides = self.slides();
        Severity: Minor
        Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 2 hrs to fix

          Function Timer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var Timer = function (el, settings, callback) {
              var self = this,
                  duration = settings.timer_speed,
                  progress = el.find('.' + settings.timer_progress_class),
                  start,
          Severity: Minor
          Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 1 hr to fix

            Function build_markup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                self.build_markup = function () {
                  slides_container.wrap('<div class="' + settings.container_class + '"></div>');
                  container = slides_container.parent();
                  slides_container.addClass(settings.slides_container_class);
            
            
            Severity: Minor
            Found in game/static/game/js/foundation/foundation/foundation.orbit.js - About 1 hr to fix

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

                        if ( typeof data.is_scrolling === 'undefined') {
                          data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
                        }
              game/static/game/js/foundation/foundation/foundation.clearing.js on lines 146..148

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

              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.next = function (current, next, callback) {
                    next.css({'margin' : '0%', 'opacity' : '0.01'});
                    next.animate({'opacity' :'1'}, duration, 'linear', function () {
                      current.css('margin', '100%');
                      callback();
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 396..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 84.

              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.prev = function (current, prev, callback) {
                    prev.css({'margin' : '0%', 'opacity' : '0.01'});
                    prev.animate({'opacity' : '1'}, duration, 'linear', function () {
                      current.css('margin', '100%');
                      callback();
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 388..394

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

              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 (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
                        slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);
                      } else {
                        unlock();
                      }
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 142..146

              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

                    if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {
                      slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);
                    } else {
                      start_animation();
                    }
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 128..132

              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

                        var data = {
                          start_page_x : e.touches[0].pageX,
                          start_page_y : e.touches[0].pageY,
                          start_time : (new Date()).getTime(),
                          delta_x : 0,
              game/static/game/js/foundation/foundation/foundation.clearing.js on lines 114..120

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

              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.prev = function (e) {
                    e.stopImmediatePropagation();
                    e.preventDefault();
                    self._goto(idx - 1);
                  };
              Severity: Minor
              Found in game/static/game/js/foundation/foundation/foundation.orbit.js and 1 other location - About 50 mins to fix
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 149..153

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

              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.next = function (e) {
                    e.stopImmediatePropagation();
                    e.preventDefault();
                    self._goto(idx + 1);
                  };
              Severity: Minor
              Found in game/static/game/js/foundation/foundation/foundation.orbit.js and 1 other location - About 50 mins to fix
              game/static/game/js/foundation/foundation/foundation.orbit.js on lines 155..159

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

              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