jquery/jquery

View on GitHub

Showing 218 of 230 total issues

Function ajax has a Cognitive Complexity of 142 (exceeds 5 allowed). Consider refactoring.
Open

    ajax: function( url, options ) {

        // If url is an object, simulate pre-1.5 signature
        if ( typeof url === "object" ) {
            options = url;
Severity: Minor
Found in src/ajax.js - About 2 days 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

File selector.js has 1072 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import jQuery from "./core.js";
import nodeName from "./core/nodeName.js";
import document from "./var/document.js";
import documentElement from "./var/documentElement.js";
import indexOf from "./var/indexOf.js";
Severity: Major
Found in src/selector.js - About 2 days to fix

    Function defaultPrefilter has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
    Open

    function defaultPrefilter( elem, props, opts ) {
        var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
            isBox = "width" in props || "height" in props,
            anim = this,
            orig = {},
    Severity: Minor
    Found in src/effects.js - About 1 day 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 exports has 298 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function( grunt ) {
        function readOptionalJSON( filepath ) {
            var stripJSONComments = require( "strip-json-comments" ),
                data = {};
            try {
    Severity: Major
    Found in Gruntfile.js - About 1 day to fix

      Function ajaxConvert has a Cognitive Complexity of 71 (exceeds 5 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: Minor
      Found in src/ajax.js - About 1 day 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 ajax has 257 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajax: function( url, options ) {
      
              // If url is an object, simulate pre-1.5 signature
              if ( typeof url === "object" ) {
                  options = url;
      Severity: Major
      Found in src/ajax.js - About 1 day to fix

        Function Callbacks has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
        Open

        jQuery.Callbacks = function( options ) {
        
            // Convert options from String-formatted to Object-formatted if needed
            // (we check in cache first)
            options = typeof options === "string" ?
        Severity: Minor
        Found in src/callbacks.js - About 1 day 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

        File event.js has 568 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import jQuery from "./core.js";
        import document from "./var/document.js";
        import documentElement from "./var/documentElement.js";
        import rnothtmlwhite from "./var/rnothtmlwhite.js";
        import rcheckableType from "./var/rcheckableType.js";
        Severity: Major
        Found in src/event.js - About 1 day to fix

          Function trigger has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

              trigger: function( event, data, elem, onlyHandlers ) {
          
                  var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
                      eventPath = [ elem || document ],
                      type = hasOwn.call( event, "type" ) ? event.type : event,
          Severity: Minor
          Found in src/event/trigger.js - About 1 day 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

          File effects.js has 528 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import jQuery from "./core.js";
          import document from "./var/document.js";
          import rcssNum from "./var/rcssNum.js";
          import rnothtmlwhite from "./var/rnothtmlwhite.js";
          import cssExpand from "./css/var/cssExpand.js";
          Severity: Major
          Found in src/effects.js - About 1 day to fix

            Function exports has 216 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function( grunt ) {
                const fs = require( "fs" );
                const path = require( "path" );
                const rollup = require( "rollup" );
                const rollupFileOverrides = require( "./lib/rollup-plugin-file-overrides" );
            Severity: Major
            Found in build/tasks/build.js - About 1 day to fix

              File ajax.js has 515 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import jQuery from "./core.js";
              import document from "./var/document.js";
              import rnothtmlwhite from "./var/rnothtmlwhite.js";
              import location from "./ajax/var/location.js";
              import nonce from "./ajax/var/nonce.js";
              Severity: Major
              Found in src/ajax.js - About 1 day to fix

                Function init has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                    init = jQuery.fn.init = function( selector, context, root ) {
                        var match, elem;
                
                        // HANDLE: $(""), $(null), $(undefined), $(false)
                        if ( !selector ) {
                Severity: Minor
                Found in src/core/init.js - About 1 day 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 a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                Open

                function domManip( collection, args, callback, ignored ) {
                
                    // Flatten any nested arrays
                    args = flat( args );
                
                
                Severity: Minor
                Found in src/manipulation.js - About 7 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 Deferred has 179 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Deferred: function( func ) {
                        var tuples = [
                
                                // action, add listener, callbacks,
                                // ... .then handlers, argument index, [final state]
                Severity: Major
                Found in src/deferred.js - About 7 hrs to fix

                  Function remove has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                      remove: function( elem, types, handler, selector, mappedTypes ) {
                  
                          var j, origCount, tmp,
                              events, t, handleObj,
                              special, handlers, type, namespaces, origType,
                  Severity: Minor
                  Found in src/event.js - About 6 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 buildFragment has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function buildFragment( elems, context, scripts, selection, ignored ) {
                      var elem, tmp, tag, wrap, attached, j,
                          fragment = context.createDocumentFragment(),
                          nodes = [],
                          i = 0,
                  Severity: Minor
                  Found in src/manipulation/buildFragment.js - About 5 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 a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      add: function( elem, types, handler, data, selector ) {
                  
                          var handleObjIn, eventHandle, tmp,
                              events, t, handleObj,
                              special, handlers, type, namespaces, origType,
                  Severity: Minor
                  Found in src/event.js - About 5 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 handlers has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      handlers: function( event, handlers ) {
                          var i, handleObj, sel, matchedHandlers, matchedSelectors,
                              handlerQueue = [],
                              delegateCount = handlers.delegateCount,
                              cur = event.target;
                  Severity: Minor
                  Found in src/event.js - About 5 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 defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function defaultPrefilter( elem, props, opts ) {
                      var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                          isBox = "width" in props || "height" in props,
                          anim = this,
                          orig = {},
                  Severity: Major
                  Found in src/effects.js - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language