Showing 2,737 of 2,737 total issues
Function MainTable
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const MainTable = ({
status, cells, rows, error, emptyContentTitle, emptyContentBody,
emptyContentOverride, emptySearchTitle, emptySearchBody, errorSearchTitle, errorSearchBody,
happyEmptyContent, searchIsActive, activeFilters, defaultFilters,
activeToggleState, unfilteredToggleState, actionButtons, rowsCount,
- 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
Function SubscriptionDetailInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const SubscriptionDetailInfo = ({ subscriptionDetails }) => {
const subscriptionLimits = (subDetails) => {
const limits = [];
if (subDetails.sockets) {
limits.push(__('Sockets: %s').replace('%s', subDetails.sockets));
- 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_candlepin_associations
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_candlepin_associations(consumer_params = nil)
Rails.logger.debug "Updating Candlepin associations for host #{name}"
content_facet.cves_changed = false if content_facet
content_facet&.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
Function ContentSourceForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const ContentSourceForm = ({
handleSubmit,
environments,
handleEnvironment,
contentViews,
- 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 needs_publish?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def needs_publish?
#Returns
# True:
# a) When content/repo/filter change audit records exist
# b) CV hasn't ever been published
- 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 rmi_error_description
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def rmi_error_description
errors, stacktrace = self.result[:errors]
return "" unless errors
# Handle not very friendly Pulp message
case 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 scoped_search_evr_like
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.scoped_search_evr_like(operator, value)
val = (value !~ /^%|\*/ && value !~ /%|\*$/) ? "%#{value}%" : value.tr_s('%*', '%')
evr = Util::Package.parse_evr(val)
(e, v, r) = [evr[:epoch], evr[:version], evr[:release]]
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 import_all
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def import_all(organization = nil, import_managed_associations = true)
organizations = organization ? [organization] : Organization.all
organizations.each do |org|
candlepin_records = candlepin_records_by_id(org)
- 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_product_label
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_blob_push_product_label(props)
prod_label = props[:product]
unless prod_label.present? && prod_label.length > 0
return render_podman_error(
"NAME_INVALID",
- 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_in
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.scoped_search_evr_in(operator, value)
op = (operator == 'IN' ? '=' : '<>')
joiner1 = (operator == 'IN' ? 'AND' : 'OR')
joiner2 = (operator == 'IN' ? 'OR' : 'AND')
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 deliver!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def deliver!
::Organization.unscoped.all.each do |organization|
if (notification = notification_already_exists?(organization))
next unless organization.expiring_subscriptions.count.to_s ==
notification.message.split(' ').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 deliver!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.deliver!
::Katello::RhelLifecycleStatus.lifecycles_expire_soon.each do |release, schedule|
schedule.each do |lifecycle, end_date|
count = hosts_with_index(release).count
next if count == 0
- 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 delete_version
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def delete_version
ignore_404_exception { api.repository_versions_api.delete(repo.version_href) } unless version_zero?
rescue api.api_exception_class => e
if e.message.include?("are currently being used to distribute content")
Rails.logger.warn "Exception when calling repository_versions_api->delete: #{e}"
- 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_units_batch_for_repo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.pulp_units_batch_for_repo(repository, options = {})
fetch_identifiers = options.fetch(:fetch_identifiers, false)
page_size = options.fetch(:page_size, Setting[:bulk_load_size])
repository_version_href = repository.version_href
page_opts = { "offset" => 0, repository_version: repository_version_href, limit: page_size }
- 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 copy_content_chunked
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def copy_content_chunked(data)
tasks = []
# Don't chunk if there aren't enough content units
if data.config.sum { |repo_config| repo_config[:content].size } <= UNIT_LIMIT
return api.copy_api.copy_content(data)
- 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!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def generate!
# For Red Hat repositories or Custom Repositories in the metadata exclusively
# Set up a 2 different list of importable root repositories
# creatable: repos that are part of the metadata but not in the library.
# They are ready to be created
- 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 copy_content_chunked
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def copy_content_chunked(data)
tasks = []
# Don't chunk if there aren't enough content units
if data.config.sum { |repo_config| repo_config[:content].size } <= UNIT_LIMIT
return api.copy_api.copy_content(data)
- 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_output
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def content_output(total_count)
content = content_output_collection(total_count)
if content.count >= 1
message_output = _("with")
if content.count == 1
- 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
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate(record)
#support lifecycle_environment_id for foreman models
environment_id = record.respond_to?(:lifecycle_environment_id) ? record.lifecycle_environment_id : record.environment_id
if record.content_view_id
view = ContentView.where(:id => record.content_view_id).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 execute!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def execute!
aks_with_no_cve = []
aks_with_missing_cve = []
FakeActivationKey.all.each do |ak|
- 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"