codenothing/CSSCompressor

View on GitHub

Showing 254 of 254 total issues

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

                        if ( parts.length === 1 ) {
                            parts.push( parts[ 0 ] );
                            parts.push( parts[ 0 ] );
                            parts.push( parts[ 0 ] );
                        }
Severity: Minor
Found in lib/rules/Margin, Padding Combinations.js and 1 other location - About 40 mins to fix
lib/rules/Border Radius Combinations.js on lines 110..121

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 49.

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

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

                            if ( parts.length === 1 ) {
                                parts.push( parts[ 0 ] );
                                parts.push( parts[ 0 ] );
                                parts.push( parts[ 0 ] );
                            }
Severity: Minor
Found in lib/rules/Border Radius Combinations.js and 1 other location - About 40 mins to fix
lib/rules/Margin, Padding Combinations.js on lines 73..84

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 49.

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

Consider simplifying this complex logical expression.
Open

            if ( (!special._default || special._default.call( elem, event ) === false) && 
                !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {

                try {
                    if ( target[ targetType ] ) {
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 ( 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

          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

                    if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
                            Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
            
                        ret = Sizzle.find( parts.shift(), context, contextXML );
                        context = ret.expr ?
            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

                Function PSEUDO has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function textSelection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  jQuery.fn.textSelection = function( start, end ) {
                      return this.each(function( i, element ) {
                          var textarea = jQuery( element ),
                              height = textarea.height(),
                              current, caret, ypos, range;
                  Severity: Minor
                  Found in demo/js/home.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      callback: function( value, position, compressor ) {
                          var m = rhsl.exec( value ),
                              str = '#',
                              h, s, l,
                              p, q;
                  Severity: Minor
                  Found in lib/rules/HSL to Hex.js - About 35 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 7 (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 Comments.js - About 35 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

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

                          if ( ! rfontweightprop.exec( rule.property ) || ! rule.parts || ! rule.parts.length ) {
                              return;
                          }
                  Severity: Minor
                  Found in lib/rules/Font Weight Conversion.js and 1 other location - About 35 mins to fix
                  lib/rules/Font Family Quotes.js on lines 31..33

                  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 46.

                  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

                                  if ( selector.length && ! rselectorbreak.exec( part ) && ! rselectorbreak.exec( prev ) ) {
                                      selector += ' ';
                                  }
                  Severity: Minor
                  Found in lib/formats/None.js and 1 other location - About 35 mins to fix
                  lib/formats/None.js on lines 79..81

                  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 46.

                  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

                          if ( ! rfontfamilyprop.exec( rule.property ) || ! rule.parts || ! rule.parts.length ) {
                              return;
                          }
                  Severity: Minor
                  Found in lib/rules/Font Family Quotes.js and 1 other location - About 35 mins to fix
                  lib/rules/Font Weight Conversion.js on lines 35..37

                  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 46.

                  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

                                          if ( value.length && ! rvalueseparator.exec( part ) && ! rvalueseparator.exec( prev ) ) {
                                              value += ' ';
                                          }
                  Severity: Minor
                  Found in lib/formats/None.js and 1 other location - About 35 mins to fix
                  lib/formats/None.js on lines 22..24

                  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 46.

                  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

                  Avoid too many return statements within this function.
                  Open

                                          return diff === 0;
                  Severity: Major
                  Found in demo/rules/js/jquery.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return siblingCheck( ap[i], bp[i] );
                    Severity: Major
                    Found in demo/rules/js/jquery.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return jQuery( context ).find( selector );
                      Severity: Major
                      Found in demo/rules/js/jquery.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language