jquery/jquery

View on GitHub

Showing 229 of 229 total issues

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

    remove: function( elem, types, handler, selector, mappedTypes ) {

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

    Function exports has 52 lines of code (exceeds 25 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: Major
    Found in build/tasks/testswarm.js - About 2 hrs to fix

      File css.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import jQuery from "./core.js";
      import access from "./core/access.js";
      import nodeName from "./core/nodeName.js";
      import rcssNum from "./var/rcssNum.js";
      import isIE from "./var/isIE.js";
      Severity: Minor
      Found in src/css.js - About 2 hrs to fix

        Function buildFragment has 51 lines of code (exceeds 25 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: Major
        Found in src/manipulation/buildFragment.js - About 2 hrs to fix

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

          function select( 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 src/selector.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                            if ( ( mappedTypes || origType === handleObj.origType ) &&
                                ( !handler || handler.guid === handleObj.guid ) &&
                                ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                ( !selector || selector === handleObj.selector ||
                                    selector === "**" && handleObj.selector ) ) {
            Severity: Critical
            Found in src/event.js - About 2 hrs to fix

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

              module.exports = function( Release ) {
              
                  var
                      distFiles = [
                          "dist/jquery.js",
              Severity: Minor
              Found in build/release.js - About 1 hr to fix

                Function propFilter has a Cognitive Complexity of 15 (exceeds 5 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

                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 15 (exceeds 5 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

                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 tokenize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function matcherFromTokens has 47 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 src/selector.js - About 1 hr to fix

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

                    module.exports = function( grunt ) {
                        var    fs = require( "fs" ),
                            filename = grunt.option( "filename" ),
                            distpaths = [
                                "dist/" + filename,
                    Severity: Minor
                    Found in build/tasks/dist.js - About 1 hr to fix

                      Function addCombinator has 45 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 src/selector.js - About 1 hr to fix

                        Function data has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            data: function( key, value ) {
                                var i, name, data,
                                    elem = this[ 0 ],
                                    attrs = elem && elem.attributes;
                        
                        
                        Severity: Minor
                        Found in src/data.js - About 1 hr to fix

                          Function leverageNative has 44 lines of code (exceeds 25 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 1 hr to fix

                            Function sortOrder has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function sortOrder( a, b ) {
                            
                                // Flag for duplicate removal
                                if ( a === b ) {
                                    hasDuplicate = true;
                            Severity: Minor
                            Found in src/selector/uniqueSort.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 extend has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jQuery.extend = jQuery.fn.extend = function() {
                                var options, name, src, copy, copyIsArray, clone,
                                    target = arguments[ 0 ] || {},
                                    i = 1,
                                    length = arguments.length,
                            Severity: Minor
                            Found in src/core.js - About 1 hr to fix

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

                              if ( document.readyState !== "loading" ) {
                              
                                  // Handle it asynchronously to allow scripts the opportunity to delay ready
                                  window.setTimeout( jQuery.ready );
                              
                              
                              Severity: Major
                              Found in src/core/ready-no-deferred.js and 1 other location - About 1 hr to fix
                              src/core/ready.js on lines 66..78

                              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 69.

                              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

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

                              if ( document.readyState !== "loading" ) {
                              
                                  // Handle it asynchronously to allow scripts the opportunity to delay ready
                                  window.setTimeout( jQuery.ready );
                              
                              
                              Severity: Major
                              Found in src/core/ready.js and 1 other location - About 1 hr to fix
                              src/core/ready-no-deferred.js on lines 75..87

                              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 69.

                              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 val has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  val: function( value ) {
                                      var hooks, ret, valueIsFunction,
                                          elem = this[ 0 ];
                              
                                      if ( !arguments.length ) {
                              Severity: Minor
                              Found in src/attributes/val.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language