jquery/jquery

View on GitHub

Showing 228 of 250 total issues

Function style has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    style: function( elem, name, value, extra ) {

        // Don't set styles on text and comment nodes
        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
            return;
Severity: Minor
Found in src/css.js - About 1 hr to fix

    Function throws has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              value: function throws(block, expected, message) {
                  var actual = void 0,
                      result = false;
    
                  var currentTest = this instanceof Assert && this.test || config.current;
    Severity: Minor
    Found in external/qunit/qunit.js - About 1 hr to fix

      Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function on( elem, types, selector, data, fn, one ) {
          var origFn, type;
      
          // Types can be a map of types/handlers
          if ( typeof types === "object" ) {
      Severity: Minor
      Found in src/event.js - About 1 hr to fix

        Function toggleClass has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            toggleClass: function( value, stateVal ) {
                var type = typeof value,
                    isValidValue = type === "string" || Array.isArray( value );
        
                if ( typeof stateVal === "boolean" && isValidValue ) {
        Severity: Minor
        Found in src/attributes/classes.js - About 1 hr to fix

          Function load has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              req.load = function (context, moduleName, url) {
                  var config = (context && context.config) || {},
                      node;
                  if (isBrowser) {
                      //In the browser so use a script tag
          Severity: Minor
          Found in external/requirejs/require.js - About 1 hr to fix

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

            module.exports = function( grunt ) {
            
                "use strict";
            
                var fs = require( "fs" ),
            Severity: Minor
            Found in build/tasks/build.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 dispatch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                dispatch: function( nativeEvent ) {
            
                    // Make a writable jQuery.Event from the native event object
                    var event = jQuery.event.fix( nativeEvent );
            
            
            Severity: Minor
            Found in src/event.js - About 1 hr to fix

              Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function ajaxHandleResponses( s, jqXHR, responses ) {
              
                  var ct, type, finalDataType, firstDataType,
                      contents = s.contents,
                      dataTypes = s.dataTypes;
              Severity: Minor
              Found in src/ajax.js - About 1 hr to fix

                Function processModule has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function processModule(name, options, executeNow) {
                      var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
                
                      if (objectType(options) === "function") {
                          executeNow = options;
                Severity: Minor
                Found in external/qunit/qunit.js - About 1 hr to fix

                  Function boxModelAdjustment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
                      var i = dimension === "width" ? 1 : 0,
                          extra = 0,
                          delta = 0;
                  
                  
                  Severity: Minor
                  Found in src/css.js - About 1 hr to fix

                    Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                                    mightThrow = function() {
                                                        var returned, then;
                    
                                                        // Support: Promises/A+ section 2.3.3.3.3
                                                        // https://promisesaplus.com/#point-59
                    Severity: Minor
                    Found in src/deferred.js - About 1 hr to fix

                      Function localRequire has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      function localRequire(deps, callback, errback) {
                                          var id, map, requireMod;
                      
                                          if (options.enableBuildCallback && callback && isFunction(callback)) {
                                              callback.__requireJsBuild = true;
                      Severity: Minor
                      Found in external/requirejs/require.js - About 1 hr to fix

                        Function Promise$2 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          var Promise$2 = function () {
                            function Promise(resolver) {
                              classCallCheck(this, Promise);
                        
                              this[PROMISE_ID] = nextId();
                        Severity: Minor
                        Found in external/qunit/qunit.js - About 1 hr to fix

                          Function done has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function done() {
                                var storage = config.storage;
                          
                                ProcessingQueue.finished = true;
                          
                          
                          Severity: Minor
                          Found in external/qunit/qunit.js - About 1 hr to fix

                            Function diffCompute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  DiffMatchPatch.prototype.diffCompute = function (text1, text2, checklines, deadline) {
                                      var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB;
                            
                                      if (!text1) {
                            
                            
                            Severity: Minor
                            Found in external/qunit/qunit.js - About 1 hr to fix

                              Function diffLinesToChars has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    DiffMatchPatch.prototype.diffLinesToChars = function (text1, text2) {
                                        var lineArray, lineHash, chars1, chars2;
                                        lineArray = []; // E.g. lineArray[4] === 'Hello\n'
                                        lineHash = {}; // E.g. lineHash['Hello\n'] === 4
                              
                              
                              Severity: Minor
                              Found in external/qunit/qunit.js - About 1 hr to fix

                                Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    setOffset: function( elem, options, i ) {
                                        var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                                            position = jQuery.css( elem, "position" ),
                                            curElem = jQuery( elem ),
                                            props = {};
                                Severity: Minor
                                Found in src/offset.js - About 1 hr to fix

                                  Function completeLoad has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              completeLoad: function (moduleName) {
                                                  var found, args, mod,
                                                      shim = getOwn(config.shim, moduleName) || {},
                                                      shExports = shim.exports;
                                  
                                  
                                  Severity: Minor
                                  Found in external/requirejs/require.js - About 1 hr to fix

                                    Function ATTR has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            "ATTR": function( name, operator, check ) {
                                                return function( elem ) {
                                                    var result = jQuery.attr( elem, name );
                                    
                                                    if ( result == null ) {
                                    Severity: Minor
                                    Found in src/selector.js - About 1 hr to fix

                                      Function handlers has 33 lines of code (exceeds 25 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 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language