kennethkalmer/powerdns-on-rails

View on GitHub

Showing 157 of 179 total issues

Avoid too many return statements within this function.
Open

            return jQuery.isNaN( ret ) ? orig : ret;
Severity: Major
Found in public/javascripts/jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return this;
    Severity: Major
    Found in public/javascripts/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return elem[ name ];
      Severity: Major
      Found in public/javascripts/jquery.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return this.css( type, typeof size === "string" ? size : size + "px" );
        Severity: Major
        Found in public/javascripts/jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return jQuery.makeArray( selector, this );
          Severity: Major
          Found in public/javascripts/jquery.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                    return diff === 0;
            Severity: Major
            Found in public/javascripts/jquery.js - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return self.permissions['policy'] == 'allow'
              Severity: Major
              Found in app/models/auth_token.rb - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return (context || rootjQuery).find( selector );
                Severity: Major
                Found in public/javascripts/jquery.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return true;
                  Severity: Major
                  Found in public/javascripts/jquery.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return siblingCheck( ap[i], bp[i] );
                    Severity: Major
                    Found in public/javascripts/jquery.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return ( diff % first === 0 && diff / first >= 0 );
                      Severity: Major
                      Found in public/javascripts/jquery.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return makeArray( context.querySelectorAll(query), extra );
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                      return rootjQuery.find( selector );
                          Severity: Major
                          Found in public/javascripts/jquery.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return ret;
                            Severity: Major
                            Found in public/javascripts/jquery.js - About 30 mins to fix

                              Method macro_change has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def macro_change( domain, step )
                                  changed = false
                              
                                  domain.records.all( :conditions => { :type => step.record_type }).each do |record|
                                    next unless record.shortname == step.name
                              Severity: Minor
                              Found in app/models/macro.rb - About 25 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 link_to_record_audit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def link_to_record_audit( audit )
                                  caption = audit.audited_changes['type']
                                  caption ||= (audit.auditable.nil? ? '[UNKNOWN]' : audit.auditable.class.to_s )
                                  unless audit.audited_changes['name'].nil?
                                    name = audit.audited_changes['name'].is_a?( Array ) ? audit.audited_changes['name'].pop : audit.audited_changes['name']
                              Severity: Minor
                              Found in app/helpers/audits_helper.rb - About 25 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 results has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def results
                                  if params[:q].chomp.blank?
                                    respond_to do |format|
                                      format.html { redirect_to root_path }
                                      format.json { render :status => 404, :json => { :error => "Missing 'q' parameter" } }
                              Severity: Minor
                              Found in app/controllers/search_controller.rb - About 25 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

                              Severity
                              Category
                              Status
                              Source
                              Language