Method catch_registration_errors
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.catch_registration_errors(message_prefix: "",
show_update_hint: false,
silent_reg_code_mismatch: false,
&block)
# import the SSL certificate just once to avoid an infinite loop
Method handle_ssl_error
has a Cognitive Complexity of 18 (exceeds 5 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
- 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 catch_registration_errors
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.catch_registration_errors(message_prefix: "",
show_update_hint: false,
silent_reg_code_mismatch: false,
&block)
# import the SSL certificate just once to avoid an infinite loop
- 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
Avoid deeply nested control flow statements. Open
return true if cert.import
Method handle_network_error
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.handle_network_error(message_prefix, e)
if Yast::NetworkService.isNetworkRunning
# FIXME: use a better message, this one has been reused after the text freeze
report_error(message_prefix + _("Invalid URL."), e.message)
elsif Helpers.network_configurable && !Yast::Mode.auto
- 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"