pboling/rack-insight

View on GitHub

Showing 116 of 116 total issues

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

Sizzle.selectors.filters.hidden = function(elem){
    return elem.offsetWidth === 0 || elem.offsetHeight === 0;
};
Severity: Minor
Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 40 mins to fix
lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 2373..2375

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

Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def request_finish(env, status, headers, body, timing)
Severity: Minor
Found in lib/rack/insight/panels/templates_panel.rb - About 35 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 lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 35 mins to fix

      Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def request_finish(env, status, headers, body, timing)
      Severity: Minor
      Found in lib/rack/insight/panels/redis_panel.rb - About 35 mins to fix

        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def initialize(path, args, time, backtrace = [], result=nil)
        Severity: Minor
        Found in lib/rack/insight/panels/active_resource_panel/query.rb - About 35 mins to fix

          Method send_message_with_safe_check_with_insight has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def send_message_with_safe_check_with_insight(operation, message, db_name, log_message=nil, last_error_params=false)
          Severity: Minor
          Found in lib/rack/insight/panels/mongo_panel/mongo_extension.rb - About 35 mins to fix

            Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def request_finish(env, status, headers, body, timing)
            Severity: Minor
            Found in lib/rack/insight/panels/sphinx_panel.rb - About 35 mins to fix

              Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def request_finish(env, st, hd, bd, timing)
              Severity: Minor
              Found in lib/rack/insight/panels/cache_panel.rb - About 35 mins to fix

                Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def request_finish(env, status, headers, body, timing)
                Severity: Minor
                Found in lib/rack/insight/instrumentation/client.rb - About 35 mins to fix

                  Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def request_finish(env, status, headers, body, timing)
                  Severity: Minor
                  Found in lib/rack/insight/panels/active_record_panel.rb - About 35 mins to fix

                    Method request_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def request_finish(env, status, headers, body, timing)
                    Severity: Minor
                    Found in lib/rack/insight/panels/speedtracer_panel/tracer.rb - About 35 mins to fix

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

                          prop: function( elem, value, type, i, name ) {
                      Severity: Minor
                      Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 35 mins to fix

                        Method configure has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def self.configure &block
                              yield @config
                              logger.debug("Rack::Insight::Config#configure:\n  called from: #{caller[0]}\n  with: #{@config}") if config[:verbosity] == true || config[:verbosity].respond_to?(:<) && config[:verbosity] <= 1
                              @logger = config[:logger]
                              if @logger.nil?
                        Severity: Minor
                        Found in lib/rack/insight/config.rb - 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

                        Method compiled_source has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def compiled_source(filename)
                              templates = []
                              templates << ::File.join(::File.dirname(__FILE__), "views/#{filename}.html.erb")
                              if self.class.respond_to?(:template_root) && !self.class.template_root.nil?
                                # Push onto the front of the array to try because if there is a template root it is the most likely place to find the view.
                        Severity: Minor
                        Found in lib/rack/insight/render.rb - 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

                        Method before has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def before(env)
                              super
                              tracer = env['st.tracer']
                              Kernel::set_trace_func proc {|event, file, line, name, binding,classname|
                                case event
                        Severity: Minor
                        Found in lib/rack/insight/panels/speedtracer_panel/profiling.rb - 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

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

                                this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
                        Severity: Minor
                        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 35 mins to fix
                        lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 4071..4071

                        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

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

                                this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
                        Severity: Minor
                        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 35 mins to fix
                        lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 4086..4086

                        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

                                    top  = box.top  + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
                        Severity: Minor
                        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js and 1 other location - About 30 mins to fix
                        lib/rack/insight/public/__insight__/jquery-1.3.2.js on lines 4179..4179

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

                        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 jQuery( document ).ready( selector );
                        Severity: Major
                        Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return this.each(function(){
                                      if ( this.nodeType != 1 )
                                          return;
                          
                                      if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
                          Severity: Major
                          Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language