aeolusproject/conductor

View on GitHub

Showing 248 of 368 total issues

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

  def require_user
    return if current_user or http_auth_user
    respond_to do |format|
      format.html do
        store_location
Severity: Minor
Found in src/app/controllers/application_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

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

  def self.up
    return if Role.all.empty?
    Role.transaction do
      role = Role.find_or_initialize_by_name(ROLE_NAME)
      role.update_attributes({:name => ROLE_NAME, :scope => BasePermissionObject.name, :assign_to_owner => ROLE_DEF[0]})
Severity: Minor
Found in src/db/migrate/20111104122143_add_catalog_global_user_role.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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    require_privilege(Alberich::Privilege::MODIFY, User)
    @user = User.new(params[:user])
    @title = _('New User')
    @user.quota ||= Quota.new
Severity: Minor
Found in src/app/controllers/users_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

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

  def self.up
    create_table :entities do |t|
      t.string :name
      t.references :entity_target, :polymorphic => true, :null => false

Severity: Minor
Found in src/db/migrate/20120514131500_create_entities.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 up has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.up
    ProviderAccount.find_each do |provider_account|
      if provider_account.priority.present?
        if provider_account.priority > 100
          provider_account.update_attributes(:priority => 100)
Severity: Minor
Found in src/db/migrate/20120802080255_fix_provider_accounts_priority.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 provider_image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.provider_image(assembly, provider_account)
      if assembly.image_build
        base_image = fetch_base_image_by_build(assembly.image_build)
        if base_image
          return Tim::ProviderImage.find_by_provider_account_and_image_version(
Severity: Minor
Found in src/lib/deployable_matching/image_fetcher.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 ids_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def ids_list(other_attrs=[])
    other_attrs = Array(other_attrs) unless other_attrs.is_a?(Array)
    other_attrs.each do |attr_key|
      return Array(params[attr_key]) if params.include?(attr_key)
    end
Severity: Minor
Found in src/app/controllers/application_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

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

  def http_auth_user
    return unless request.authorization && request.authorization =~ /^Basic (.*)/m
    authenticate!(:scope => :api)
    frozen = request.session_options.frozen?
    request.session_options = request.session_options.dup if frozen
Severity: Minor
Found in src/app/controllers/application_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