pboling/rack-insight

View on GitHub

Showing 94 of 116 total issues

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

jQuery.extend = jQuery.fn.extend = function() {
    // copy reference to target object
    var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;

    // Handle a deep copy situation
Severity: Minor
Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

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

        fix: function(event) {
            if ( event[expando] )
                return event;
    
            // store a copy of the original event object
    Severity: Minor
    Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

      Method after has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def after(env,status,headers,body)
            sections = {}
            sections["GET"] = sort(@request.GET) if @request.GET.any?
            sections["POST"] = sort(@request.POST) if @request.POST.any?
            # TODO: Better Fix for Rails 4 (as part of splitting panels into separate gems)
      Severity: Minor
      Found in lib/rack/insight/panels/request_variables_panel.rb - About 55 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

      Method initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def initialize(app)
            if panel_app
              #XXX use mappings
              @app = Rack::Cascade.new([panel_app, app])
            else
      Severity: Minor
      Found in lib/rack/insight/panel.rb - About 55 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

      Method ip_authorized? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def ip_authorized?
            return true unless options["rack-insight.ip_masks"]
      
            logger.info{ "Checking #{@original_request.ip} against ip_masks" } if verbose(:high)
            ip = IPAddr.new(@original_request.ip)
      Severity: Minor
      Found in lib/rack/insight/app.rb - About 55 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

      Method decode_message has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

              def decode_message(m)
                @m = m.clone
                params = ActiveSupport::OrderedHash.new
      
                # Mode, Limits
      Severity: Minor
      Found in lib/rack/insight/panels/sphinx_panel/stats.rb - About 55 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

      Method run has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def run(object, context="::", kind=:instance, called_at = caller[0], method = "<unknown>", args=[], &blk)
      Severity: Major
      Found in lib/rack/insight/instrumentation/instrument.rb - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( display === "none" )
                                    display = "block";
        Severity: Major
        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ( !anyFound ) {
                                  return [];
                              }
          Severity: Major
          Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if ( results[i] === results[i-1] ) {
                                    results.splice(i--, 1);
                                }
            Severity: Major
            Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ( option.selected ) {
                                          // Get the specifc value for the option
                                          value = jQuery(option).val();
              
                                          // We don't need an array for one selects
              Severity: Major
              Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ( typeof cur !== "string" ) {
                                        if ( elem === cur ) {
                                            match = true;
                                            break;
                                        }
                Severity: Major
                Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
                                          if ( item ) {
                                              found = filter( item, match, i, curLoop );
                                              var pass = not ^ !!found;
                  
                  
                  Severity: Major
                  Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                    Method probe_run has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def probe_run(object, context = "::", kind=:instance, args=[], called_at=caller[1], method_name = nil)
                    Severity: Minor
                    Found in lib/rack/insight/instrumentation/probe.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if ( !isXML ) {
                                              elem.sizcache = doneName;
                                              elem.sizset = i;
                                          }
                      Severity: Major
                      Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

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

                                CLASS: function(match, curLoop, inplace, result, not, isXML){
                        Severity: Minor
                        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if ( !match ) {
                                                  anyFound = found = true;
                                              } else if ( match === true ) {
                                                  continue;
                                              }
                          Severity: Major
                          Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        for ( var handle in events[type] )
                                                            // Handle the removal of namespaced events
                                                            if ( namespace.test(events[type][handle].type) )
                                                                delete events[type][handle];
                            Severity: Major
                            Found in lib/rack/insight/public/__insight__/jquery-1.3.2.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 lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if ( !inplace ) {
                                                        curLoop = result;
                                                    }
                                Severity: Major
                                Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language