pboling/rack-insight

View on GitHub

Showing 94 of 116 total issues

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

    show: function(speed,callback){
        if ( speed ) {
            return this.animate( genFx("show", 3), speed, callback);
        } else {
            for ( var i = 0, l = this.length; i < l; i++ ){
Severity: Minor
Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

    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

      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 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 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 ( !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

          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 ( !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 ( 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 ( display === "none" )
                                            display = "block";
                Severity: Major
                Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix

                  Method from_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def from_file(rel_path)
                          old_rel, Thread::current['rack-panel_file'] = Thread::current['rack-panel_file'], rel_path
                          num_load_paths_to_check = Rack::Insight::Config.config[:panel_load_paths].length
                          Rack::Insight::Config.config[:panel_load_paths].each_with_index do |load_path, index|
                            begin
                  Severity: Minor
                  Found in lib/rack/insight/panel.rb - About 45 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 ATTR has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          ATTR: 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 ( !inplace ) {
                                            curLoop = result;
                                        }
                    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 ( !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 dirCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function dirCheck( 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

                                                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

                              Avoid deeply nested control flow statements.
                              Open

                                                          if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
                                                              if (elem.removeEventListener)
                                                                  elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
                                                              else if (elem.detachEvent)
                                                                  elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
                              Severity: Major
                              Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language