jasonrobertfox/tictactoe

View on GitHub
lib/assets/javascripts/foundation/foundation.orbit.js

Summary

Maintainability
F
4 days
Test Coverage

Function Orbit has 228 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 lib/assets/javascripts/foundation/foundation.orbit.js - About 1 day to fix

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

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

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

          self.init = function() {
            self.build_markup();
            if (settings.timer) {timer = self.create_timer(); timer.start();}
            animate = new FadeAnimation(settings, slides_container);
            if (settings.animation === 'slide') 
      Severity: Major
      Found in lib/assets/javascripts/foundation/foundation.orbit.js - About 2 hrs to fix

        Function _goto has 41 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 = slides_container.children();
        Severity: Minor
        Found in lib/assets/javascripts/foundation/foundation.orbit.js - About 1 hr 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 lib/assets/javascripts/foundation/foundation.orbit.js - About 1 hr to fix

            Function build_markup has 32 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 lib/assets/javascripts/foundation/foundation.orbit.js - About 1 hr to fix

              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();
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 352..358

              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();
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 360..366

              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 ( 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) );
                        }
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 2 hrs to fix
              lib/assets/javascripts/foundation/foundation.clearing.js on lines 140..142

              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.height() != next.height() && settings.variable_height) {
                        slides_container.animate({'height': next.height()}, 250, 'linear', unlock);
                      } else {
                        unlock();
                      }
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 130..134

              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.height() > slides_container.height() && settings.variable_height) {
                      slides_container.animate({'height': next.height()}, 250, 'linear', start_animation);
                    } else {
                      start_animation();
                    }
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 116..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 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,
              Severity: Major
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/foundation/foundation.clearing.js on lines 116..122

              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

                    $('[data-orbit]', scope).each(function(idx, el) {
                      var $el = $(el);
                      var opts = self.data_options($el);
                      new Orbit($el, $.extend({},self.settings, opts));
                    });
              Severity: Minor
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 50 mins to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 417..421

              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 lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 50 mins to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 143..147

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

              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

                    if ($(scope).is('[data-orbit]')) {
                      var $el = $(scope);
                      var opts = self.data_options($el);
                      new Orbit($el, $.extend({},self.settings, opts));
                    }
              Severity: Minor
              Found in lib/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 50 mins to fix
              lib/assets/javascripts/foundation/foundation.orbit.js on lines 423..427

              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