kennethkalmer/powerdns-on-rails

View on GitHub

Showing 179 of 179 total issues

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

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

Avoid too many return statements within this function.
Open

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

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

              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 this;
                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 (context || rootjQuery).find( selector );
                    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 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 ( 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 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 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 diff === 0;
                                Severity: Major
                                Found in public/javascripts/jquery.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language