Showing 33 of 94 total issues
Method create_product_activation
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def create_product_activation
activation = @system.activations.where(service_id: @product.service.id).first_or_create
# in BYOS mode, we rely on the activation being performed in
# `engines/scc_proxy/lib/scc_proxy/engine.rb` and don't need further checks here
- 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 authenticate_system
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def authenticate_system(skip_on_duplicated: false)
authenticate_or_request_with_http_basic('RMT API') do |login, password|
@systems = System.get_by_credentials(login, password)
if @systems.present?
# Return now if we just detected duplicates and we were told to skip on
- 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 scc_activate_product
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def scc_activate_product
logger.info "Activating product #{@product.product_string} to SCC"
auth = request.headers['HTTP_AUTHORIZATION']
if @system.proxy_byos
response = SccProxy.scc_activate_product(@product, auth, params[:token], params[:email])
- 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 verify_product_activation
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def verify_product_activation
product = find_product
if product.base?
verify_base_product_activation(product)
- 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 scc_deregistration
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def scc_deregistration
if @system.proxy_byos
auth = request.headers['HTTP_AUTHORIZATION']
response = SccProxy.deregister_system_scc(auth, @system.system_token)
unless response.code_type == Net::HTTPNoContent
- 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_product
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_product(item, root_product_id = nil, base_product = nil, recommended = false, migration_extra = false)
Method prepare_scc_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_scc_request(uri_path, product, auth, token, email)
Method list
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def list
products = (options.all ? Product.all : Product.mirrored).order(:name, :version, :arch)
products = products.with_release_stage(options[:release_stage])
products = products.with_name_filter(options[:name])
products = products.with_version_filter(options[:version])
- 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 announce_system
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def announce_system
auth_header = nil
auth_header = request.headers['HTTP_AUTHORIZATION'] if request.headers.include?('HTTP_AUTHORIZATION')
system_information = hwinfo_params[:hwinfo].to_json
- 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 parse_package_list
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def parse_package_list(packagelist)
packages = []
hdl = File.open(packagelist.local_path, 'rb')
current = {}
- 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_custom_repositories
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def import_custom_repositories
read_csv('enabled_custom_repos').each do |row|
product_id, repo_name, repo_url = row
repo_url += '/' unless repo_url.ends_with?('/')
- 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 dispatch
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def dispatch(command, given_args, given_opts, config)
handle_exceptions { super(command, given_args, given_opts, config) }
rescue RMT::CLI::Error => e
warn e.to_s
if config[:shell]&.base&.options&.[]('debug')
- 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 list_repositories
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def list_repositories(scope: :enabled)
repositories = ((scope == :all) ? Repository.only_scc : Repository.only_scc.only_mirroring_enabled).order(:name, :description)
decorator = ::RMT::CLI::Decorators::RepositoryDecorator.new(repositories)
if repositories.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"