codenothing/CSSCompressor

View on GitHub

Showing 254 of 254 total issues

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

    callback: function( branch, compressor ) {
        if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
            return;
        }

Severity: Minor
Found in lib/rules/Trim Selector Attribute Quotes.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

Avoid deeply nested control flow statements.
Open

                        if ( jQuery.isPlainObject( context ) ) {
                            selector = [ document.createElement( ret[1] ) ];
                            jQuery.fn.attr.call( selector, context, true );

                        } else {
Severity: Major
Found in demo/rules/js/jquery.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ( !isXML ) {
                            elem.sizcache = doneName;
                            elem.sizset = i;
                        }
    Severity: Major
    Found in demo/rules/js/jquery.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
                                  ret.push({ selector: selector, elem: cur, level: level });
                              }
      Severity: Major
      Found in demo/rules/js/jquery.js - About 45 mins to fix

        Function callback has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            callback: function( branch, compressor ) {
                if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
                    return;
                }
        
        
        Severity: Minor
        Found in lib/rules/ID Attribute to Selector.js - About 45 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

        Avoid deeply nested control flow statements.
        Open

                            if ( copyIsArray ) {
                                copyIsArray = false;
                                clone = src && jQuery.isArray(src) ? src : [];
        
                            } else {
        Severity: Major
        Found in demo/rules/js/jquery.js - About 45 mins to fix

          Function log has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              log: function( key, message, positions ) {
                  var self = this;
          
                  // Empty call to log function returns all logs
                  if ( key === undefined ) {
          Severity: Minor
          Found in lib/CSSCompressor.js - About 45 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

          Avoid deeply nested control flow statements.
          Open

                              if ( ralpha.exec( line = line.replace( rcomkey, '' ) ) ) {
                                  html += line;
                              }
          Severity: Major
          Found in build/comment.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
                                            (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
            
                                        // Get the specific value for the option
                                        value = jQuery(option).val();
            Severity: Major
            Found in demo/rules/js/jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ( display === "inline" ) {
                                              this.style.display = "inline-block";
              
                                          } else {
                                              this.style.display = "inline";
              Severity: Major
              Found in demo/rules/js/jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if ( m = rlink.exec( line ) ) {
                                props.source = "<div class='source'>Source: <a href='" + m[ 1 ] + "'>" + 
                                    encode( line.replace( rlink, '' ).trim() ) +
                                    "</a></div>";
                            }
                Severity: Major
                Found in build/comment.js - About 45 mins to fix

                  Function CLASS has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          CLASS: function( match, curLoop, inplace, result, not, isXML ) {
                  Severity: Minor
                  Found in demo/rules/js/jquery.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if ( !anyFound ) {
                                            return [];
                                        }
                    Severity: Major
                    Found in demo/rules/js/jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                              else if ( m = rcomkey.exec( line ) ) {
                                  seek = m[ 1 ];
                                  html = '';
                      
                                  if ( ralpha.exec( line = line.replace( rcomkey, '' ) ) ) {
                      Severity: Major
                      Found in build/comment.js - About 45 mins to fix

                        Function access has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            access: function( elems, key, value, exec, fn, pass ) {
                        Severity: Minor
                        Found in demo/rules/js/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( special.remove ) {
                                                      special.remove.call( elem, handleObj );
                                                  }
                          Severity: Major
                          Found in demo/rules/js/jquery.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
                                                        if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
                                                            setClass += " " + classNames[c];
                                                        }
                                                    }
                            Severity: Major
                            Found in demo/rules/js/jquery.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( ret === false ) {
                                                          event.preventDefault();
                                                          event.stopPropagation();
                                                      }
                              Severity: Major
                              Found in demo/rules/js/jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ( ret[r] === ret[n] ) {
                                                            ret.splice(n--, 1);
                                                            break;
                                                        }
                                Severity: Major
                                Found in demo/rules/js/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  else if ( a[ i ] !== b[ i ] ) {
                                                      return false;
                                                  }
                                  Severity: Major
                                  Found in lib/Util.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language