NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

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

      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

      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

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

              _destroy: function() {
                  var contents;
          
                  // clean up main element
                  this.element
          Severity: Minor
          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

                _attachHandlers: function(inst) {
                    var stepMonths = this._get(inst, "stepMonths"),
                        id = "#" + inst.id.replace( /\\\\/g, "\\" );
                    inst.dpDiv.find("[data-handler]").map(function () {
                        var handler = {
            Severity: Minor
            Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

              function showHide( elements, show ) {
                  var elem,
                      values = [],
                      index = 0,
                      length = elements.length;
              Severity: Minor
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

                Function _determineButtonType has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _determineButtonType: function() {
                        var ancestor, labelSelector, checked;
                
                        if ( this.element.is("[type=checkbox]") ) {
                            this.type = "checkbox";
                Severity: Minor
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                  Function _setContainment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _setContainment: function() {
                  
                          var over, c, ce,
                              o = this.options;
                  
                  
                  Severity: Minor
                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                    Function refreshPositions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        refreshPositions: function(fast) {
                    
                            //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
                            if(this.offsetParent && this.helper) {
                                this.offset.parent = this._getParentOffset();
                    Severity: Minor
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                      Function _mouseStart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _mouseStart: function(event) {
                      
                              var curleft, curtop, cursor,
                                  o = this.options,
                                  iniPos = this.element.position(),
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                        Function _createButtons has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _createButtons: function() {
                                var that = this,
                                    buttons = this.options.buttons;
                        
                                // if we already have a button pane, remove it
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                          Function to has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          spaces.hsla.to = function ( rgba ) {
                              if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
                                  return [ null, null, null, rgba[ 3 ] ];
                              }
                              var r = rgba[ 0 ] / 255,
                          Severity: Minor
                          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                            Function _updateDatepicker has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _updateDatepicker: function(inst) {
                                    this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
                                    instActive = inst; // for delegate hover events
                                    inst.dpDiv.empty().append(this._generateHTML(inst));
                                    this._attachHandlers(inst);
                            Severity: Minor
                            Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                              Function open has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  open: function( event ) {
                                      var that = this,
                                          target = $( event ? event.target : this.element )
                                              // we need closest here due to mouseover bubbling,
                                              // but always pointing at the same event target
                              Severity: Minor
                              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                                Function close has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    close: function( event ) {
                                        var that = this,
                                            target = $( event ? event.currentTarget : this.element ),
                                            tooltip = this._find( target );
                                
                                
                                Severity: Minor
                                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                                  Function handlers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      handlers: function( event, handlers ) {
                                          var i, matches, sel, handleObj,
                                              handlerQueue = [],
                                              delegateCount = handlers.delegateCount,
                                              cur = event.target;
                                  Severity: Minor
                                  Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

                                    Function _drop has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _drop: function(event,custom) {
                                    
                                            var draggable = custom || $.ui.ddmanager.current,
                                                childrenIntersection = false;
                                    
                                    
                                    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