Showing 2,689 of 2,689 total issues
Method repositories_to_publish
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def repositories_to_publish(override_components = nil)
if composite?
components_to_publish = []
components.each do |component|
override_component = override_components&.detect do |override_cvv|
- 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_repository_type_support?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pulp3_repository_type_support?(repository_type)
repository_type_obj = repository_type.is_a?(String) ? Katello::RepositoryTypeManager.find(repository_type) : repository_type
fail "Cannot find repository type #{repository_type}, is it enabled?" unless repository_type_obj
repository_type_obj.pulp3_plugin.present? &&
- 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 remove_references_to_proxy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_references_to_proxy
root_repos = repositories_with_proxy(nil).uniq.sort
setting = Setting.find_by(name: 'content_default_http_proxy')
if setting&.value && setting.value == self.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 find_by_installed_debs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_by_installed_debs(_key, _operator, value)
name, architecture, version = Katello::Deb.split_nav(value)
debs = Katello::InstalledDeb.where(:name => name)
debs = debs.where(:architecture => architecture) unless architecture.nil?
debs = debs.where(:version => version) unless version.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 manifest_expiring_soon?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def manifest_expiring_soon?(days = Setting[:expire_soon_days])
return false if !manifest_imported? || manifest_expired?
manifest_expiry = manifest_expiration_date
if manifest_expiry
- 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_lazy_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_lazy_attributes
json = self.class.candlepin_data(self.cp_id, true)
return {} if json.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 propose_name_from_facts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.propose_name_from_facts(facts)
setting_fact = Setting[:register_hostname_fact]
if !setting_fact.blank? && facts[setting_fact] && facts[setting_fact] != 'localhost'
facts[setting_fact]
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 compare
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compare
fail _("No content_view_version_ids provided") if params[:content_view_version_ids].empty?
@versions = ContentViewVersion.readable.where(:id => params[:content_view_version_ids])
if @versions.count != params[:content_view_version_ids].uniq.length
missing = params[:content_view_version_ids] - @versions.pluck(: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 optional_authorize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def optional_authorize
@repository = find_scope_repository
if @repository && (@repository.environment.registry_unauthenticated_pull || ssl_client_authorized?(@repository.organization.label))
true
elsif params['action'] == 'catalog'
- 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 save_with_logic!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_with_logic!(enabled = true)
self.task_group ||= SyncPlanTaskGroup.create!
self.cron_expression = '' if (self.cron_expression && !(self.interval.eql? CUSTOM_CRON))
associate_recurring_logic
self.save!
- 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 generate_clauses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_clauses(_repo)
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 pulp_without_auth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pulp_without_auth(url)
json = backend_status(url, :pulp)
fail _("Pulp does not appear to be running at %s.") % url if json.empty?
- 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 auto_complete_search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def auto_complete_search
begin
options = resource_class.respond_to?(:completer_scope_options) ? resource_class.completer_scope_options(params[:search]) : {}
items = resource_class.where(:id => self.index_relation).complete_for(params[:search], options)
items = items.map do |item|
- 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 scoped_search_evr_compare
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.scoped_search_evr_compare(operator, value)
evr = Util::Package.parse_evr(value)
(e, v, r) = [evr[:epoch], evr[:version], evr[:release]]
e = e.to_i # nil or blank becomes 0
conditions = ''
- 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(attrs = nil, _options = {})
unless attrs.nil?
# only keep keys for which we have db columns
attrs = attrs.reject do |k, _v|
!self.class.column_defaults.keys.member?(k.to_s) && (!respond_to?(:"#{k.to_s}=") rescue 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 repository_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def repository_url(content_path, _content_type = nil, schema = 'http')
return content_path if content_path =~ %r|^([\w\-\+]+)://|
url = if @host.content_source
"#{schema}://#{@host.content_source.hostname}"
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 exist_for_environment?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def exist_for_environment?(environment, content_view, attribute = nil)
if environment.present? && content_view.in_environment?(environment)
repos = content_view.version(environment).repos(environment)
repos.any? do |repo|
- 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_blob_push_container
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_blob_push_container(props)
unless props[:name].present? && props[:name].length > 0
return render_podman_error(
"NAME_INVALID",
"Invalid format. Container name cannot be 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 search_enabled
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.search_enabled(_key, operator, value)
value = ::Foreman::Cast.to_bool(value)
value = !value if operator == '<>'
active_logics = ForemanTasks::RecurringLogic.where(:state => "active")
active_logic_ids = active_logics.pluck(: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"