codenothing/CSSCompressor

View on GitHub

Showing 179 of 254 total issues

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 ( 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 ( ! CSSCompressor.objectsMatch( a[ i ], b[ i ] ) ) {
                              return false;
                          }
      Severity: Major
      Found in lib/Util.js - About 45 mins to fix

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

        function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
        Severity: Minor
        Found in demo/rules/js/jquery.js - About 45 mins to fix

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

          function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
          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

                                  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

                                else if ( line.trim().indexOf( '*/' ) === 0 ) {
                                    comexit = true;
                                }
                Severity: Major
                Found in build/comment.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

                    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

                      Avoid deeply nested control flow statements.
                      Open

                                                  if ( j !== 0 && i !== 0 ) {
                                                      compressor.log(
                                                          "Promoting nested ID to selector front",
                                                          branch.position
                                                      );
                      Severity: Major
                      Found in lib/rules/Strict ID.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.rules || ! branch.rules.length ) {
                                    return;
                                }
                        
                        
                        Severity: Minor
                        Found in lib/rules/Font Combinations.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

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

                            callback: function( branch, compressor ) {
                                if ( ! branch.rules || ! branch.rules.length ) {
                                    return;
                                }
                        
                        
                        Severity: Minor
                        Found in lib/rules/Duplicate Properties.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 ( rule.parts.length == 2 ) {
                                                    separator = true;
                                                    sections[ 0 ][ 1 ] = rule.parts[ 0 ];
                                                    sections[ 1 ][ 1 ] = rule.parts[ 1 ];
                                                }
                        Severity: Major
                        Found in lib/rules/Border Radius Combinations.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              else if ( rule.property == graph.bottomright ) {
                                                  if ( rule.parts.length == 2 ) {
                                                      separator = true;
                                                      sections[ 0 ][ 2 ] = rule.parts[ 0 ];
                                                      sections[ 1 ][ 2 ] = rule.parts[ 1 ];
                          Severity: Major
                          Found in lib/rules/Border Radius Combinations.js - About 45 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                            if ( jQuery.expr && jQuery.expr.filters ) {
                                jQuery.expr.filters.hidden = function( elem ) {
                                    var width = elem.offsetWidth,
                                        height = elem.offsetHeight;
                            
                            
                            Severity: Major
                            Found in demo/rules/js/jquery.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      } else if ( typeof value === "string" && !rnocache.test( value ) &&
                                          (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
                                          !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
                              
                                          value = value.replace(rxhtmlTag, "<$1></$2>");
                              Severity: Major
                              Found in demo/rules/js/jquery.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
                                                    (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
                                                    type === "select-multiple" ) {
                                                    return testChange.call( this, e );
                                                }
                                Severity: Major
                                Found in demo/rules/js/jquery.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( h > 1 || s > 1 || l > 1 || h < 0 || s < 0 || l < 0 ) {
                                                  return;
                                              }
                                  Severity: Major
                                  Found in lib/rules/HSL to Hex.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                if ( branch.branches || branch.rules ) {
                                                    css += indent + selector + " {" + ( branch.rules && branch.branches ? "\n\t" + indent : '' );
                                    
                                                    // Add rules
                                                    branch.rules.forEach(function( rule, i ) {
                                    Severity: Major
                                    Found in lib/formats/Minimum.js - About 40 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language