jquery/jquery

View on GitHub

Showing 229 of 229 total issues

Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    finish: function( type ) {
        if ( type !== false ) {
            type = type || "fx";
        }
        return this.each( function() {
Severity: Minor
Found in src/effects.js - About 1 hr to fix

    Function off has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        off: function( types, selector, fn ) {
            var handleObj, type;
            if ( types && types.preventDefault && types.handleObj ) {
    
                // ( event )  dispatched jQuery.Event
    Severity: Minor
    Found in src/event.js - About 1 hr to fix

      Function exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function( grunt ) {
          function readOptionalJSON( filepath ) {
              var stripJSONComments = require( "strip-json-comments" ),
                  data = {};
              try {
      Severity: Minor
      Found in Gruntfile.js - About 1 hr 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 remove has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      function remove( elem, selector, keepData ) {
          var node,
              nodes = selector ? jQuery.filter( selector, elem ) : elem,
              i = 0;
      
      
      Severity: Minor
      Found in src/manipulation.js - About 1 hr 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 position has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          position: function() {
              if ( !this[ 0 ] ) {
                  return;
              }
      
      
      Severity: Minor
      Found in src/offset.js - About 1 hr 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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function( grunt ) {
          grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
                  timeout, testMode ) {
              var jobName, config, tests,
                  testswarm = require( "testswarm" ),
      Severity: Minor
      Found in build/tasks/testswarm.js - About 1 hr 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 off has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          off: function( types, selector, fn ) {
              var handleObj, type;
              if ( types && types.preventDefault && types.handleObj ) {
      
                  // ( event )  dispatched jQuery.Event
      Severity: Minor
      Found in src/event.js - About 1 hr 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 which has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          which: function( event ) {
              var button = event.button;
      
              // Add which for key events
              if ( event.which == null && rkeyEvent.test( event.type ) ) {
      Severity: Minor
      Found in src/event.js - About 1 hr 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 position has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          position: function() {
              if ( !this[ 0 ] ) {
                  return;
              }
      
      
      Severity: Minor
      Found in src/offset.js - About 1 hr to fix

        Function when has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            when: function( singleValue ) {
                var
        
                    // count of uncompleted subordinates
                    remaining = arguments.length,
        Severity: Minor
        Found in src/deferred.js - About 1 hr to fix

          Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function propFilter( props, specialEasing ) {
              var index, name, easing, value, hooks;
          
              // camelCase, specialEasing and expand cssHook pass
              for ( index in props ) {
          Severity: Minor
          Found in src/effects.js - About 1 hr to fix

            Function addClass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                addClass: 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 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  grunt.registerTask( "promises_aplus_tests:when", function() {
                      spawnTest( this.async(),
                          "\"" + __dirname + "/../../node_modules/.bin/promises-aplus-tests\"" +
                              " test/promises_aplus_adapters/when.js" +
                              " --reporter dot" +
              Severity: Major
              Found in build/tasks/promises_aplus_tests.js and 1 other location - About 1 hr to fix
              build/tasks/promises_aplus_tests.js on lines 10..17

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  grunt.registerTask( "promises_aplus_tests:deferred", function() {
                      spawnTest( this.async(),
                          "\"" + __dirname + "/../../node_modules/.bin/promises-aplus-tests\"" +
                              " test/promises_aplus_adapters/deferred.js" +
                              " --reporter dot" +
              Severity: Major
              Found in build/tasks/promises_aplus_tests.js and 1 other location - About 1 hr to fix
              build/tasks/promises_aplus_tests.js on lines 19..26

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function remove has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  remove: function( owner, key ) {
                      var i,
                          cache = owner[ this.expando ];
              
                      if ( cache === undefined ) {
              Severity: Minor
              Found in src/data/Data.js - About 1 hr to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        odd: createPositionalPseudo( function( matchIndexes, length ) {
                            var i = 1;
                            for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                            }
                Severity: Minor
                Found in src/selector.js and 1 other location - About 55 mins to fix
                src/selector.js on lines 987..993

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 54.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        even: createPositionalPseudo( function( matchIndexes, length ) {
                            var i = 0;
                            for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                            }
                Severity: Minor
                Found in src/selector.js and 1 other location - About 55 mins to fix
                src/selector.js on lines 995..1001

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 54.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function css has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    css: function( elem, name, extra, styles ) {
                        var val, num, hooks,
                            origName = cssCamelCase( name ),
                            isCustomProp = rcustomProp.test( name );
                
                
                Severity: Minor
                Found in src/css.js - About 55 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 queue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    queue: function( elem, type, data ) {
                        var queue;
                
                        if ( elem ) {
                            type = ( type || "fx" ) + "queue";
                Severity: Minor
                Found in src/queue.js - About 55 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 DOMEval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                function DOMEval( code, node, doc ) {
                    doc = doc || document;
                
                    var i, val,
                        script = doc.createElement( "script" );
                Severity: Minor
                Found in src/core/DOMEval.js - About 55 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