Showing 78 of 80 total issues
Method start_workflow
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_workflow
sequence = {
"ws_start" => workflow_start,
"check" => {
auto: :auto,
Method reg_url_at_upgrade
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.reg_url_at_upgrade
# in online upgrade mode behave like in installed system
return reg_url_at_running_system if Yast::Installation.destdir == "/"
custom_url = ::Registration::Storage::InstallationOptions.instance.custom_url
- 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 registration_check
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def registration_check
# Go back if the user clicked 'back' in the registration dialog
return :back if @back_from_register
# check the base product at start to avoid problems later,
- 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 add_service
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.add_service(product_service, credentials)
# save repositories before refreshing added services (otherwise
# pkg-bindings will treat them as removed by the service refresh and
# unload them)
if !Pkg.SourceSaveAll
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def write
# registration disabled, nothing to do
return true if !@config.do_registration && !Yast::Mode.update
# initialize libzypp if applying settings in installed system or
- 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 content_server_settings
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def content_server_settings
sha1 = ::Registration::Fingerprint::SHA1
sha256 = ::Registration::Fingerprint::SHA256
fingerprint_type = (config.reg_server_cert_fingerprint_type || "").upcase
Method add_service
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.add_service(product_service, credentials)
# save repositories before refreshing added services (otherwise
# pkg-bindings will treat them as removed by the service refresh and
# unload them)
if !Pkg.SourceSaveAll
Method run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
aliases = {
"find_products" => [->() { find_products }, true],
"register_base" => ->() { register_base },
"load_remote_addons" => ->() { load_remote_addons },
Method handle_user_input
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def handle_user_input
loop do
ret = Yast::UI.UserInput
case ret
- 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 download_file
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.download_file(file_url, insecure: false, redirection_count: 10)
raise DownloadError,
"Redirection not allowed or limit has been reached" if redirection_count < 0
file_url = URI(file_url) unless file_url.is_a?(URI)
- 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 registration_check
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def registration_check
# Go back if the user clicked 'back' in the registration dialog
return :back if @back_from_register
# check the base product at start to avoid problems later,
Method run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run
Yast::Wizard.SetContents(
# dialog title
_("License Agreement"),
Label(_("Downloading Licenses...")),
- 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 find_base_product
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.find_base_product
# FIXME: refactor the code to use Y2Packager::Product
# just for debugging:
return FAKE_BASE_PRODUCT if ENV["FAKE_BASE_PRODUCT"]
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
aliases = {
"general" => ->() { configure_registration },
"addons" => [->() { select_addons }, true],
"remote_addons" => [->() { select_remote_addons }, true],
Method richtext_checkbox
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def richtext_checkbox(id:, label:, status:)
enabled = [:selected, :auto_selected, :available].include?(status)
if Yast::UI.TextMode
check = case status
when :selected, :registered
Method main
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def main
textdomain "registration"
if WFM.Args.include?("help")
print_help
- 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 init
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.init(load_packages = false)
# false = do not allow continuing without the libzypp lock
lock = PackageLock.Connect(false)
# User would like to abort
raise_pkg_exception(PkgAborted) if lock["aborted"]
- 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_dialog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_dialog
Yast::UI.SetFocus(Id(:items))
ret = nil
continue_buttons = [:next, :back, :abort, :skip]
- 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_ssl_error
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.handle_ssl_error(error, certificate_imported)
cert = Storage::SSLErrors.instance.ssl_failed_cert
error_code = Storage::SSLErrors.instance.ssl_error_code
expected_cert_type = Storage::Config.instance.reg_server_cert_fingerprint_type
Method download_file
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.download_file(file_url, insecure: false, redirection_count: 10)
raise DownloadError,
"Redirection not allowed or limit has been reached" if redirection_count < 0
file_url = URI(file_url) unless file_url.is_a?(URI)