Showing 2,689 of 2,689 total issues
Method _check_single_date_range
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _check_single_date_range(record)
if record.start_date || record.end_date || !record.types.empty?
if !record.filter.erratum_rules.empty? &&
!record.filter.erratum_rules.any? { |rule| rule.id == record.id }
invalid_parameters = _("May not add a type or date range rule to a filter that has existing rules.")
- 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 handle_acs_product_removal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle_acs_product_removal(repository)
# Remove products from ACS's that contain no repositories which both
# match the ACS content type and have a non-nil URL
product = repository.product
repo_content_types = Set.new
- 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 create_missing_hosts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_missing_hosts
# remaining hypervisors
new_hypervisors = {}
@hypervisors.each do |hypervisor|
next if @hosts.key?(hypervisor[:uuid])
- 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 extract_epoch_version_release
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_epoch_version_release(evr)
parsed = Package.parse_evr(evr)
self.epoch = parsed[:epoch].to_i # nil or blank becomes 0
v = parsed[:version]
self.version = (v.nil? || v.blank?) ? '' : Package.sortable_version(v)
- 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 filter_errata_by_pulp_href
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filter_errata_by_pulp_href(errata, content_pulp_hrefs, source_repo_rpm_filenames, source_repo_module_stream_specs)
return [] if content_pulp_hrefs.empty?
source_repo_rpm_filenames = source_repo_rpm_filenames.map { |rpm| File.basename(rpm) }
rpm_filenames = Katello::Rpm.where(:pulp_id => content_pulp_hrefs).map { |rpm| File.basename(rpm.filename) }
- 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 from_task
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.from_task(task)
if %w(error canceled).include?(task[:state])
message = if task[:exception]
Array(task[:exception]).join('; ')
elsif task[:error]
- 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_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_content(old_version, content, components)
if old_version.content_view.composite?
fail(_("Cannot specify content for composite views")) unless content.empty?
validate_components(old_version, components)
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 handle_acs_product_removal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle_acs_product_removal(repository)
# Remove products from ACS's that contain no repositories which both
# match the ACS content type and have a non-nil URL
product = repository.product
repo_content_types = Set.new
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def plan(repository)
sequence do
plan_action(Katello::Repository::MetadataGenerate, repository)
concurrence do
(::SmartProxy.unscoped.with_repo(repository).select { |sp| sp.authorized?(:manage_capsule_content) && sp.authorized?(:view_capsule_content) })&.each do |capsule|
- 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 clauses_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def clauses_for(list_type)
# fetch the applicable content type filters - fetch_filters implemented
# by subclasses. idea is those content type filter classes would
# implement whitelist, blacklist scopes.
filters = fetch_filters.send(list_type).where(:id => @filters) # abstract
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def plan(extended_repo_mapping, options)
generate_metadata = options.fetch(:generate_metadata, true)
copy_contents = options.fetch(:copy_contents, true)
solve_dependencies = options.fetch(:solve_dependencies, false)
- 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 wrap_with_overrides
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.wrap_with_overrides(product_contents:, overrides:, status: nil, repository_type: nil)
pc_with_overrides = product_contents.map { |pc| ProductContentPresenter.new(pc, overrides) }
if status
pc_with_overrides.keep_if do |pc|
if status == "overridden"
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
::Host.unscoped.find_each do |host|
host.content_facet.update_errata_status if host.content_facet.try(:uuid)
rescue StandardError => error
output[:errors] ||= []
- 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 rescue_from_wrapped_error
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rescue_from_wrapped_error(exception)
logger.error "*** ERROR: #{exception.message} (#{exception.status_code}) ***"
logger.error "REQUEST URL: #{request.fullpath}"
logger.error pp_exception(exception.original.nil? ? exception : exception.original)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def finalize
version = ::Katello::ContentViewVersion.find(input[:new_content_view_version_id])
version.update_content_counts!
version.add_applied_filters!
generate_description(version, output[:added_units]) if version.description.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 check_cv_capsule_environments!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_cv_capsule_environments!(smart_proxy, content_view, environment)
cv_environments = content_view&.versions&.collect(&:environments)&.flatten
if cv_environments.present?
if environment.present? && !(cv_environments.pluck(:id).include? environment.id)
fail _("Content view '%{content_view}' is not attached to the environment.") % {content_view: content_view.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 version_for_publish
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def version_for_publish(content_view, options)
if options[:minor] && options[:major]
if options[:override_components]
content_view.create_new_version(options[:major], options[:minor], options[:override_components])
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 import_package_profile_for_host
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.import_package_profile_for_host(host_id, profile)
host = ::Host.find_by(:id => host_id)
if host.nil?
Rails.logger.warn("Host with ID %s not found; continuing" % host_id)
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 plan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def plan(repos, options = {})
sequence do
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::MetadataGenerate, repos.in_default_view, options) if repos.in_default_view.any?
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::MetadataGenerate, repos.archived, options) if repos.archived.any?
plan_action(::Actions::BulkAction, ::Actions::Katello::Repository::MetadataGenerate, repos.in_published_environments, options) if repos.in_published_environments.any?
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def plan(host, pools_with_quantities_params)
action_subject(host)
subscription_facet = host.subscription_facet
fail _("Register host '%s' before attaching subscriptions") % host.name unless subscription_facet
- 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"