codenothing/CSSCompressor

View on GitHub

Showing 254 of 254 total issues

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

jQuery.extend = jQuery.fn.extend = function() {
     var options, name, src, copy, copyIsArray, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
Severity: Minor
Found in demo/rules/js/jquery.js - About 1 hr to fix

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

        load: function( url, params, callback ) {
            if ( typeof url !== "string" && _load ) {
                return _load.apply( this, arguments );
    
            // Don't do a request if no elements are being requested
    Severity: Minor
    Found in demo/rules/js/jquery.js - About 1 hr to fix

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

          callback: function( branch, compressor ) {
              if ( ! branch.rules || ! branch.rules.length ) {
                  return;
              }
      
      
      Severity: Minor
      Found in lib/rules/Border Combinations.js - About 1 hr to fix

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

            data: function( key, value ) {
                var data = null;
        
                if ( typeof key === "undefined" ) {
                    if ( this.length ) {
        Severity: Minor
        Found in demo/rules/js/jquery.js - About 1 hr to fix

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

              callback: function( branch, compressor ) {
                  if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
                      return;
                  }
          
          
          Severity: Minor
          Found in lib/rules/Comma Repeats.js - About 1 hr to fix

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

                objectsMatch: function( a, b ) {
                    var isArray = CSSCompressor.isArray,
                        isObject = CSSCompressor.isObject,
                        i;
            
            
            Severity: Minor
            Found in lib/Util.js - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      branch.parts.forEach(function( part ) {
                          if ( part === ',' ) {
                              commaParts.push( current );
                              current = [];
                          }
              Severity: Major
              Found in lib/rules/Strict ID.js and 1 other location - About 1 hr to fix
              lib/rules/Comma Repeats.js on lines 37..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      branch.parts.forEach(function( part ) {
                          if ( part === ',' ) {
                              parts.push( current );
                              current = [];
                          }
              Severity: Major
              Found in lib/rules/Comma Repeats.js and 1 other location - About 1 hr to fix
              lib/rules/Strict ID.js on lines 40..48

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                  callback: function( value, position, compressor ) {
                      var m = rfunction.exec( value ),
                          iter = new StringIterator( ( m || [] )[ 2 ] || '' ),
                          string = '',
                          parts = [];
              Severity: Minor
              Found in lib/rules/Function Units.js - About 1 hr to fix

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

                    callback: function( branch, compressor ) {
                        if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
                            return;
                        }
                
                
                Severity: Minor
                Found in lib/rules/Sort Multi Selectors.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          CSSCompressor.extend( self.after, {
                              size: compressor.css.length,
                              selectors: self._selectorCount( compressor.branches ),
                              properties: self._propertyCount( compressor.branches )
                          });
                  Severity: Major
                  Found in lib/Stats.js and 1 other location - About 1 hr to fix
                  lib/Stats.js on lines 36..40

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 64.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      CSSCompressor.each( options.on || [], function( key ) {
                          if ( ( key = key.trim() ).length ) {
                              settings[ key ] = true;
                          }
                      });
                  Severity: Major
                  Found in lib/Cli.js and 1 other location - About 1 hr to fix
                  lib/Cli.js on lines 79..83

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 64.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          CSSCompressor.extend( self.before, {
                              size: compressor.original.length,
                              selectors: self._selectorCount( compressor.branches ),
                              properties: self._propertyCount( compressor.branches )
                          });
                  Severity: Major
                  Found in lib/Stats.js and 1 other location - About 1 hr to fix
                  lib/Stats.js on lines 51..55

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 64.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      CSSCompressor.each( options.off || [], function( key ) {
                          if ( ( key = key.trim() ).length ) {
                              settings[ key ] = false;
                          }
                      });
                  Severity: Major
                  Found in lib/Cli.js and 1 other location - About 1 hr to fix
                  lib/Cli.js on lines 72..76

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 64.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      callback: function( branch, compressor ) {
                          if ( ! branch.rules || ! branch.rules.length ) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in lib/rules/Margin, Padding Combinations.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 each has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      each: function( items, fn ) {
                          var i = -1, l = items.length;
                  
                          if ( CSSCompressor.isArray( items ) ) {
                              for ( ; ++i < l; ) {
                  Severity: Minor
                  Found in lib/Util.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 eachArgs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      eachArgs: function( items, fn ) {
                          var i = -1, l = items.length;
                  
                          if ( CSSCompressor.isArray( items ) ) {
                              for ( ; ++i < l; ) {
                  Severity: Minor
                  Found in lib/Util.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 callback has 34 lines of code (exceeds 25 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 1 hr to fix

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

                        fix: function( event ) {
                            if ( event[ jQuery.expando ] ) {
                                return event;
                            }
                    
                    
                    Severity: Minor
                    Found in demo/rules/js/jquery.js - About 1 hr to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if ( imports.length ) {
                                  imports.forEach(function( branch ) {
                                      CSSCompressor.removeItem( branches, branch );
                                      branches.splice( pos, 0, branch );
                                      compressor.log( 'Moving import to the top', branch.position );
                      Severity: Major
                      Found in lib/rules/Order Atrules.js and 1 other location - About 1 hr to fix
                      lib/rules/Order Atrules.js on lines 67..73

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 62.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language