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"
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 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 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 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 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"