calblueprint/ashby-village

View on GitHub

Showing 51 of 51 total issues

File jquery.joyride-2.1.js has 726 lines of code (exceeds 250 allowed). Consider refactoring.
Open

  /*
 * jQuery Foundation Joyride Plugin 2.1
 * http://foundation.zurb.com
 * Copyright 2013, ZURB
 * Free to use under the MIT license.
Severity: Major
Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 day to fix

    Function mask has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        mask: function(mask, settings) {
          var input, defs, tests, partialPosition, firstNonMaskPos, lastRequiredNonMaskPos, len, oldVal;
          if (!mask && this.length > 0) {
            input = $(this[0]);
            var fn = input.data($.mask.dataName);
    Severity: Major
    Found in app/assets/javascripts/jquery.maskedinput.js - About 5 hrs to fix

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

          $("#organizers").bind('railsAutocomplete.select', function(event, data){
            // Add id's to array to pass to rails
            event_organizer_ids.push(data.item.id);
            // Set hidden field
            $("#selected_organizers")[0].value = event_organizer_ids;
      Severity: Major
      Found in app/assets/javascripts/events_new.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/groups_new.js on lines 41..50

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

      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

          $("#group_leaders").bind('railsAutocomplete.select', function(event, data){
            // Add id's to array to pass to rails
            group_leader_ids.push(data.item.id);
            // Set hidden field
            $("#selected_leaders")[0].value = group_leader_ids;
      Severity: Major
      Found in app/assets/javascripts/groups_new.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/events_new.js on lines 88..97

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

      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 (settings.$li.next().length < 1) {
                      methods.end();
                    } else if (settings.timer > 0) {
                      clearTimeout(settings.automate);
                      methods.hide();
      Severity: Major
      Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/jquery.joyride-2.1.js on lines 166..176

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

      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 (settings.$li.next().length < 1) {
                  methods.end();
                  } else if (settings.timer > 0) {
                  clearTimeout(settings.automate);
                  methods.hide();
      Severity: Major
      Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/jquery.joyride-2.1.js on lines 116..126

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

      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

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

            init : function (opts) {
              return this.each(function () {
      
                if ($.isEmptyObject(settings)) {
                  settings = $.extend(true, defaults, opts);
      Severity: Major
      Found in app/assets/javascripts/jquery.joyride-2.1.js - About 3 hrs to fix

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

              show : function (init) {
                var opts = {}, ii, opts_arr = [], opts_len = 0, p,
                    $timer = null;
        
                // are we paused?
        Severity: Major
        Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

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

                  if (arguments.length>0 && arguments[0] instanceof $){
                    el = arguments[0];
                  } else if(settings.$target && !/body/i.test(settings.$target.selector)){
                    el = settings.$target;
                  }  else {
          Severity: Major
          Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/jquery.joyride-2.1.js on lines 674..680

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

          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 (arguments.length>0 && arguments[0] instanceof $){
                    el = arguments[0];
                  } else if(settings.$target && !/body/i.test(settings.$target.selector)){
                    el = settings.$target;
                  }  else {
          Severity: Major
          Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/jquery.joyride-2.1.js on lines 619..625

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

          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

          Function ready_groups_index has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var ready_groups_index = function() {
            updateListing();
            $(".inactive").hide();
            updateGroupCount();
          
          
          Severity: Major
          Found in app/assets/javascripts/groups_index.js - About 2 hrs to fix

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

                $("#group_leaders").keyup(function(){
                  if($(".ui-helper-hidden-accessible").find("div:last").text() == "No search results."){
                    $("#groupLeaderError").show();
                  } else {
                    $("#groupLeaderError").hide();
            Severity: Major
            Found in app/assets/javascripts/groups_new.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/events_new.js on lines 98..104

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

            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

                $("#organizers").keyup(function(){
                  if($(".ui-helper-hidden-accessible").find("div:last").text() == "No search results."){
                    $("#organizerError").show();
                  } else {
                    $("#organizerError").hide();
            Severity: Major
            Found in app/assets/javascripts/events_new.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/groups_new.js on lines 51..57

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

            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

            Function ready_groups_index has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            var ready_groups_index = function() {
              updateListing();
              $(".inactive").hide();
              updateGroupCount();
            
            
            Severity: Minor
            Found in app/assets/javascripts/groups_index.js - About 2 hrs 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 pos_default has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  pos_default : function (init) {
                    var half_fold = Math.ceil(settings.$window.height() / 2),
                        tip_position = settings.$next_tip.offset(),
                        $nub = $('.joyride-nub', settings.$next_tip),
                        nub_width = Math.ceil($nub.outerWidth() / 2),
            Severity: Major
            Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

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

                $(".click-groups").click(function() {
                  $(".click-info").removeClass("selected");
                  $(this).addClass("selected");
                  $(".info").hide();
                  $(".groups-leading").show();
              Severity: Major
              Found in app/assets/javascripts/user_show.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/user_show.js on lines 6..11

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

              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

                $(".click-info").click(function() {
                  $(".click-groups").removeClass("selected");
                  $(this).addClass("selected");
                  $(".info").show();
                  $(".groups-leading").hide();
              Severity: Major
              Found in app/assets/javascripts/user_show.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/user_show.js on lines 13..18

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

              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

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

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

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

                      un_expose: function(){
                        var exposeId,
                          el,
                          expose ,
                          origCSS,
                Severity: Minor
                Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 hr to fix

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

                          exposeCover.css({
                            top: el.offset().top,
                            left: el.offset().left,
                            width: el.outerWidth(true),
                            height: el.outerHeight(true)
                  Severity: Major
                  Found in app/assets/javascripts/jquery.joyride-2.1.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.joyride-2.1.js on lines 634..639

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language