yast/yast-registration

View on GitHub

Showing 78 of 80 total issues

Method install_products has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def install_products
        not_installed = []

        Addon.registered_not_installed.each do |addon|
          # FIXME: fix the product installation, the add-on name might not match
Severity: Minor
Found in src/lib/registration/ui/not_installed_products_dialog.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

Method register_addons has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def register_addons(selected_addons, known_reg_codes)
      Yast::Wizard.SetContents(
        # dialog title
        _("Register Extensions and Modules"),
        # display only the products which need a registration code
Severity: Minor
Found in src/lib/registration/registration_ui.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

Method import_from_system has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def self.import_from_system
      prefix = Yast::Installation.destdir

      SslCertificate::PATHS.each do |file|
        cert_file = File.join(prefix, file)
Severity: Minor
Found in src/lib/registration/ssl_certificate.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

Method install_updates? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def install_updates?
      # ask only at installation/update
      return true unless Yast::Mode.installation || Yast::Mode.update

      options = Storage::InstallationOptions.instance
Severity: Minor
Found in src/lib/registration/registration_ui.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

    Avoid too many return statements within this method.
    Open

          return :cancel if init_registration == :cancel
    Severity: Major
    Found in src/lib/registration/clients/inst_scc.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

                    return nil if old_conf.ncc?
        Severity: Major
        Found in src/lib/registration/url_helpers.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false unless ret
          Severity: Major
          Found in src/lib/registration/clients/scc_auto.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return old_conf.stripped_url.to_s
            Severity: Major
            Found in src/lib/registration/url_helpers.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return :abort unless success
              Severity: Major
              Found in src/lib/registration/clients/inst_scc.rb - About 30 mins to fix

                Method preselect_recommended has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                      def preselect_recommended
                        # something is already selected/registered, keep the user selection unchanged
                        return if !Addon.selected.empty? || !Addon.registered.empty?
                
                        @all_addons.each do |a|
                Severity: Minor
                Found in src/lib/registration/ui/addon_selection_base_dialog.rb - About 25 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 activate_repositories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def activate_repositories
                      all_repos = Yast::Pkg.SourceGetCurrent(false)
                
                      all_repos.each do |repo|
                        repo_data = Yast::Pkg.SourceGeneralData(repo)
                Severity: Minor
                Found in src/lib/registration/migration_repositories.rb - About 25 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 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
                Severity: Minor
                Found in src/lib/registration/connect_helpers.rb - About 25 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 hide_reg_codes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.hide_reg_codes(settings)
                      return settings unless settings.is_a?(Hash)
                
                      # create a duplicate
                      filtered = settings.dup
                Severity: Minor
                Found in src/lib/registration/helpers.rb - About 25 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 register_base has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                      def register_base
                        until Registration.is_registered?
                          # register the base system if not already registered
                          base_reg_dialog = ::Registration::UI::BaseSystemRegistrationDialog.new
                          ret = base_reg_dialog.run
                Severity: Minor
                Found in src/lib/registration/ui/media_addon_workflow.rb - About 25 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 select_addons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                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
                
                
                Severity: Minor
                Found in src/lib/registration/clients/inst_scc.rb - About 25 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 url? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                      def url?
                        return false if value.to_s.empty?
                
                        uri = URI(value)
                        uri.scheme ? true : false
                Severity: Minor
                Found in src/lib/registration/widgets/registration_code.rb - About 25 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

                Severity
                Category
                Status
                Source
                Language