src/lib/registration/ui/migration_repos_workflow.rb
File migration_repos_workflow.rb
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "pp"
require "yast"
require "yast2/popup"
require "y2packager/medium_type"
Class MigrationReposWorkflow
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class MigrationReposWorkflow < WizardClient
include Yast::UIShortcuts
Yast.import "Sequencer"
Yast.import "Mode"
Method system_upgrade_check
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def system_upgrade_check
log.info "System upgrade mode detected"
# media based upgrade requested by user
if Yast::Linuxrc.InstallInf("MediaUpgrade") == "1"
# we cannot do medium based upgrade using the Online medium,
- 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 merge_registered_addons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def merge_registered_addons
return unless load_addons
# TRANSLATORS: Popup question, merge this addon that are registered but not
# installed to the current migration products list.
- 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
Avoid too many return
statements within this method. Open
Open
return :skip