Showing 83 of 83 total issues
File grub2_widgets.rb
has 857 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "bootloader/generic_widgets"
require "bootloader/device_map_dialog"
require "bootloader/serial_console"
Class Grub2Base
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Grub2Base < BootloaderBase
include Yast::Logger
include Yast::I18n
# @!attribute password
File Bootloader.rb
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "yast2/popup"
require "bootloader/exceptions"
require "bootloader/sysconfig"
require "bootloader/bootloader_factory"
File grub2base.rb
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "yast2/execute"
require "yast2/target_file" # adds ability to work with cfa in inst-sys
require "bootloader/bootloader_base"
require "bootloader/exceptions"
Class BootStorageClass
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class BootStorageClass < Module
include Yast::Logger
# Moint point for /boot. If there is not separated /boot, / is used instead.
# @return [Y2Storage::Filesystem]
Method modify_kernel_params
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def modify_kernel_params(*args)
ReadOrProposeIfNeeded() # ensure we have data to modify
current_bl = ::Bootloader::BootloaderFactory.current
# currently only grub2 bootloader and systemd-boot supported
if !current_bl.respond_to?(:grub_default) && !current_bl.is_a?(::Bootloader::SystemdBoot)
- 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
File proposal_client.rb
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "installation/proposal_client"
require "bootloader/exceptions"
require "bootloader/main_dialog"
require "bootloader/bootloader_factory"
require "bootloader/systeminfo"
Class Systeminfo
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Systeminfo
class << self
include Yast::Logger
# Check current secure boot state.
File autoyast_converter.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "bootloader/bootloader_factory"
require "bootloader/cpu_mitigations"
Method DefaultKernelParams
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def DefaultKernelParams(resume)
features = ProductFeatures.GetStringFeature(
"globals",
"additional_kernel_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
Class Stage1
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Stage1
extend Forwardable
include Yast::Logger
attr_reader :model
Method can_use_boot?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def can_use_boot?
fs = Yast::BootStorage.boot_filesystem
# no boot assigned
return false unless fs
- 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 Read
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Read
log.info "Reading configuration"
# run Progress bar
stages = [
# progress stage, text in dialog (short, infinitiv)
Class DeviceMapDialog
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class DeviceMapDialog
include Yast::UIShortcuts
include Yast::I18n
def self.run(device_map)
Method modify_kernel_params
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modify_kernel_params(*args)
ReadOrProposeIfNeeded() # ensure we have data to modify
current_bl = ::Bootloader::BootloaderFactory.current
# currently only grub2 bootloader and systemd-boot supported
if !current_bl.respond_to?(:grub_default) && !current_bl.is_a?(::Bootloader::SystemdBoot)
Method export_default
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def export_default(res, default)
DEFAULT_BOOLEAN_MAPPING.each do |key, method|
val = default.public_send(method)
res[key] = val.enabled? ? "true" : "false" if val.defined?
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 execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def execute(devices: [], secure_boot: false, trusted_boot: false, update_nvram: true)
if secure_boot && !Systeminfo.secure_boot_available?(@grub2_name)
# There might be some secure boot setting left over when the
# bootloader had been switched.
# Simply ignore it when it is not applicable instead of raising an
- 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 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Write
ReadOrProposeIfNeeded()
mark_as_changed
Method Read
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def Read
log.info "Reading configuration"
# run Progress bar
stages = [
# progress stage, text in dialog (short, infinitiv)
- 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_activate_partition
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def check_activate_partition
# activate set
return true if stage1.activate?
# there is already activate flag
- 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"