pboling/rack-insight

View on GitHub

Showing 116 of 116 total issues

Function dirNodeCheck has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
    var sibDir = dir == "previousSibling" && !isXML;
    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
        var elem = checkSet[i];
        if ( elem ) {
Severity: Minor
Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

    Function ATTR has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            ATTR: function(elem, match){
                var name = match[1],
                    result = Expr.attrHandle[ name ] ?
                        Expr.attrHandle[ name ]( elem ) :
                        elem[ name ] != null ?
    Severity: Minor
    Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

      Method short_string has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def short_string(item, max_per_elem = 50)
              begin
                string = item.inspect
                if string.length > max_per_elem
                  case item
      Severity: Minor
      Found in lib/rack/insight/panels/speedtracer_panel/tracer.rb - About 1 hr to fix

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

            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 clone has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  clone: function( events ) {
                      // Do the clone
                      var ret = this.map(function(){
                          if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
                              // IE copies events bound via attachEvent when
              Severity: Minor
              Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

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

                function bindReady(){
                    if ( readyBound ) return;
                    readyBound = true;
                
                    // Mozilla, Opera and webkit nightlies currently support this event
                Severity: Minor
                Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 1 hr to fix

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

                      RSpec::Matchers.define :have_li do |container, key, value|
                        match do |response|
                          if value
                            response.should have_selector("#{container} li", :content => key) do |row|
                              row.should contain(value)
                  Severity: Major
                  Found in lib/rack/insight/rspec_matchers.rb and 1 other location - About 1 hr to fix
                  lib/rack/insight/rspec_matchers.rb on lines 4..16

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

                  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

                      RSpec::Matchers.define :have_row do |container, key, value|
                        match do |response|
                          if value
                            response.should have_selector("#{container} tr", :content => key) do |row|
                              row.should contain(value)
                  Severity: Major
                  Found in lib/rack/insight/rspec_matchers.rb and 1 other location - About 1 hr to fix
                  lib/rack/insight/rspec_matchers.rb on lines 20..32

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

                  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

                    class RedisPanel < Panel
                      require "rack/insight/panels/redis_panel/stats"
                  
                      def request_start(env, start)
                        @stats = Stats.new
                  Severity: Major
                  Found in lib/rack/insight/panels/redis_panel.rb and 1 other location - About 1 hr to fix
                  lib/rack/insight/panels/sphinx_panel.rb on lines 2..25

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

                  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

                    class SphinxPanel < Panel
                      require "rack/insight/panels/sphinx_panel/stats"
                  
                      def request_start(env, start)
                        @stats = Stats.new
                  Severity: Major
                  Found in lib/rack/insight/panels/sphinx_panel.rb and 1 other location - About 1 hr to fix
                  lib/rack/insight/panels/redis_panel.rb on lines 2..25

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

                  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

                              event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
                  Severity: Major
                  Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 1 hr to fix
                  lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 2741..2741

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

                  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

                              event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
                  Severity: Major
                  Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 1 hr to fix
                  lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 2742..2742

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

                  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

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

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