jquery/jquery

View on GitHub

Showing 229 of 229 total issues

Function removeClass has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    removeClass: function( value ) {
        var classes, elem, cur, curValue, clazz, j, finalValue,
            i = 0;

        if ( typeof value === "function" ) {
Severity: Minor
Found in src/attributes/classes.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 add has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    add: function( elem, types, handler, data, selector ) {

        var handleObjIn, eventHandle, tmp,
            events, t, handleObj,
            special, handlers, type, namespaces, origType,
Severity: Major
Found in src/event.js - About 2 hrs to fix

    Function matcherFromGroupMatchers has 71 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 src/selector.js - About 2 hrs to fix

      Function done has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function done( status, nativeStatusText, responses, headers ) {
                  var isSuccess, success, error, response, modified,
                      statusText = nativeStatusText;
      
                  // Ignore repeat invocations
      Severity: Major
      Found in src/ajax.js - About 2 hrs to fix

        Function resolve has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            function resolve( depth, deferred, handler, special ) {
                                return function() {
                                    var that = this,
                                        args = arguments,
                                        mightThrow = function() {
        Severity: Major
        Found in src/deferred.js - About 2 hrs to fix

          Function dispatch has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              dispatch: function( nativeEvent ) {
          
                  // Make a writable jQuery.Event from the native event object
                  var event = jQuery.event.fix( nativeEvent );
          
          
          Severity: Minor
          Found in src/event.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 leverageNative has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function leverageNative( el, type, expectSync ) {
          
              // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
              if ( !expectSync ) {
                  if ( dataPriv.get( el, type ) === undefined ) {
          Severity: Minor
          Found in src/event.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 setMatcher has 68 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 src/selector.js - About 2 hrs to fix

            File core.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import arr from "./var/arr.js";
            import getProto from "./var/getProto.js";
            import slice from "./var/slice.js";
            import flat from "./var/flat.js";
            import push from "./var/push.js";
            Severity: Minor
            Found in src/core.js - About 2 hrs to fix

              Function adjustCSS has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function adjustCSS( elem, prop, valueParts, tween ) {
                  var adjusted, scale,
                      maxIterations = 20,
                      currentValue = tween ?
                          function() {
              Severity: Minor
              Found in src/css/adjustCSS.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 superMatcher has 64 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 src/selector.js - About 2 hrs to fix

                Function clone has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                        var i, l, srcElements, destElements,
                            clone = elem.cloneNode( true ),
                            inPage = isAttached( elem );
                
                
                Severity: Minor
                Found in src/manipulation.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 html has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    html: function( value ) {
                        return access( this, function( value ) {
                            var elem = this[ 0 ] || {},
                                i = 0,
                                l = this.length;
                Severity: Minor
                Found in src/manipulation.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 closest has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    closest: function( selectors, context ) {
                        var cur,
                            i = 0,
                            l = this.length,
                            matched = [],
                Severity: Minor
                Found in src/traversing.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 ajaxConvert has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function ajaxConvert( s, response, jqXHR, isSuccess ) {
                    var conv2, current, conv, tmp, prev,
                        converters = {},
                
                        // Work with a copy of dataTypes in case we need to modify it for conversion
                Severity: Major
                Found in src/ajax.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                          if ( forward && useCache ) {
                  
                                              // Seek `elem` from a previously-cached index
                                              outerCache = parent[ expando ] || ( parent[ expando ] = {} );
                                              cache = outerCache[ type ] || [];
                  Severity: Critical
                  Found in src/selector.js - About 2 hrs to fix

                    Function send has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            send: function( headers, complete ) {
                                var i,
                                    xhr = options.xhr();
                    
                                xhr.open(
                    Severity: Major
                    Found in src/ajax/xhr.js - About 2 hrs to fix

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

                      function on( elem, types, selector, data, fn, one ) {
                          var origFn, type;
                      
                          // Types can be a map of types/handlers
                          if ( typeof types === "object" ) {
                      Severity: Minor
                      Found in src/event.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 domManip has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function domManip( collection, args, callback, ignored ) {
                      
                          // Flatten any nested arrays
                          args = flat( args );
                      
                      
                      Severity: Major
                      Found in src/manipulation.js - About 2 hrs to fix

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

                            init = jQuery.fn.init = function( selector, context, root ) {
                                var match, elem;
                        
                                // HANDLE: $(""), $(null), $(undefined), $(false)
                                if ( !selector ) {
                        Severity: Major
                        Found in src/core/init.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language