jquery/jquery

View on GitHub

Showing 374 of 374 total issues

Function domManip has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function domManip( collection, args, callback, ignored ) {

    // Flatten any nested arrays
    args = concat.apply( [], args );

Severity: Major
Found in src/manipulation.js - About 2 hrs to fix

    Function makeApi has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function makeApi(sinon) {
    
            // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
            var hasDontEnumBug = (function () {
                var obj = {
    Severity: Major
    Found in external/sinon/sinon.js - About 2 hrs to fix

      Function makeApi has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function makeApi(sinon) {
              sinon.Event = function Event(type, bubbles, cancelable, target) {
                  this.initEvent(type, bubbles, cancelable, target);
              };
      
      
      Severity: Major
      Found in external/sinon/sinon.js - About 2 hrs to fix

        Function diffCleanupEfficiency has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            DiffMatchPatch.prototype.diffCleanupEfficiency = function( diffs ) {
                var changes, equalities, equalitiesLength, lastequality,
                    pointer, preIns, preDel, postIns, postDel;
                changes = false;
                equalities = []; // Stack of indices where equalities are found.
        Severity: Major
        Found in external/qunit/qunit.js - About 2 hrs to fix

          Function checkLoaded has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function checkLoaded() {
                      var err, usingPathFallback,
                          waitInterval = config.waitSeconds * 1000,
                          //It is possible to disable the wait interval by using waitSeconds of 0.
                          expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
          Severity: Major
          Found in external/requirejs/require.js - About 2 hrs to fix

            Function defake has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
                    var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
            
                    each([
                        "open",
            Severity: Major
            Found in external/sinon/sinon.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

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

                function getUrlConfigHtml() {
                    var i, j, val,
                        escaped, escapedTooltip,
                        selection = false,
                        urlConfig = config.urlConfig,
                Severity: Major
                Found in external/qunit/qunit.js - About 2 hrs to fix

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

                      module: function( name, testEnvironment, executeNow ) {
                          var module, moduleFns;
                          var currentModule = config.currentModule;
                  
                          if ( arguments.length === 2 ) {
                  Severity: Major
                  Found in external/qunit/qunit.js - About 2 hrs to fix

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

                        function makeApi(sinon) {
                            var slice = Array.prototype.slice;
                    
                            function test(callback) {
                                var type = typeof callback;
                    Severity: Major
                    Found in external/sinon/sinon.js - About 2 hrs to fix

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

                      /* global Symbol */
                      // Defining this global in .eslintrc.json would create a danger of using the global
                      // unguarded in another place, it seems safer to define global only for this module
                      
                      define( [
                      Severity: Minor
                      Found in src/core.js - About 2 hrs to fix

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

                                    yieldsRight: function () {
                                        this.callArgAt = useRightMostCallback;
                                        this.callbackArguments = slice.call(arguments, 0);
                                        this.callbackContext = undefined;
                                        this.callArgProp = undefined;
                        Severity: Major
                        Found in external/sinon/sinon.js and 1 other location - About 2 hrs to fix
                        external/sinon/sinon.js on lines 3189..3197

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

                        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

                                    yields: function () {
                                        this.callArgAt = useLeftMostCallback;
                                        this.callbackArguments = slice.call(arguments, 0);
                                        this.callbackContext = undefined;
                                        this.callArgProp = undefined;
                        Severity: Major
                        Found in external/sinon/sinon.js and 1 other location - About 2 hrs to fix
                        external/sinon/sinon.js on lines 3199..3207

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

                        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 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 ) {
                          
                              "use strict";
                          
                              grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
                          Severity: Major
                          Found in build/tasks/testswarm.js - About 2 hrs to fix

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

                                    function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
                                        var url, pluginModule, suffix, nameParts,
                                            prefix = null,
                                            parentName = parentModuleMap ? parentModuleMap.name : null,
                                            originalName = name,
                            Severity: Major
                            Found in external/requirejs/require.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 normalize has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function normalize(name, baseName, applyMap) {
                                            var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
                                                foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
                                                baseParts = (baseName && baseName.split('/')),
                                                map = config.map,
                                Severity: Major
                                Found in external/requirejs/require.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 match has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        match = function match(object, matcher) {
                                            if (matcher && typeof matcher.test === "function") {
                                                return matcher.test(object);
                                            }
                                    
                                    
                                    Severity: Minor
                                    Found in external/sinon/sinon.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language