Showing 71 of 83 total issues
Method merge_attributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def merge_attributes(default, other)
# string attributes
[:serial_console, :timeout, :hidden_timeout, :distributor,
:gfxmode, :theme, :default].each do |attr|
val = other.public_send(attr)
- 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_boot_msg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_boot_msg
finish_ret = {}
if Yast::Arch.s390
reipl_client = "reipl_bootloader_finish"
- 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
Consider simplifying this complex logical expression. Open
if Arch.i386 || Arch.x86_64 || Arch.aarch64 || Arch.arm || Arch.ppc || Arch.riscv64
ret = kernel_cmdline
ret << " resume=#{resume}" unless resume.empty?
ret << " #{features}" unless features.empty?
ret << propose_cpu_mitigations
Method merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def merge(other)
log.info "merging: timeout: #{menu_timeout}=>#{other.menu_timeout}"
log.info " secure_boot: #{secure_boot}=>#{other.secure_boot}"
log.info " mitigations: #{cpu_mitigations.to_human_string}=>" \
"#{other.cpu_mitigations.to_human_string}"
- 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 available_locations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def available_locations
case Yast::Arch.architecture
when "i386", "x86_64"
res = [:mbr]
return res unless can_use_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 ask_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ask_user(param)
chosen_id = param["chosen_id"]
result = :next
log.info "ask user called with #{chosen_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 write
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def write(etc_only: false)
# super have to called as first as grub install require some config writen in ancestor
super
device_map.write if (Yast::Arch.x86_64 || Yast::Arch.i386) && !etc_only
- 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 correct_loader_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def correct_loader_type(type)
return true if type == "none"
# grub2 is sooo cool...
return true if type == "grub2" && !::Bootloader::Systeminfo.efi_mandatory?
- 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 kernel_param
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def kernel_param(flavor, key)
if flavor == :recovery
log.warn "Using deprecated recovery flavor"
return :missing
end
- 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 load_from_kernel_args
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.load_from_kernel_args(kernel_params)
console_parameters = kernel_params.parameter("console")
return nil unless console_parameters
console_parameters = Array(console_parameters)
- 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 export_grub2
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def export_grub2(res, bootloader)
GRUB2_BOOLEAN_MAPPING.each do |key, method|
val = bootloader.public_send(method)
res[key] = val ? "true" : "false" unless val.nil?
end
- 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_kernel_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_kernel_params(data, default)
DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
val = data.global.public_send(key)
next unless val
- 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 export_grub2efi
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def export_grub2efi(res, bootloader)
GRUB2EFI_BOOLEAN_MAPPING.each do |key, method|
val = bootloader.public_send(method)
res[key] = val ? "true" : "false" unless val.nil?
end
- 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 too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Method import_grub2efi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_grub2efi(data, bootloader)
return unless bootloader.name == "grub2-efi"
GRUB2EFI_BOOLEAN_MAPPING.each do |key, method|
val = data.global.public_send(key)
- 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 summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def summary(simple_mode: false)
result = [
Yast::Builtins.sformat(
_("Boot Loader Type: %1"),
"GRUB2"
- 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 reset_needed?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reset_needed?(force_reset, storage_changed)
log.info "reset_needed? force_reset: #{force_reset} storage_changed: #{storage_changed}" \
"auto mode: #{Yast::Mode.auto} cfg_changed #{Yast::Bootloader.proposed_cfg_changed}"
return true if storage_changed
return false if Yast::Mode.autoinst || Yast::Mode.autoupgrade
- 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_stage1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_stage1(data, bootloader)
return unless bootloader.name == "grub2"
stage1 = bootloader.stage1
global = data.global
- 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 proper_environment?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def proper_environment?
if Yast::Mode.live_installation
log.info "Running live_installation without using kexec"
return false
end
- 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"