yast/yast-installation

View on GitHub

Showing 173 of 173 total issues

Method main has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def main
      Yast.import "UI"

      textdomain "installation"

Severity: Minor
Found in src/lib/installation/clients/inst_license.rb - About 4 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 FindImageSet has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def FindImageSet(patterns)
      patterns = deep_copy(patterns)
      InitRepo()

      # reset all data
Severity: Minor
Found in src/modules/ImageInstallation.rb - About 3 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 InstUpdateInstaller has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

  class InstUpdateInstaller
    include Yast::Logger
    include Yast::I18n

    UPDATED_FLAG_FILENAME = "installer_updated".freeze
Severity: Minor
Found in src/lib/installation/clients/inst_update_installer.rb - About 3 hrs to fix

    File inst_deploy_image.rb has 319 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Yast
      class InstDeployImageClient < Client
        include Yast::Logger
    
        def main
    Severity: Minor
    Found in src/lib/installation/clients/inst_deploy_image.rb - About 3 hrs to fix

      File inst_update_installer.rb has 313 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "installation/instsys_packages"
      require "installation/update_repositories_finder"
      require "installation/updates_manager"
      require "installation/selfupdate_verifier"
      require "y2packager/self_update_addon_repo"
      Severity: Minor
      Found in src/lib/installation/clients/inst_update_installer.rb - About 3 hrs to fix

        Method make_proposal has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def make_proposal(force_reset, language_changed)
              tab_to_switch = 999
              current_tab_affected = false
              @have_blocker = false
        
        
        Severity: Minor
        Found in src/lib/installation/proposal_runner.rb - About 3 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 RestoreAllChanges has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def RestoreAllChanges
              nr_steps = Ops.multiply(4, Builtins.size(@all_supported_types))
              id = "restoring_user_prefs"
        
              AdjustProgressLayout(id, nr_steps, _("Restoring user preferences..."))
        Severity: Minor
        Found in src/modules/ImageInstallation.rb - About 3 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 ProposalRunner has 27 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class ProposalRunner
            include Yast::I18n
            include Yast::UIShortcuts
            include Yast::Logger
            include ::UI::TextHelpers
        Severity: Minor
        Found in src/lib/installation/proposal_runner.rb - About 3 hrs to fix

          Method FileSystemCopy has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def FileSystemCopy(from, to, progress_start, progress_finish)
                total_mb = if from == "/"
                  # root is a merge of two filesystems, df returns only one part for /
                  calculate_fs_size("/read-write") + calculate_fs_size("/read-only")
                else
          Severity: Minor
          Found in src/modules/ImageInstallation.rb - About 3 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 main has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def main
                Yast.import "UI"
          
                textdomain "installation"
          
          
          Severity: Minor
          Found in src/lib/installation/clients/yast_inf_finish.rb - About 3 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_dialog has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def handle_dialog
                log.info("Offering repositories: #{repo_manager.repositories.map(&:repo_alias).inspect}")
          
                ret = nil
          
          
          Severity: Minor
          Found in src/lib/installation/clients/inst_upgrade_urls.rb - About 3 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 SecuritySettings has 26 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class SecuritySettings
              include Yast::Logger
              include Yast::I18n
          
              # [Boolean] Whether the firewalld service will be enable
          Severity: Minor
          Found in src/lib/installation/security_settings.rb - About 3 hrs to fix

            Method run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                def run
                  if Yast::Mode.auto
                    # Checking if second stage is needed and the environment has been setup.
                    second_stage_error = Yast::AutoinstFunctions.check_second_stage_environment
            
            
            Severity: Minor
            Found in src/lib/installation/proposal_runner.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 main has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def main
                  textdomain "installation"
            
                  Yast.import "Mode"
                  Yast.import "ImageInstallation"
            Severity: Minor
            Found in src/lib/installation/clients/deploying_proposal.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 UpdateRepository has 23 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class UpdateRepository
                include Yast::Logger
                include Yast::I18n
            
                # Where the repository information comes from
            Severity: Minor
            Found in src/lib/installation/update_repository.rb - About 2 hrs to fix

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

                  def submod_descriptions_and_build_menu
                    return true unless Yast::UI.TextMode # have menu only in text mode
              
                    # now build the menu button
                    menu_list = @submodules_presentation.each_with_object([]) do |submod, menu|
              Severity: Minor
              Found in src/lib/installation/proposal_runner.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 main has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  def main
                    textdomain "installation"
              
                    Yast.import "Mode"
                    Yast.import "HwStatus"
              Severity: Minor
              Found in src/lib/installation/clients/save_hw_status_finish.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 RerunInstallationIfAborted has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  def RerunInstallationIfAborted
                    # Second stage installation bas been aborted or has failed
                    if FileUtils.Exists(Installation.file_inst_aborted) ||
                        FileUtils.Exists(Installation.file_inst_failed)
                      # popup question (#x1)
              Severity: Minor
              Found in src/include/installation/inst_inc_second.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 main has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  def main
                    Yast.import "UI"
              
                    # **
                    # <h3>Initialization of the disks</h3>
              Severity: Minor
              Found in src/lib/installation/clients/inst_disks_activate.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 each_mounted_device has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  def each_mounted_device(&block)
                    mnt_tmpdir = "#{Directory.tmpdir}/tmp_mnt_for_check"
                    mnt_tmpdir = SystemFilesCopy.CreateDirectoryIfMissing(mnt_tmpdir)
              
                    # CreateDirectory failed
              Severity: Minor
              Found in src/lib/installation/clients/inst_pre_install.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

              Severity
              Category
              Status
              Source
              Language