jquery/jquery

View on GitHub

Showing 218 of 230 total issues

Function text has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    text: function( value ) {
        return access( this, function( value ) {
            return value === undefined ?
                jQuery.text( this ) :
                this.empty().each( function() {
Severity: Minor
Found in src/manipulation.js - About 35 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

Function promise has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    promise: function( type, obj ) {
        var tmp,
            count = 1,
            defer = jQuery.Deferred(),
            elements = this,
Severity: Minor
Found in src/queue.js - About 35 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

Function makeArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    makeArray: function( arr, results ) {
        var ret = results || [];

        if ( arr != null ) {
            if ( isArrayLike( Object( arr ) ) ) {
Severity: Minor
Found in src/core.js - About 35 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

Function buildParams has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function buildParams( prefix, obj, traditional, add ) {
    var name;

    if ( Array.isArray( obj ) ) {

Severity: Minor
Found in src/serialize.js - About 35 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

Function getAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getAll( context, tag ) {

    // Support: IE <=9 - 11+
    // Use typeof to avoid zero-argument method invocation on host objects (#15151)
    var ret;
Severity: Minor
Found in src/manipulation/getAll.js - About 35 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

Function addProp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    addProp: function( name, hook ) {
        Object.defineProperty( jQuery.Event.prototype, name, {
            enumerable: true,
            configurable: true,

Severity: Minor
Found in src/event.js - About 35 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

Function parseHTML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

jQuery.parseHTML = function( data, context, keepScripts ) {
    if ( typeof data !== "string" ) {
        return [];
    }
    if ( typeof context === "boolean" ) {
Severity: Minor
Found in src/core/parseHTML.js - About 35 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

Function curCSS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function curCSS( elem, name, computed ) {
    var ret;

    computed = computed || getStyles( elem );

Severity: Minor
Found in src/css/curCSS.js - About 35 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

Function cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    cache: function( owner ) {

        // Check if the owner object already has a cache
        var value = owner[ this.expando ];

Severity: Minor
Found in src/data/Data.js - About 35 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

Avoid too many return statements within this function.
Open

    return compare & 4 ? -1 : 1;
Severity: Major
Found in src/selector/uniqueSort.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return ret;
    Severity: Major
    Found in src/attributes/attr.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 0;
      Severity: Major
      Found in src/selector/uniqueSort.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return check && result.indexOf( check ) > -1;
        Severity: Major
        Found in src/selector.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return ret == null ? undefined : ret;
          Severity: Major
          Found in src/attributes/attr.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return false;
            Severity: Major
            Found in src/selector.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return elem[ name ];
              Severity: Major
              Found in src/attributes/prop.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return results;
                Severity: Major
                Found in src/selector.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 src/selector.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return elem.disabled === disabled;
                    Severity: Major
                    Found in src/selector.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return results;
                      Severity: Major
                      Found in src/selector.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language