kennethkalmer/powerdns-on-rails

View on GitHub

Showing 179 of 179 total issues

Function init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init: function( selector, context, rootjQuery ) {
        var match, elem, ret, doc;

        // Handle $(""), $(null), or $(undefined)
        if ( !selector ) {
Severity: Major
Found in public/javascripts/jquery.js - About 2 hrs to fix

    Method validate_macro_step has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      def validate_macro_step
        return if self.record_type.blank? || !self.errors[:record_type].blank?
    
        record = build
    
    
    Severity: Minor
    Found in app/models/macro_step.rb - About 2 hrs 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 _Deferred has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _Deferred: function() {
            var // callbacks list
                callbacks = [],
                // stored [ context , args ]
                fired,
    Severity: Major
    Found in public/javascripts/jquery.js - About 2 hrs to fix

      Function liveHandler has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function liveHandler( event ) {
          var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
              elems = [],
              selectors = [],
              events = jQuery._data( this, "events" );
      Severity: Major
      Found in public/javascripts/jquery.js - About 2 hrs to fix

        Function Deferred has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Deferred: function( func ) {
                var deferred = jQuery._Deferred(),
                    failDeferred = jQuery._Deferred(),
                    promise;
                // Add errorDeferred methods, then and promise
        Severity: Major
        Found in public/javascripts/jquery.js - About 2 hrs to fix

          Function ajaxConvert has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ajaxConvert( s, response ) {
          
              // Apply the dataFilter if provided
              if ( s.dataFilter ) {
                  response = s.dataFilter( response, s.dataType );
          Severity: Major
          Found in public/javascripts/jquery.js - About 2 hrs to fix

            Method create has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              def create
                @domain = Domain.new( params[:domain] )
            
                unless @domain.slave?
                  @zone_template = ZoneTemplate.find(params[:domain][:zone_template_id]) unless params[:domain][:zone_template_id].blank?
            Severity: Minor
            Found in app/controllers/domains_controller.rb - About 2 hrs 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 offset has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                jQuery.fn.offset = function( options ) {
                    var elem = this[0];
            
                    if ( options ) {
                        return this.each(function( i ) {
            Severity: Major
            Found in public/javascripts/jquery.js - About 2 hrs to fix

              Class AuthToken has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class AuthToken < ActiveRecord::Base
              
                class Denied < ::Exception
                end
              
              
              Severity: Minor
              Found in app/models/auth_token.rb - About 2 hrs to fix

                Method create has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def create
                    if params[:auth_token].blank?
                      render :status => 422, :xml => <<-EOS
                <error>#{t(:message_token_missing_parametr)}</error>
                EOS
                Severity: Major
                Found in app/controllers/auth_tokens_controller.rb - About 2 hrs to fix

                  Function name has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
                          var type, i = 0, match, namespaces, preType,
                              selector = origSelector || this.selector,
                              context = origSelector ? this : jQuery( this.context );
                  
                  
                  Severity: Minor
                  Found in public/javascripts/jquery.js - About 1 hr to fix

                    Function ajaxHandleResponses has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ajaxHandleResponses( s, jqXHR, responses ) {
                    
                        var contents = s.contents,
                            dataTypes = s.dataTypes,
                            responseFields = s.responseFields,
                    Severity: Minor
                    Found in public/javascripts/jquery.js - About 1 hr to fix

                      Function domManip has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          domManip: function( args, table, callback ) {
                              var results, first, fragment, parent,
                                  value = args[0],
                                  scripts = [];
                      
                      
                      Severity: Minor
                      Found in public/javascripts/jquery.js - About 1 hr to fix

                        Function closest has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            closest: function( selectors, context ) {
                                var ret = [], i, l, cur = this[0];
                                
                                // Array
                                if ( jQuery.isArray( selectors ) ) {
                        Severity: Minor
                        Found in public/javascripts/jquery.js - About 1 hr to fix

                          Function CHILD has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  CHILD: function( elem, match ) {
                                      var type = match[1],
                                          node = elem;
                          
                                      switch ( type ) {
                          Severity: Minor
                          Found in public/javascripts/jquery.js - About 1 hr to fix

                            Function removeData has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                removeData: function( elem, name, pvt /* Internal Use Only */ ) {
                                    if ( !jQuery.acceptData( elem ) ) {
                                        return;
                                    }
                            
                            
                            Severity: Minor
                            Found in public/javascripts/jquery.js - About 1 hr to fix

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

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

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

                              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

                                      if ( jQuery.isFunction( size ) ) {
                                          return this.each(function( i ) {
                                              var self = jQuery( this );
                                              self[ type ]( size.call( this, i, self[ type ]() ) );
                                          });
                              Severity: Major
                              Found in public/javascripts/jquery.js and 1 other location - About 1 hr to fix
                              public/javascripts/jquery.js on lines 5488..5494

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

                              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 && doc.clientLeft || body && body.clientLeft || 0);
                              Severity: Major
                              Found in public/javascripts/jquery.js and 1 other location - About 1 hr to fix
                              public/javascripts/jquery.js on lines 2984..2984

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

                              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

                                      if ( jQuery.isFunction(text) ) {
                                          return this.each(function(i) {
                                              var self = jQuery( this );
                              
                                              self.text( text.call(this, i, self.text()) );
                              Severity: Major
                              Found in public/javascripts/jquery.js and 1 other location - About 1 hr to fix
                              public/javascripts/jquery.js on lines 8896..8901

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

                              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