Showing 2,737 of 2,737 total issues
Method deb_names_for_job_template
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def deb_names_for_job_template(action:, search:)
actions = %w(install remove update).freeze
case action
when 'install'
deb_installable = ::Katello::Deb.search_for(search).distinct.pluck(:name)
- Read upRead up
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 last_env_sync_task
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def last_env_sync_task(env)
last_env_sync_task = sync_tasks.order(ended_at: :desc).detect { |task| task.input.with_indifferent_access.dig(:options, :environment_id) == env.id || task.input.with_indifferent_access.dig(:options, :environment_ids)&.include?(env.id) }
# env_ids_task_exists checks if any full syncs have run since we started tracking env_ids at time of sync.
# If yes, return last_env_sync_task which checks for env_id specific sync + full syncs which contain env as part of env_ids
- Read upRead up
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 distribution_repositories
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def distribution_repositories(host, content_facet: nil)
content_facet ||= host.content_facet
case content_facet
when ::Katello::Host::ContentFacet
if content_facet.new_record?
- Read upRead up
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 packages_change_description
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def packages_change_description(data, action)
ret = []
data ||= {}
data[:details] ||= {}
- Read upRead up
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 index_relation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index_relation
if @version && params[:available_for] == "content_view_version" && self.respond_to?(:available_for_content_view_version)
collection = self.available_for_content_view_version(@version)
else
collection = resource_class.all
- Read upRead up
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 assign_single_environment
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def assign_single_environment(
content_view_id: nil, lifecycle_environment_id: nil, environment_id: nil,
content_view: nil, lifecycle_environment: nil, environment: nil
)
lifecycle_environment_id ||= environment_id || lifecycle_environment&.id || environment&.id || self.single_lifecycle_environment&.id
- Read upRead up
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 validate_destroyable!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_destroyable!(skip_environment_check: false)
unless organization.being_deleted?
if !skip_environment_check && in_environment?
fail _("Cannot delete version while it is in environments: %s") %
environments.map(&:name).join(",")
- Read upRead up
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_guests
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_guests(consumer_params)
if self.hypervisor
if !consumer_params.try(:[], 'guestIds').empty?
guest_ids = consumer_params['guestIds'].map do |id|
case id
- Read upRead up
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_multiple_taxonomies
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_multiple_taxonomies(type)
if type == :organization
new_org_id = params.dig(type, 'id')
if new_org_id
- Read upRead up
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 change_content_source_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def change_content_source_data
hosts = params[:search].presence ? ::Host.search_for(params[:search]) : ::Host.where(id: params[:host_ids])
content_hosts = []
hosts_without_content = []
- Read upRead up
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 content_unit_pulp_ids
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def content_unit_pulp_ids(repo, additional_included_errata = [])
return [] if erratum_rules.blank?
if filter_by_id?
errata_ids = erratum_rules.map(&:errata_id)
- Read upRead up
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 activation_key_params
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def activation_key_params
key_params = permitted_params.except(:environment_id, :content_view_id,
:content_view_environments, :content_view_environment_ids)
unless params[:purpose_addons].nil?
- Read upRead up
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 find_content
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def find_content
content_type = params[:content_type]
if content_type
RepositoryTypeManager.check_content_matches_repo_type!(@repository, params[:content_type]) if params[:content_type]
- Read upRead up
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 index_relation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index_relation
if @product.nil?
authorized_product_contents = Katello::ProductContent.joins(:product).merge(@product_scope)
relation = @organization.product_contents.merge(authorized_product_contents).displayable
else
- Read upRead up
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 save_distribution_references
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save_distribution_references(hrefs)
hrefs.each do |href|
pulp3_distribution_data = api.get_distribution(href)
path, content_guard_href = pulp3_distribution_data&.base_path, pulp3_distribution_data&.content_guard
if distribution_reference
- Read upRead up
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 upload
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upload
if @host.nil?
Rails.logger.warn("Host was not specified; skipping")
return false
elsif @host.content_facet.nil? || @host.content_facet.uuid.nil?
- Read upRead up
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 calculate_and_import
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def calculate_and_import
if self.bound_library_instance_repos.any?
to_add, to_remove = applicable_differences
ActiveRecord::Base.transaction do
insert(to_add) unless to_add.blank?
- Read upRead up
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 finalize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def finalize
User.as_anonymous_admin do
content_view = ::Katello::ContentView.find(input[:content_view_id])
repository = ::Katello::Repository.find(input[:repository_id]) if input[:repository_id]
- Read upRead up
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 plan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def plan(repositories, content_view_version, destination_repository, options = {})
incremental = options.fetch(:incremental, false)
content_view = content_view_version.content_view
filters = incremental ? [] : content_view.filters.applicable(repositories.first)
rpm_filenames = extract_rpm_filenames(options.fetch(:repos_units, nil), repositories.first.label)
- Read upRead up
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 invoke_external_task
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def invoke_external_task
repository = ::Katello::Repository.find(input[:repository_id])
artifact_href = input[:options][:artifact_href] || fetch_artifact_href
fail _("Content not uploaded to pulp") unless artifact_href
content_type = input[:unit_type_id]
- Read upRead up
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"