yast/yast-registration

View on GitHub
src/lib/registration/ui/migration_repos_workflow.rb

Summary

Maintainability
D
1 day
Test Coverage

File migration_repos_workflow.rb has 506 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "pp"

require "yast"
require "yast2/popup"
require "y2packager/medium_type"
Severity: Major
Found in src/lib/registration/ui/migration_repos_workflow.rb - About 1 day to fix

    Class MigrationReposWorkflow has 39 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class MigrationReposWorkflow < WizardClient
          include Yast::UIShortcuts
    
          Yast.import "Sequencer"
          Yast.import "Mode"
    Severity: Minor
    Found in src/lib/registration/ui/migration_repos_workflow.rb - About 5 hrs to fix

      Method system_upgrade_check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      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,
      Severity: Minor
      Found in src/lib/registration/ui/migration_repos_workflow.rb - About 55 mins to fix

      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

            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.
      Severity: Minor
      Found in src/lib/registration/ui/migration_repos_workflow.rb - About 35 mins to fix

      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

                return :skip
      Severity: Major
      Found in src/lib/registration/ui/migration_repos_workflow.rb - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status