NUBIC/surveyor

View on GitHub

Showing 658 of 658 total issues

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

    _refreshItems: function(event) {

        this.items = [];
        this.containers = [this];

Severity: Minor
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

            left: function( position, data ) {
                var within = data.within,
                    withinOffset = within.offset.left + within.scrollLeft,
                    outerWidth = within.width,
                    offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
    Severity: Minor
    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

      function _normalizeArguments( effect, options, speed, callback ) {
      
          // allow passing all options as the first parameter
          if ( $.isPlainObject( effect ) ) {
              options = effect;
      Severity: Minor
      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

            _size: function() {
                // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
                // divs will both have width and height set, so we need to reset them
                var nonContentHeight, minContentHeight, maxContentHeight,
                    options = this.options;
        Severity: Minor
        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

              _mouseStop: function(event) {
          
                  //If we are using droppables, inform the manager about the drop
                  var element,
                      that = this,
          Severity: Minor
          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

                attr: function( elem, name, value ) {
                    var ret, hooks, notxml,
                        nType = elem.nodeType;
            
                    // don't get/set attributes on text, comment and attribute nodes
            Severity: Minor
            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

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

              jQuery.fn.load = function( url, params, callback ) {
                  if ( typeof url !== "string" && _load ) {
                      return _load.apply( this, arguments );
                  }
              
              
              Severity: Minor
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

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

                    setOffset: function( elem, options, i ) {
                        var position = jQuery.css( elem, "position" );
                
                        // set position first, in-case top/left are set even on static elem
                        if ( position === "static" ) {
                Severity: Minor
                Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

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

                  function fixCloneNodeIssues( src, dest ) {
                      var nodeName, data, e;
                  
                      // We do not need to do anything for non-Elements
                      if ( dest.nodeType !== 1 ) {
                  Severity: Minor
                  Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

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

                                function keypressEvent(e) {
                                    var k = e.which,
                                        pos = input.caret(),
                                        p,
                                        c,
                    Severity: Minor
                    Found in lib/assets/javascripts/surveyor/jquery.maskedinput.js - About 1 hr to fix

                      Method response_for has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def response_for(response_set, question, answer = nil, response_group = nil)
                              return nil unless response_set && question && question.id
                              result = response_set.responses.detect{|r| (r.question_id == question.id) && (answer.blank? ? true : r.answer_id == answer.id) && (r.response_group.blank? ? true : r.response_group.to_i == response_group.to_i)}
                              result.blank? ? response_set.responses.build(:question_id => question.id, :response_group => response_group) : result
                            end
                      Severity: Minor
                      Found in lib/surveyor/helpers/surveyor_helper_methods.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

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

                          el.queue(function() {
                              if ( hide ) {
                                  el.hide();
                              }
                              $.effects.restore( el, props );
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 8784..8791

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

                      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

                      Method parse_and_build has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def parse_and_build(context, args, original_method, reference_identifier)
                          # clear context
                          [ :answer,
                            :validation,
                            :validation_condition ].each{|k| context.delete k}
                      Severity: Minor
                      Found in lib/surveyor/parser.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

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

                              rgba: {
                                  props: {
                                      red: {
                                          idx: 0,
                                          type: "byte"
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 7199..7214

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

                      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

                                      delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 13068..13068

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

                      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

                              .animate( animation2, duration, o.easing, function() {
                                  if ( hide ) {
                                      el.hide();
                                  }
                                  $.effects.restore( el, props );
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 8507..8514

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

                      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

                              hsla: {
                                  props: {
                                      hue: {
                                          idx: 0,
                                          type: "degrees"
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 7182..7197

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

                      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

                                      delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 13067..13067

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

                      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 offsetString has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  offsetString = function(offset) {
                                      try {
                                          return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
                                              offset, $.datepicker._getFormatConfig(inst));
                                      }
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

                            option: function( key, value ) {
                                var options = key,
                                    parts,
                                    curOption,
                                    i;
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language