kennethkalmer/powerdns-on-rails

View on GitHub

Showing 179 of 179 total issues

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

  $(rails.formSubmitSelector).live('ajax:complete.rails', function(event) {
    if (this == event.target) rails.enableFormElements($(this));
  });
Severity: Minor
Found in public/javascripts/jquery_ujs.js and 1 other location - About 55 mins to fix
public/javascripts/jquery_ujs.js on lines 328..330

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

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

  $(rails.formSubmitSelector).live('ajax:beforeSend.rails', function(event) {
    if (this == event.target) rails.disableFormElements($(this));
  });
Severity: Minor
Found in public/javascripts/jquery_ujs.js and 1 other location - About 55 mins to fix
public/javascripts/jquery_ujs.js on lines 332..334

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

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 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 public/javascripts/jquery.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

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

      Avoid deeply nested control flow statements.
      Open

                                  if ( !xhrCallbacks ) {
                                      xhrCallbacks = {};
                                      jQuery( window ).unload( xhrOnUnloadAbort );
                                  }
      Severity: Major
      Found in public/javascripts/jquery.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( elem.id !== match[2] ) {
                                    return rootjQuery.find( selector );
                                }
        Severity: Major
        Found in public/javascripts/jquery.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          } else if ( copy !== undefined ) {
                              target[ name ] = copy;
                          }
          Severity: Major
          Found in public/javascripts/jquery.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( elem && elem.parentNode ) {
                                        // Handle the case where IE and Opera return items
                                        // by name instead of ID
                                        if ( elem.id === match[3] ) {
                                            return makeArray( [ elem ], extra );
            Severity: Major
            Found in public/javascripts/jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for ( j = tbody.length - 1; j >= 0 ; --j ) {
                                          if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
                                              tbody[ j ].parentNode.removeChild( tbody[ j ] );
                                          }
                                      }
              Severity: Major
              Found in public/javascripts/jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( display === "inline" ) {
                                                this.style.display = "inline-block";
                
                                            } else {
                                                this.style.display = "inline";
                Severity: Major
                Found in public/javascripts/jquery.js - About 45 mins to fix

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

                    def update_serial
                      unless Record.batch_soa_updates.nil?
                        if Record.batch_soa_updates.include?( self.id )
                          return
                        end
                  Severity: Minor
                  Found in app/models/soa.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 ( !inplace ) {
                                          curLoop = result;
                                      }
                  Severity: Major
                  Found in public/javascripts/jquery.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                        if ( xml && xml.documentElement /* #4958 */ ) {
                                                            responses.xml = xml;
                                                        }
                    Severity: Major
                    Found in public/javascripts/jquery.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 public/javascripts/jquery.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( copyIsArray ) {
                                                copyIsArray = false;
                                                clone = src && jQuery.isArray(src) ? src : [];
                        
                                            } else {
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
                                                      className = className.replace(" " + classNames[c] + " ", " ");
                                                  }
                          Severity: Major
                          Found in public/javascripts/jquery.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 public/javascripts/jquery.js - About 45 mins to fix

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

                                      ATTR: function( match, curLoop, inplace, result, not, isXML ) {
                              Severity: Minor
                              Found in public/javascripts/jquery.js - About 45 mins to fix

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

                                function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
                                        dataType /* internal */, inspected /* internal */ ) {
                                Severity: Minor
                                Found in public/javascripts/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if ( relativeHierarchySelector && hasParent ) {
                                                          context = context.parentNode;
                                                      }
                                  Severity: Major
                                  Found in public/javascripts/jquery.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language