jasonrobertfox/tictactoe

View on GitHub

Showing 58 of 126 total issues

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

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

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

        toggle: function() {
          var self = this;
          var topbar = $('.top-bar, [data-topbar]'),
              section = topbar.find('section, .section');
    
    
    Severity: Minor
    Found in lib/assets/javascripts/foundation/foundation.topbar.js - About 2 hrs to fix

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

          set_active_from_hash: function() {
            var self = Foundation.libs.section,
                hash = window.location.hash.substring(1),
                sections = $(self.settings.section_selector);
      
      
      Severity: Minor
      Found in lib/assets/javascripts/foundation/foundation.section.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 lib/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix

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

              show : function (el, css) {
                // is modal
                if (css) {
                  if (el.parent('body').length === 0) {
                    var placeholder = el.wrap('<div style="display: none;" />').parent();
          Severity: Minor
          Found in lib/assets/javascripts/foundation/foundation.reveal.js - About 1 hr 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 init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  init : function (section, method, options) {
                    Foundation.inherit(this, 'data_options addCustomRule');
                    var self = this;
              
                    if (typeof method === 'object') {
              Severity: Minor
              Found in lib/assets/javascripts/foundation/foundation.topbar.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 open has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      open : function (target, ajax_settings) {
                        if (target) {
                          if (typeof target.selector !== 'undefined') {
                            var modal = $('#' + target.data('reveal-id'));
                          } else {
                  Severity: Minor
                  Found in lib/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

                    Method minmax has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def minmax(game_state, depth, lower_bound, upper_bound)
                            return evaluate_state(game_state, depth) if game_state.over?
                            candidate_move_nodes = []
                            game_state.available_moves.each do |move|
                              child_board = game_state.make_move(move)
                    Severity: Minor
                    Found in lib/tictactoe/player/perfect_player.rb - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        reposition : function (target, tip, classes) {
                          var width, nub, nubHeight, nubWidth, column, objPos;
                    
                          tip.css('visibility', 'hidden').show();
                    
                    
                    Severity: Minor
                    Found in lib/assets/javascripts/foundation/foundation.tooltips.js - About 1 hr to fix

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

                          init : function (scope, method, options) {
                            Foundation.inherit(this, 'data_options');
                            var self = this;
                      
                            if (typeof method === 'object') {
                      Severity: Minor
                      Found in lib/assets/javascripts/foundation/foundation.tooltips.js - About 1 hr to fix

                        Function events has 38 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 lib/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix

                          Function start has 36 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 lib/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix

                            Function swipe_events has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                swipe_events : function () {
                                  var self = this;
                            
                                  $(this.scope)
                                    .on('touchstart.fndtn.clearing', '.visible-img', function(e) {
                            Severity: Minor
                            Found in lib/assets/javascripts/foundation/foundation.clearing.js - About 1 hr to fix

                              Method check_line has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def check_line(candidate_space, line_id)
                                    return if @imposible_lines.include?(line_id)
                                    candidate = @board.contents_of(candidate_space)
                                    return unless candidate
                                    line = [candidate_space]
                              Severity: Minor
                              Found in lib/tictactoe/game_state.rb - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

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

                                  events : function () {
                                    var self = this;
                              
                                    $(this.scope)
                                      .on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
                              Severity: Minor
                              Found in lib/assets/javascripts/foundation/foundation.dropdown.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

                                  Function hide has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      hide : function (el, css) {
                                        // is modal
                                        if (css) {
                                          if (/pop/i.test(this.settings.animation)) {
                                            var end_css = {
                                  Severity: Minor
                                  Found in lib/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

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

                                        events : function () {
                                          var self = this;
                                    
                                          $(this.scope)
                                            .on('click.fndtn.clearing', 'ul[data-clearing] li',
                                    Severity: Minor
                                    Found in lib/assets/javascripts/foundation/foundation.clearing.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language