src/lib/registration/clients/inst_scc.rb
File inst_scc.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "yast/suse_connect"
require "cgi"
require "registration/addon"
Class InstSccClient
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class InstSccClient < Client
include Yast::Logger
extend Yast::I18n
# popup message
Method start_workflow
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_workflow
sequence = {
"ws_start" => workflow_start,
"check" => {
auto: :auto,
Method registration_check
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
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 registration_check
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Avoid too many return
statements within this method. Open
Open
return :cancel if init_registration == :cancel
Avoid too many return
statements within this method. Open
Open
return :abort unless success
Method select_addons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def select_addons
log.group "Select add-ons" do |group|
# FIXME: available_addons is called just to fill cache with popup
return :cancel if get_available_addons == :cancel
- 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"