pboling/rack-insight

View on GitHub

Showing 116 of 116 total issues

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

    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

                          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

          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 ( !inplace ) {
                                    curLoop = result;
                                }
            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

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

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

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

                            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

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

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

                                                this.checked = (jQuery.inArray(this.value, value) >= 0 ||
                                                    jQuery.inArray(this.name, value) >= 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 471..472

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

                                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

                                                    this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
                                                        jQuery.inArray( this.text, values ) >= 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 464..465

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

                                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

                                Consider simplifying this complex logical expression.
                                Open

                                        if ( s.dataType == "script" && type == "GET" && parts
                                            && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
                                
                                            var head = document.getElementsByTagName("head")[0];
                                            var script = document.createElement("script");
                                Severity: Major
                                Found in lib/rack/insight/public/__insight__/jquery-1.3.2.js - About 40 mins to fix

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

                                  Sizzle.selectors.filters.visible = 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 2369..2371

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language