codenothing/CSSCompressor

View on GitHub

Showing 179 of 254 total issues

Function callback has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in lib/rules/Font Combinations.js - About 2 hrs to fix

    Function render has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function render( css, branches ) {
        branches.forEach(function( branch, branchIndex ) {
            var newparts = [], nextBranch = branches[ branchIndex + 1 ], selector = '';
    
            // Comments
    Severity: Major
    Found in lib/formats/None.js - About 2 hrs to fix

      Function val has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          val: function( value ) {
              if ( !arguments.length ) {
                  var elem = this[0];
      
                  if ( elem ) {
      Severity: Major
      Found in demo/rules/js/jquery.js - About 2 hrs to fix

        Function filter has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Sizzle.filter = function( expr, set, inplace, not ) {
            var match, anyFound,
                old = expr,
                result = [],
                curLoop = set,
        Severity: Major
        Found in demo/rules/js/jquery.js - About 2 hrs to fix

          Function init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              init: function( selector, context ) {
                  var match, elem, ret, doc;
          
                  // Handle $(""), $(null), or $(undefined)
                  if ( !selector ) {
          Severity: Major
          Found in demo/rules/js/jquery.js - About 2 hrs to fix

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

                callback: function( branches, compressor ) {
                    function strip( array ) {
                        for ( var i = -1, branch; ++i < array.length; ) {
                            branch = array[ i ];
            
            
            Severity: Minor
            Found in lib/rules/Strip Empty Branches.js - About 2 hrs 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 attr has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                attr: function( elem, name, value, pass ) {
                    // don't set attributes on text and comment nodes
                    if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
                        return undefined;
                    }
            Severity: Major
            Found in demo/rules/js/jquery.js - About 2 hrs to fix

              Function liveHandler has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function liveHandler( event ) {
                  var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
                      elems = [],
                      selectors = [],
                      events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
              Severity: Major
              Found in demo/rules/js/jquery.js - About 2 hrs to fix

                Function clean has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    clean: function( elems, context, fragment, scripts ) {
                        context = context || document;
                
                        // !context.createElement fails in IE with an error but returns typeof 'object'
                        if ( typeof context.createElement === "undefined" ) {
                Severity: Major
                Found in demo/rules/js/jquery.js - About 2 hrs to fix

                  Function callback has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      callback: function( value, position, compressor ) {
                          var m = rgradient.exec( value ),
                              before = value,
                              prefix = ( m || [] )[ 1 ] || '',
                              iter = new StringIterator( ( m || [] )[ 3 ] || '' ),
                  Severity: Major
                  Found in lib/rules/Gradient Compression.js - About 2 hrs to fix

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

                        callback: function( rule, branch, compressor ) {
                            if ( rule.property == 'margin' || rule.property == 'padding' ) {
                                // Local copies
                                var before = rule.parts.slice( 0 ),
                                    parts = rule.parts.slice( 0 );
                    Severity: Minor
                    Found in lib/rules/Margin, Padding Shorthand.js - About 2 hrs 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 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        callback: function( rule, branch, compressor ) {
                            if ( ! rshortradiusprop.exec( rule.property ) || ! rule.parts || ! rule.parts.length ) {
                                return;
                            }
                    
                    
                    Severity: Major
                    Found in lib/rules/Border Radius Shorthand.js - About 2 hrs to fix

                      Function callback has a Cognitive Complexity of 17 (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/Class Attribute to Selector.js - About 2 hrs 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 offset has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          jQuery.fn.offset = function( options ) {
                              var elem = this[0];
                      
                              if ( options ) { 
                                  return this.each(function( i ) {
                      Severity: Major
                      Found in demo/rules/js/jquery.js - About 2 hrs to fix

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

                            callback: function( branch, compressor ) {
                                if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
                                    return;
                                }
                        
                        
                        Severity: Major
                        Found in lib/rules/Class Attribute to Selector.js - About 2 hrs to fix

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

                              callback: function( branches, compressor ) {
                                  var index = -1, subindex = -1, branch, next;
                          
                                  for ( ; ++index < branches.length; ) {
                                      branch = branches[ index ];
                          Severity: Minor
                          Found in lib/rules/Common Selectors.js - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              callback: function( branches, compressor ) {
                                  var index = -1, subindex = -1, branch, next;
                          
                                  for ( ; ++index < branches.length; ) {
                                      branch = branches[ index ];
                          Severity: Minor
                          Found in lib/rules/Common Rules.js - About 2 hrs 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 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              callback: function( branch, compressor ) {
                                  if ( ! branch.rules || ! branch.rules.length ) {
                                      return;
                                  }
                          
                          
                          Severity: Major
                          Found in lib/rules/Border, Outline Style Combinations.js - About 2 hrs to fix

                            Function callback has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                callback: function( branch, compressor ) {
                                    if ( ! branch.rules || ! branch.rules.length ) {
                                        return;
                                    }
                            
                            
                            Severity: Major
                            Found in lib/rules/List Style Combinations.js - About 2 hrs to fix

                              Function callback has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  callback: function( value, position, compressor ) {
                                      var m = rcalc.exec( value ),
                                          before = value,
                                          prefix = ( m || [] )[ 1 ] || '',
                                          iter = new StringIterator( ( m || [] )[ 3 ] || '' ),
                              Severity: Minor
                              Found in lib/rules/Calc Units.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language