jacquev6/variadic

View on GitHub

Showing 164 of 201 total issues

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 docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

      initOnKeyListeners: function() {
        $(document).keyup(function(event) {
          var activeElementType = document.activeElement.tagName;
          // don't navigate when in search box or textarea
          if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
    Severity: Minor
    Found in docs/_static/doctools.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 toggleClass has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        toggleClass: function( value, stateVal ) {
            var type = typeof value;
    
            if ( typeof stateVal === "boolean" && type === "string" ) {
                return stateVal ? this.addClass( value ) : this.removeClass( value );
    Severity: Minor
    Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

      Function highlight has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function highlight(node, addItems) {
          if (node.nodeType === 3) {
            var val = node.nodeValue;
            var pos = val.toLowerCase().indexOf(text);
            if (pos >= 0 &&
      Severity: Minor
      Found in docs/_static/doctools.js - About 1 hr to fix

        Function adjustCSS has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function adjustCSS( elem, prop, valueParts, tween ) {
            var adjusted,
                scale = 1,
                maxIterations = 20,
                currentValue = tween ?
        Severity: Minor
        Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

          Function handleVote has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function handleVote(link) {
              if (!opts.voting) {
                showError("You'll need to login to vote.");
                return;
              }
          Severity: Minor
          Found in docs/_static/websupport.js - About 1 hr to fix

            Function dispatch has 38 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 docs/_static/jquery-3.2.1.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 docs/_static/jquery-3.2.1.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 docs/_static/jquery-3.2.1.js - About 1 hr to fix

                  Function handlers has 34 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 docs/_static/jquery-3.2.1.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 docs/_static/jquery-3.2.1.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
                      
                              // Trust units reported by jQuery.css
                              unit = unit || initialInUnit[ 3 ];
                      
                      
                      Severity: Critical
                      Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                        function showHide( elements, show ) {
                            var display, elem,
                                values = [],
                                index = 0,
                                length = elements.length;
                        Severity: Minor
                        Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                          jQuery.fn.load = function( url, params, callback ) {
                              var selector, type, response,
                                  self = this,
                                  off = url.indexOf( " " );
                          
                          
                          Severity: Minor
                          Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                            Function removeClass has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                removeClass: function( value ) {
                                    var classes, elem, cur, curValue, clazz, j, finalValue,
                                        i = 0;
                            
                                    if ( jQuery.isFunction( value ) ) {
                            Severity: Minor
                            Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                              Function speed has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              jQuery.speed = function( speed, easing, fn ) {
                                  var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
                                      complete: fn || !fn && easing ||
                                          jQuery.isFunction( speed ) && speed,
                                      duration: speed,
                              Severity: Minor
                              Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                                Function attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    attr: function( elem, name, value ) {
                                        var ret, hooks,
                                            nType = elem.nodeType;
                                
                                        // Don't get/set attributes on text, comment and attribute nodes
                                Severity: Minor
                                Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                                  Function deleteComment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function deleteComment(id) {
                                      $.ajax({
                                        type: 'POST',
                                        url: opts.deleteCommentURL,
                                        data: {id: id},
                                  Severity: Minor
                                  Found in docs/_static/websupport.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 docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                                      jQuery.parseHTML = function( data, context, keepScripts ) {
                                          if ( typeof data !== "string" ) {
                                              return [];
                                          }
                                          if ( typeof context === "boolean" ) {
                                      Severity: Minor
                                      Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language