NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

Avoid deeply nested control flow statements.
Open

                            if ( cache[1] === true ) {
                                return true;
                            }
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ( Expr.relative[ tokens[j].type ] ) {
                            break;
                        }
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if ( !xhrCallbacks ) {
                                      xhrCallbacks = {};
                                      jQuery( window ).unload( xhrOnUnloadAbort );
                                  }
      Severity: Major
      Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if ( xml && xml.documentElement /* #4958 */ ) {
                                                responses.xml = xml;
                                            }
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
                                      cur = cur.replace( " " + clazz + " ", " " );
                                  }
          Severity: Major
          Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ( (data = cache[1]) === true || data === cachedruns ) {
                                            return data === true;
                                        }
            Severity: Major
            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ( hasScripts ) {
                                          jQuery.merge( scripts, getAll( node, "script" ) );
                                      }
              Severity: Major
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for ( conv2 in converters ) {
                
                                        // If conv2 outputs current
                                        tmp = conv2.split(" ");
                                        if ( tmp[ 1 ] === current ) {
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if ( !status && s.isLocal && !s.crossDomain ) {
                                                          status = responses.text ? 200 : 404;
                                                      // IE - #1450: sometimes returns 1223 when it should be 204
                                                      } else if ( status === 1223 ) {
                                                          status = 204;
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ( matches[ sel ] === undefined ) {
                                                matches[ sel ] = handleObj.needsContext ?
                                                    jQuery( sel, this ).index( cur ) >= 0 :
                                                    jQuery.find( sel, this, null, [ cur ] ).length;
                                            }
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( (elem = matcherOut[i]) ) {
                                                  // Restore matcherIn since elem is not yet a final match
                                                  temp.push( (matcherIn[i] = elem) );
                                              }
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        } else if ( copy !== undefined ) {
                                            target[ name ] = copy;
                                        }
                        Severity: Major
                        Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                          Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                          Severity: Minor
                          Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                            Function init has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                init: function( elem, options, prop, end, easing, unit ) {
                            Severity: Minor
                            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for ( match in context ) {
                                                          // Properties of context are called as methods if possible
                                                          if ( jQuery.isFunction( this[ match ] ) ) {
                                                              this[ match ]( context[ match ] );
                              
                              
                              Severity: Major
                              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if ( conv && s["throws"] ) {
                                                        response = conv( response );
                                                    } else {
                                                        try {
                                                            response = conv( response );
                                Severity: Major
                                Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if (this.second <= this._defaults.secondMin) {
                                                                  this.second = this._defaults.secondMin;
                                                                  this._defaults.millisecMin = minDateTime.getMilliseconds();
                                                              } else {
                                                                  if (this.millisec < this._defaults.millisecMin) {
                                  Severity: Major
                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if (this.second >= this._defaults.secondMax) {
                                                                    this.second = this._defaults.secondMax;
                                                                    this._defaults.millisecMax = maxDateTime.getMilliseconds();
                                                                } else {
                                                                    if (this.millisec > this._defaults.millisecMax) {
                                    Severity: Major
                                    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (overrides.hasOwnProperty(prop) && name[prop]) {
                                                              fns[prop] = name[prop];
                                                          }
                                      Severity: Major
                                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                        Method generate_pick_none_input_html has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                              def generate_pick_none_input_html(value, default_value, css_class, response_class, disabled, input_mask, input_mask_placeholder)
                                                html = {}
                                                html[:class] = [response_class,css_class].reject{ |c| c.blank? }
                                                html[:value] = value.blank? ? default_value : value
                                                html[:disabled] = disabled unless disabled.blank?
                                        Severity: Minor
                                        Found in lib/surveyor/helpers/surveyor_helper_methods.rb - About 45 mins 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language