yast/yast-registration

View on GitHub

Showing 78 of 80 total issues

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 BaseSystemRegistrationDialog has 52 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class BaseSystemRegistrationDialog
          include Yast::Logger
          include Yast::I18n
          include Yast::UIShortcuts
          include Yast
    Severity: Major
    Found in src/lib/registration/ui/base_system_registration_dialog.rb - About 7 hrs to fix

      File sw_mgmt.rb has 450 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      
      require "tmpdir"
      require "fileutils"
      require "ostruct"
      Severity: Minor
      Found in src/lib/registration/sw_mgmt.rb - About 6 hrs to fix

        File base_system_registration_dialog.rb has 435 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "yast"
        require "yast/suse_connect"
        require "ui/event_dispatcher"
        require "uri"
        
        
        Severity: Minor
        Found in src/lib/registration/ui/base_system_registration_dialog.rb - About 6 hrs 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

            Class SwMgmt has 35 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class SwMgmt
                include Yast
                include Yast::Logger
                extend Yast::I18n
            
            
            Severity: Minor
            Found in src/lib/registration/sw_mgmt.rb - About 4 hrs to fix

              Class Addon has 32 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class Addon
                  extend Yast::I18n
                  include Yast::I18n
              
                  # The list of addons has not been loaded
              Severity: Minor
              Found in src/lib/registration/addon.rb - About 4 hrs to fix

                Class SslCertificate has 28 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class SslCertificate
                    include Yast::Logger
                
                    Yast.import "Stage"
                    Yast.import "Installation"
                Severity: Minor
                Found in src/lib/registration/ssl_certificate.rb - About 3 hrs to fix

                  Class SCCAuto has 27 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class SCCAuto < ::Installation::AutoClient
                        include Yast::Logger
                        extend Yast::I18n
                  
                        # popup message
                  Severity: Minor
                  Found in src/lib/registration/clients/scc_auto.rb - About 3 hrs to fix

                    File registration_ui.rb has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require "yast"
                    
                    require "registration/connect_helpers"
                    require "registration/registration"
                    require "registration/sw_mgmt"
                    Severity: Minor
                    Found in src/lib/registration/registration_ui.rb - About 3 hrs to fix

                      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
                      Severity: Major
                      Found in src/lib/registration/connect_helpers.rb - About 3 hrs to fix

                        File inst_scc.rb has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "yast/suse_connect"
                        
                        require "cgi"
                        
                        require "registration/addon"
                        Severity: Minor
                        Found in src/lib/registration/clients/inst_scc.rb - About 2 hrs to fix

                          Method evaluate_product has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def self.evaluate_product(p, selected, installed)
                                if Stage.initial && Mode.auto
                                  Yast.import "AutoinstFunctions"
                                  # note: AutoinstFunctions.selected_product should never be nil when
                                  # AY let it pass here
                          Severity: Minor
                          Found in src/lib/registration/sw_mgmt.rb - About 2 hrs 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 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
                          
                          
                          Severity: Minor
                          Found in src/lib/registration/connect_helpers.rb - About 2 hrs 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 richtext_checkbox has a Cognitive Complexity of 18 (exceeds 5 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
                          Severity: Minor
                          Found in src/lib/registration/ui/addon_selection_base_dialog.rb - About 2 hrs 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

                          Class RegistrationUI has 22 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class RegistrationUI
                              include Yast::Logger
                              include Yast::UIShortcuts
                              include Yast::I18n
                              extend Yast::I18n
                          Severity: Minor
                          Found in src/lib/registration/registration_ui.rb - About 2 hrs to fix

                            Class MigrationSelectionDialog has 22 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class MigrationSelectionDialog
                                  include Yast::Logger
                                  include Yast::I18n
                                  include Yast::UIShortcuts
                            
                            
                            Severity: Minor
                            Found in src/lib/registration/ui/migration_selection_dialog.rb - About 2 hrs to fix

                              Class Registration has 22 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                class Registration
                                  include Yast::Logger
                              
                                  attr_accessor :url
                              
                              
                              Severity: Minor
                              Found in src/lib/registration/registration.rb - About 2 hrs to fix

                                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
                                Severity: Minor
                                Found in src/lib/registration/connect_helpers.rb - About 2 hrs 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

                                Class InstSccClient has 21 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                  class InstSccClient < Client
                                    include Yast::Logger
                                    extend Yast::I18n
                                
                                    # popup message
                                Severity: Minor
                                Found in src/lib/registration/clients/inst_scc.rb - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language