Showing 78 of 80 total issues
Method handle_dialog
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle_dialog
ret = nil
loop do
ret = Yast::UI.UserInput
- 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 migration_items
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def migration_items
sorted_migrations.map.with_index do |arr, idx|
base_product_text = base_product_text_for(arr)
extensions_text = extensions_text_for(arr)
modules_text = modules_text_for(arr)
- 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_repositories
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.check_repositories
# only enabled repositories
repos = Pkg.SourceGetCurrent(true)
repos.each 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 run_sequence
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run_sequence
log.info "Restoring the original repository and registration status..."
restore_repos
- 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 system_upgrade_check
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def system_upgrade_check
log.info "System upgrade mode detected"
# media based upgrade requested by user
if Yast::Linuxrc.InstallInf("MediaUpgrade") == "1"
# we cannot do medium based upgrade using the Online medium,
- 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 target_distribution
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.target_distribution(destdir)
if Y2Packager::MediumType.online?
control_products = Y2Packager::ProductSpec.base_products
target_distro = if control_products.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
Avoid deeply nested control flow statements. Open
return true if cert.import
Method handle_dialog
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_dialog
continue_buttons = [:next, :back, :abort]
ret = nil
until continue_buttons.include?(ret)
- 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_instsys_ca
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.update_instsys_ca
FileUtils.mkdir_p(TMP_CA_CERTS_DIR)
# Extract system certs in openssl and pem formats
Yast::Execute.locally("trust", "extract", "--format=openssl-directory",
"--filter=ca-anchors", "--overwrite", File.join(TMP_CA_CERTS_DIR, "openssl"))
- 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_old_credentials
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.copy_old_credentials(source_dir)
log.info "Searching registration credentials in #{source_dir}..."
dir = SUSE::Connect::YaST::DEFAULT_CREDENTIALS_DIR
# create the target directory if missing
- 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 online_base_product
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.online_base_product
if Mode.update
prods = Y2Packager::ProductSpec.base_products
installed_names = installed_products.map { |p| p["name"] }
prod = prods.find { |p| installed_names.include?(p.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 handle_dialog
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_dialog
loop do
Yast::UI.SetFocus(:next)
ui = Yast::UI.UserInput
log.info "User input: #{ui}"
- 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 reg_codes_from_usb_stick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reg_codes_from_usb_stick
with_tempfile("regcodes-") do |path|
REGCODES_NAME_HANDLERS.each do |name, handler|
next unless get_file_from_url(scheme: "usb", host: "",
urlpath: "/#{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 register_addons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def register_addons(selected_addons, known_reg_codes)
Yast::Wizard.SetContents(
# dialog title
_("Register Extensions and Modules"),
# display only the products which need a registration code
- 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 registration_order
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def registration_order(list)
to_process = list.dup
result = []
loop 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 install_updates?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def install_updates?
# ask only at installation/update
return true unless Yast::Mode.installation || Yast::Mode.update
options = Storage::InstallationOptions.instance
- 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 set_registration_url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_registration_url
# set the registration URL
url = @config.reg_server if @config.reg_server && !@config.reg_server.empty?
# use SLP discovery
- 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_dialog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_dialog
ret = nil
loop do
refresh_buttons
- 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_from_system
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.import_from_system
prefix = Yast::Installation.destdir
SslCertificate::PATHS.each do |file|
cert_file = File.join(prefix, file)
- 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 select_addons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def select_addons(all_addons)
# select the requested addons from the AY profile
requested_addons.each do |addon|
# Set architecture if it is not defined in the requested addon
requested_arch = addon["arch"] || Yast::Arch.rpm_arch
- 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"