bronycub/sugarcub

View on GitHub
core/static/vendor/jquery/external/sizzle/dist/sizzle.js

Summary

Maintainability
F
1 wk
Test Coverage

File sizzle.js has 1467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Sizzle CSS Selector Engine v2.3.3
 * https://sizzlejs.com/
 *
 * Copyright jQuery Foundation and other contributors
Severity: Major
Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 3 days to fix

    Function setDocument has 245 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    setDocument = Sizzle.setDocument = function( node ) {
        var hasCompare, subWindow,
            doc = node ? node.ownerDocument || node : preferredDoc;
    
        // Return early if doc is invalid or already selected
    Severity: Major
    Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 day to fix

      Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              "CHILD": function( type, what, argument, first, last ) {
                  var simple = type.slice( 0, 3 ) !== "nth",
                      forward = type.slice( -4 ) !== "last",
                      ofType = what === "of-type";
      
      
      Severity: Major
      Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 3 hrs to fix

        Function Sizzle has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Sizzle( selector, context, results, seed ) {
            var m, i, elem, nid, match, groups, newSelector,
                newContext = context && context.ownerDocument,
        
                // nodeType defaults to 9, since context defaults to document
        Severity: Major
        Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 3 hrs to fix

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

          function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
              var bySet = setMatchers.length > 0,
                  byElement = elementMatchers.length > 0,
                  superMatcher = function( seed, context, xml, results, outermost ) {
                      var elem, j, matcher,
          Severity: Major
          Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                    if ( forward && useCache ) {
            
                                        // Seek `elem` from a previously-cached index
            
                                        // ...in a gzip-friendly way
            Severity: Critical
            Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 2 hrs to fix

              Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                  if ( postFilter && !postFilter[ expando ] ) {
                      postFilter = setMatcher( postFilter );
                  }
                  if ( postFinder && !postFinder[ expando ] ) {
              Severity: Major
              Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 2 hrs to fix

                Function superMatcher has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        superMatcher = function( seed, context, xml, results, outermost ) {
                            var elem, j, matcher,
                                matchedCount = 0,
                                i = "0",
                                unmatched = seed && [],
                Severity: Major
                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 2 hrs to fix

                  Function select has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  select = Sizzle.select = function( selector, context, results, seed ) {
                      var i, tokens, token, type, find,
                          compiled = typeof selector === "function" && selector,
                          match = !seed && tokenize( (selector = compiled.selector || selector) );
                  
                  
                  Severity: Minor
                  Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 hr to fix

                    Function addCombinator has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addCombinator( matcher, combinator, base ) {
                        var dir = combinator.dir,
                            skip = combinator.next,
                            key = skip || dir,
                            checkNonElements = base && key === "parentNode",
                    Severity: Minor
                    Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 hr to fix

                      Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function matcherFromTokens( tokens ) {
                          var checkContext, matcher, j,
                              len = tokens.length,
                              leadingRelative = Expr.relative[ tokens[0].type ],
                              implicitRelative = leadingRelative || Expr.relative[" "],
                      Severity: Minor
                      Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 hr to fix

                        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                            var matched, match, tokens, type,
                                soFar, groups, preFilters,
                                cached = tokenCache[ selector + " " ];
                        
                        
                        Severity: Minor
                        Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if ( support.matchesSelector && documentIsHTML &&
                                  !compilerCache[ expr + " " ] &&
                                  ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                                  ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                          
                          
                          Severity: Major
                          Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if ( (nid = context.getAttribute( "id" )) ) {
                                                    nid = nid.replace( rcssescape, fcssescape );
                                                } else {
                                                    context.setAttribute( "id", (nid = expando) );
                                                }
                            Severity: Major
                            Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if ( Expr.relative[ tokens[j].type ] ) {
                                                      break;
                                                  }
                              Severity: Major
                              Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ( node && node.value === id ) {
                                                            return [ elem ];
                                                        }
                                Severity: Major
                                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.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 core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if ( ofType ?
                                                                            node.nodeName.toLowerCase() === name :
                                                                            node.nodeType === 1 ) {
                                    
                                                                            return false;
                                    Severity: Major
                                    Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if ( nodeType === 9 ) {
                                                              if ( (elem = context.getElementById( m )) ) {
                                      
                                                                  // Support: IE, Opera, Webkit
                                                                  // TODO: identify versions
                                      Severity: Major
                                      Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if ( nid === expando ) {
                                                                    context.removeAttribute( "id" );
                                                                }
                                        Severity: Major
                                        Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                      if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
                                                                          return true;
                                                                      }
                                          Severity: Major
                                          Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.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 core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                              } else if ( match[2] ) {
                                                                  push.apply( results, context.getElementsByTagName( selector ) );
                                                                  return results;
                                              
                                                              // Class selector
                                              Severity: Major
                                              Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                                    if ( ( ofType ?
                                                                                        node.nodeName.toLowerCase() === name :
                                                                                        node.nodeType === 1 ) &&
                                                                                        ++diff ) {
                                                
                                                
                                                Severity: Major
                                                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                      while ( i-- ) {
                                                                          groups[i] = "#" + nid + " " + toSelector( groups[i] );
                                                                      }
                                                  Severity: Major
                                                  Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                if ( !(unmatched[i] || setMatched[i]) ) {
                                                                                    setMatched[i] = pop.call( results );
                                                                                }
                                                    Severity: Major
                                                    Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if ( !selector ) {
                                                                              push.apply( results, seed );
                                                                              return results;
                                                                          }
                                                      Severity: Major
                                                      Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 45 mins to fix

                                                        Consider simplifying this complex logical expression.
                                                        Open

                                                                if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                                                        context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
                                                        
                                                                    context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                                                                    if ( !context ) {
                                                        Severity: Major
                                                        Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 40 mins to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                      if ( matcher[ expando ] ) {
                                                                          // Find the next relative operator (if any) for proper handling
                                                                          j = ++i;
                                                                          for ( ; j < len; j++ ) {
                                                                              if ( Expr.relative[ tokens[j].type ] ) {
                                                          Severity: Major
                                                          Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 40 mins to fix

                                                            Function superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                    superMatcher = function( seed, context, xml, results, outermost ) {
                                                            Severity: Minor
                                                            Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 35 mins to fix

                                                              Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                      "CHILD": function( type, what, argument, first, last ) {
                                                              Severity: Minor
                                                              Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 35 mins to fix

                                                                Function condense has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                function condense( unmatched, map, filter, context, xml ) {
                                                                Severity: Minor
                                                                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 35 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                          return results;
                                                                  Severity: Major
                                                                  Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                            return compare & 4 ? -1 : 1;
                                                                    Severity: Major
                                                                    Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                          return select( selector.replace( rtrim, "$1" ), context, results, seed );
                                                                      Severity: Major
                                                                      Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                            return results;
                                                                        Severity: Major
                                                                        Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                      return elem.disabled === disabled;
                                                                          Severity: Major
                                                                          Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                    return false;
                                                                            Severity: Major
                                                                            Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                          return sortInput ?
                                                                                              ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
                                                                                              0;
                                                                              Severity: Major
                                                                              Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                                    return results;
                                                                                Severity: Major
                                                                                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 30 mins to fix

                                                                                  There are no issues that match your filters.

                                                                                  Category
                                                                                  Status