Showing 2,689 of 2,689 total issues
Method attached_content_view_ids
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def attached_content_view_ids
composite_content_view.content_view_components.map do |cvc|
next if cvc == self
if cvc.content_view_version
cvc.content_view_version.content_view_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 kurl_valid?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def kurl_valid?(url)
return false if (scheme = URI.parse(url).scheme).blank?
return true if FILEPREFIX.include?(scheme.downcase)
URI.parse(url).host.present? && PROTOCOLS.include?(scheme.downcase)
rescue URI::InvalidURIError
- 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 token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def token
if !require_user_authorization?
personal_token = OpenStruct.new(token: 'unauthenticated', issued_at: Time.now, expires_at: 3.minutes.from_now)
else
personal_token = PersonalAccessToken.where(user_id: User.current.id, name: 'registry').first
- 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_hosts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_hosts
sub_facet_ids_from_cp, host_ids_from_cp = Katello::Host::SubscriptionFacet.where('uuid in (?)', consumer_uuids).pluck(:id, :host_id).transpose
sub_facet_ids_from_cp ||= []
host_ids_from_cp ||= []
- 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 pulp3_without_auth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pulp3_without_auth(url)
json = backend_status(url, :pulp)
fail _("Pulp does not appear to be running at %s.") % url if json.empty?
if json['database_connection'] && json['database_connection']['connected'] != true
- 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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def destroy
if Katello::RegistrationManager.unregister_host(@host, :unregistering => false)
process_success redirection_url_on_host_deletion
else
process_error :redirect => :back, :error_msg => _("Failed to delete %{host}: %{errors}") % { :host => @host, :errors => @host.errors.full_messages }
- 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 candlepin_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def candlepin_data(cp_id, rescue_gone = false)
Katello::Resources::Candlepin::Pool.find(cp_id)
rescue Katello::Errors::CandlepinPoolGone => e
raise e unless rescue_gone
- 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 search_by_redhat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.search_by_redhat(_key, operator, value)
value = value == 'true'
value = !value if operator == '<>'
product_ids = Katello::Product.redhat.select(: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 included
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.included(base)
base.send :include, LazyAccessor
base.send :include, InstanceMethods
base.class_eval do
- 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 backend_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def backend_status(url, backend)
ca_file = SETTINGS[:katello][backend][:ca_cert_file]
request_id = ::Logging.mdc['request']
options = {}
- 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 propose_existing_hostname
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.propose_existing_hostname(facts)
if propose_custom_fact(facts)
name = propose_custom_fact(facts)
elsif ::Host.where(:name => facts['network.hostname'].downcase).any?
name = facts['network.hostname']
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(metadata:)
@toc = metadata[:toc]
@gpg_keys = parse_gpg_keys(metadata[:gpg_keys]) if metadata[:gpg_keys]
@products = parse_products(metadata[:products]) if metadata[:products]
@repositories = parse_repositories(metadata[:repositories]) if metadata[:repositories]
- 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 common_remote_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def common_remote_options
remote_options = {
tls_validation: root.verify_ssl_on_sync,
name: generate_backend_object_name,
url: root.url,
- 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_content_unit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index_relation_content_unit(query)
if params[:deb_id]
query = query.joins(:debs)
.where("#{Deb.table_name}.id" => Deb.with_identifiers(params[:deb_id]))
end
- 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_hosts_for_incremental
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def calculate_hosts_for_incremental(bulk_params, use_composites)
if bulk_params[:included].try(:[], :search)
version_environments = find_version_environments_for_hosts(use_composites)
restrict_hosts = lambda do |relation|
if version_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 remote_partial_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remote_partial_update
url_type = remote_options[:url]&.start_with?('uln') ? 'uln' : 'default'
remote_type = repo.remote_href.start_with?('/pulp/api/v3/remotes/rpm/uln/') ? 'uln' : 'default'
href = repo.remote_href
- 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 add_modular_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_modular_content(source_repo_ids, filters, modular_filters, filter_list_map)
inclusion_modular_filters = modular_filters.select { |filter| filter.inclusion }
exclusion_modular_filters = modular_filters - inclusion_modular_filters
if inclusion_modular_filters.empty? &&
!(filters.any? { |filter| filter.class == ContentViewErratumFilter && filter.inclusion })
- 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 repackage_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def repackage_message
yield
ensure
if response.status >= 400
begin
- 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_history
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_history
if params[:from_history_id].present?
@history = ::Katello::ContentViewVersionExportHistory.find(params[:from_history_id])
if @history.blank?
throw_resource_not_found(name: 'export history',
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
unless params[:content_type].empty? || RepositoryTypeManager.find(params[:content_type])
msg = _("Invalid params provided - content_type must be one of %s") %
RepositoryTypeManager.enabled_repository_types.keys.sort.join(",")
fail HttpErrors::UnprocessableEntity, msg
- 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"