Showing 81 of 81 total issues
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"
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
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 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 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 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 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_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
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 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 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
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
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"
Further reading
Method bootloader_by_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def bootloader_by_name(name)
# needed to be able to store settings when moving between bootloaders
@cached_bootloaders ||= {}
case name
when "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 write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write
log.info "Saving /etc/sysconfig/bootloader for #{bootloader}"
write_option(:bootloader, bootloader)
- 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 propose_cpu_mitigations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def propose_cpu_mitigations
linuxrc_value = Yast::Linuxrc.value_for("mitigations")
log.info "linuxrc mitigations #{linuxrc_value.inspect}"
return "" unless linuxrc_value.nil? # linuxrc already has mitigations
- 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_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 propose_terminal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def propose_terminal
begin
return if grub_default.terminal
rescue RuntimeError => e
log.info "Proposing terminal again due to #{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"