codenothing/CSSCompressor

View on GitHub

Showing 179 of 254 total issues

File jquery.js has 4932 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.4.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
Severity: Major
Found in demo/rules/js/jquery.js - About 2 wks to fix

    Function jQuery has 548 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var jQuery = (function() {
    
    // Define a local copy of jQuery
    var jQuery = function( selector, context ) {
            // The jQuery object is actually just the init constructor 'enhanced'
    Severity: Major
    Found in demo/rules/js/jquery.js - About 2 days to fix

      Function ajax has 193 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajax: function( origSettings ) {
              var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
                  jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
      
              s.url = s.url.replace( rhash, "" );
      Severity: Major
      Found in demo/rules/js/jquery.js - About 7 hrs to fix

        Function callback has 145 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 Radius Combinations.js - About 5 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                  if ( event.pageX == null && event.clientX != null ) {
                      var doc = document.documentElement,
                          body = document.body;
          
                      event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
          Severity: Critical
          Found in demo/rules/js/jquery.js - About 4 hrs to fix

            Function Sizzle has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Sizzle = function( selector, context, results, seed ) {
                results = results || [];
                context = context || document;
            
                var origContext = context;
            Severity: Major
            Found in demo/rules/js/jquery.js - About 4 hrs to fix

              Function objectsMatch has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  objectsMatch: function( a, b ) {
                      var isArray = CSSCompressor.isArray,
                          isObject = CSSCompressor.isObject,
                          i;
              
              
              Severity: Minor
              Found in lib/Util.js - About 3 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 render has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function render( css, branches, indent ) {
                  if ( indent === undefined ) {
                      indent = '';
                  }
              
              
              Severity: Major
              Found in lib/formats/Medium.js - About 3 hrs to fix

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

                function render( css, branches, indent ) {
                    if ( indent === undefined ) {
                        indent = '';
                    }
                
                
                Severity: Major
                Found in lib/formats/Minimum.js - About 3 hrs to fix

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

                  function render( css, branches, indent ) {
                      if ( indent === undefined ) {
                          indent = '';
                      }
                  
                  
                  Severity: Major
                  Found in lib/formats/Max.js - About 3 hrs to fix

                    Function remove has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        remove: function( elem, types, handler, pos ) {
                            // don't do events on text and comment nodes
                            if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
                                return;
                            }
                    Severity: Major
                    Found in demo/rules/js/jquery.js - About 3 hrs to fix

                      Function add has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          add: function( elem, types, handler, data ) {
                              if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
                                  return;
                              }
                      
                      
                      Severity: Major
                      Found in demo/rules/js/jquery.js - About 3 hrs to fix

                        Function exports has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function( content ) {
                            var html = '', m, i,
                                seek = null,
                                comexit = false,
                                props = {
                        Severity: Major
                        Found in build/comment.js - About 3 hrs to fix

                          Function callback has 78 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/Margin, Padding Combinations.js - About 3 hrs to fix

                            File home.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*
                             * WARNING! This control file is a giant mess. Read at your own risk.
                             * TODO: Organize this file
                             */
                            function prettySettingsJSON( settings ) {
                            Severity: Minor
                            Found in demo/js/home.js - About 3 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                              if ( "getBoundingClientRect" in document.documentElement ) {
                                  jQuery.fn.offset = function( options ) {
                                      var elem = this[0], box;
                              
                                      if ( options ) { 
                              Severity: Critical
                              Found in demo/rules/js/jquery.js - About 3 hrs to fix

                                Function Cli has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function Cli( ARGS ) {
                                    var args = argv.clear()
                                            .info( "Usage: cssc [options] file.css" )
                                            .version( 'v' + CSSCompressor.version )
                                            .option( ARGVOptions )
                                Severity: Major
                                Found in lib/Cli.js - About 3 hrs to fix

                                  Function trigger has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      trigger: function( event, data, elem /*, bubbling */ ) {
                                          // Event object or event type
                                          var type = event.type || event,
                                              bubbling = arguments[3];
                                  
                                  
                                  Severity: Major
                                  Found in demo/rules/js/jquery.js - About 2 hrs to fix

                                    Function animate has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        animate: function( prop, speed, easing, callback ) {
                                            var optall = jQuery.speed(speed, easing, callback);
                                    
                                            if ( jQuery.isEmptyObject( prop ) ) {
                                                return this.each( optall.complete );
                                    Severity: Major
                                    Found in demo/rules/js/jquery.js - About 2 hrs to fix

                                      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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language