kennethkalmer/powerdns-on-rails

View on GitHub

Showing 157 of 179 total issues

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

  def apply_to( domain )
    Record.batch do
      macro_steps.each do |step|

        if step.action == 'create'
Severity: Minor
Found in app/models/macro.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 update_convenience_accessors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def update_convenience_accessors
    # Setup our convenience values
    @primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =
      self[:content].split(/\s+/) unless self[:content].blank?
    %w{ serial refresh retry expire minimum }.each do |i|
Severity: Minor
Found in app/models/soa.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 display_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def display_hash( hash )
    hash ||= {}
    hash.map do |k,v|
      if v.nil?
        nil # strip out non-values
Severity: Minor
Found in app/helpers/audits_helper.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 get_name_and_type_from_param has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def get_name_and_type_from_param( record, type = nil )
    name, type =
      case record
      when Record
        [ record.name, record.class.to_s ]
Severity: Minor
Found in app/models/auth_token.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 update_convenience_accessors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def update_convenience_accessors
    return unless self.record_type == 'SOA'

    # Setup our convenience values
    @primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =
Severity: Minor
Found in app/models/record_template.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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    # Check for any previous macro steps
    if parent.macro_steps.any?
      # Check for the parameter
      unless params[:macro_step][:position].blank?
Severity: Minor
Found in app/controllers/macro_steps_controller.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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    @record = parent.send( "#{params[:record][:type].downcase}_records".to_sym ).new( params[:record] )

    if current_token && !current_token.allow_new_records? &&
        !current_token.can_add?( @record )
Severity: Minor
Found in app/controllers/records_controller.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 hijack_method has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def hijack_method(klass, method_name, eval_string = nil, arg_names = [], &block)
    method_name = method_name.to_s
    # You have got love ruby!  What other language allows you to pillage and plunder a class like this? 
    
    (@method_stores[klass]||=[]) << [
Severity: Minor
Found in lib/hijacker.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

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

                return 1;
    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( "[id='" + nid + "'] " + 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 { top: top, left: left };
        Severity: Major
        Found in public/javascripts/jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return hooks.get( 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 oldSizzle(query, context, extra, seed);
            Severity: Major
            Found in public/javascripts/jquery.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

                                return this.constructor( context ).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 rootjQuery.ready( 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 === null ?
                                    undefined :
                                    ret;
                    Severity: Major
                    Found in public/javascripts/jquery.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

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

                        Avoid too many return statements within this function.
                        Open

                                return i === al ?
                                    siblingCheck( a, bp[i], -1 ) :
                                    siblingCheck( ap[i], b, 1 );
                        Severity: Major
                        Found in public/javascripts/jquery.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language