Showing 71 of 83 total issues
Method import_default
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def import_default(data, default)
# import first kernel params as cpu_mitigations can later modify it
import_kernel_params(data, default)
DEFAULT_BOOLEAN_MAPPING.each do |key, method|
- 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 basic_cmd
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def basic_cmd(secure_boot, trusted_boot, update_nvram)
if Systeminfo.shim_needed?(@grub2_name, secure_boot)
cmd = ["/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg"]
else
cmd = ["/usr/sbin/grub2-install", "--target=#{target}"]
- 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
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle
old_bl = BootloaderFactory.current.name
new_bl = value
return nil if old_bl == new_bl
Method controller_loop
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def controller_loop
loop do
input = Yast::UI.UserInput
pos = selected_disk_index
case input
- 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 ReadOrProposeIfNeeded
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ReadOrProposeIfNeeded
current_bl = ::Bootloader::BootloaderFactory.current
return if current_bl.read? || current_bl.proposed?
if Mode.config || (Stage.initial && !Mode.update)
- 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 controller_loop
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def controller_loop
loop do
input = Yast::UI.UserInput
pos = selected_disk_index
case input
Method DefaultKernelParams
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DefaultKernelParams(resume)
features = ProductFeatures.GetStringFeature(
"globals",
"additional_kernel_parameters"
)
Method single_click_action
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def single_click_action(option, value)
bootloader = ::Bootloader::BootloaderFactory.current
log.info "single_click_action: option #{option}, value #{value.inspect}"
Method supported_names
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def supported_names
if Yast::Mode.config
# default means bootloader use what it think is the best
result = BootloaderFactory::SUPPORTED_BOOTLOADERS.clone
result << SYSTEMDBOOT if use_systemd_boot?
- 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 Write
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def Write
ReadOrProposeIfNeeded()
mark_as_changed
- 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 make_proposal_raising
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_proposal_raising(attrs)
force_reset = attrs["force_reset"]
storage_read = Yast::BootStorage.storage_read?
# This must be checked at the beginning because the call to BootStorage.boot_filesystem
# below can trigger a re-read and change the result of BootStorage.storage_changed?
- 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 activate_partitions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def activate_partitions
partitions_to_activate.each do |partition|
num = partition.number
disk = partition.partitionable
raise "INTERNAL ERROR: Data for partition to activate is invalid." if num.nil? || disk.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 run_content
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_content
if !Yast::BootStorage.bootloader_installable?
textdomain "bootloader"
# TODO: not much helpful for customers
Method handle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def handle
old_bl = BootloaderFactory.current.name
new_bl = value
return nil if old_bl == new_bl
- 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_timeout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import_timeout(data, default)
return unless data.global.timeout
global = data.global
if global.hiddenmenu == "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 handle_buttons
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_buttons(action, pos)
case action
when :up
disks.insert(pos - 1, disks.delete_at(pos))
pos -= 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 write
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write
# message after first round of packet installation
# now the installed system is run and more packages installed
# just warn the user that the screen is going back to text mode
# and yast2 will come up again.
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run
guarded_run
rescue ::Bootloader::NoRoot
Yast::Report.Error(
_("YaST cannot configure the bootloader because it failed to find the root file system.")
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def target
return @target if @target
arch = Yast::Arch.architecture
target = efi ? EFI_TARGETS[Systeminfo.efi_arch] : NON_EFI_TARGETS[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"
Further reading
Method single_click_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def single_click_action(option, value)
bootloader = ::Bootloader::BootloaderFactory.current
log.info "single_click_action: option #{option}, value #{value.inspect}"
- 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"