yast/yast-installation

View on GitHub

Showing 173 of 173 total issues

Method get_file_from_url has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
Open

    def get_file_from_url(scheme:, host:, urlpath:, localfile:,
      urltok:, destdir:)
      # adapt sane API to legacy implementation
      _Scheme    = scheme
      _Host      = host
Severity: Minor
Found in src/lib/transfer/file_from_url.rb - About 3 days 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

File ImageInstallation.rb has 1023 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "yast"
require "y2packager/resolvable"

module Yast
  class ImageInstallationClass < Module
Severity: Major
Found in src/modules/ImageInstallation.rb - About 2 days to fix

    File proposal_runner.rb has 579 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "yast"
    
    require "installation/proposal_store"
    require "installation/proposal_errors"
    require "ui/text_helpers"
    Severity: Major
    Found in src/lib/installation/proposal_runner.rb - About 1 day to fix

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

          def main
            textdomain "installation"
      
            Yast.import "Directory"
            Yast.import "Mode"
      Severity: Minor
      Found in src/lib/installation/clients/save_config_finish.rb - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
      Open

          def main
            Yast.import "UI"
            textdomain "installation"
      
            Yast.import "Wizard"
      Severity: Minor
      Found in src/lib/installation/clients/inst_release_notes.rb - About 1 day 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

      File file_from_url.rb has 500 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      require "yast2/execute"
      require "yast2/rel_url"
      
      # rubocop:disable all
      Severity: Minor
      Found in src/lib/transfer/file_from_url.rb - About 1 day to fix

        File inst_inc_second.rb has 496 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "shellwords"
        
        module Yast
          module InstallationInstIncSecondInclude
            def initialize_installation_inst_inc_second(include_target)
        Severity: Minor
        Found in src/include/installation/inst_inc_second.rb - About 7 hrs to fix

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

              def main
                textdomain "installation"
          
                # local sources that have been attached under /mnt during upgrade
                @local_urls = {}
          Severity: Minor
          Found in src/lib/installation/clients/inst_extrasources.rb - About 7 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

          File inst_finish.rb has 427 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "installation/minimal_installation"
          
          require "shellwords"
          
          Yast.import "UI"
          Severity: Minor
          Found in src/lib/installation/clients/inst_finish.rb - About 6 hrs to fix

            File proposal_store.rb has 378 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "yast"
            
            module Installation
              # 1. Provides access to metadata of proposal parts (clients), as defined in the control file
              #    elements /productDefines/proposals/proposal:
            Severity: Minor
            Found in src/lib/installation/proposal_store.rb - About 5 hrs to fix

              Class ImageInstallationClass has 38 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class ImageInstallationClass < Module
                  include Yast::Logger
              
                  IMAGE_COMPRESS_RATIO = 3.6
                  MEGABYTE = 2**20
              Severity: Minor
              Found in src/modules/ImageInstallation.rb - About 5 hrs to fix

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

                    def main
                      Yast.import "Pkg"
                      Yast.import "UI"
                      textdomain "installation"
                
                
                Severity: Minor
                Found in src/lib/installation/clients/inst_congratulate.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

                File inst_extrasources.rb has 369 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require "y2packager/known_repositories"
                require "y2packager/resolvable"
                
                Yast.import "UI"
                Yast.import "Pkg"
                Severity: Minor
                Found in src/lib/installation/clients/inst_extrasources.rb - About 4 hrs to fix

                  Method input_loop has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def input_loop
                        loop do
                          richtext_normal_cursor(Id(:proposal))
                  
                          # bnc #431567
                  Severity: Minor
                  Found in src/lib/installation/proposal_runner.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 main has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                      def main
                        Yast.import "UI"
                        #
                        # Authors:  Lukas Ocilka <locilka@suse.cz>
                        #
                  Severity: Minor
                  Found in src/lib/installation/clients/inst_network_check.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

                  File inst_release_notes.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "shellwords"
                  
                  module Yast
                    class InstReleaseNotesClient < Client
                      def main
                  Severity: Minor
                  Found in src/lib/installation/clients/inst_release_notes.rb - About 4 hrs to fix

                    Method DeployTarImage has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def DeployTarImage(id, target)
                          InitRepo()
                    
                          file = Ops.get_string(@_images, [id, "file"], "")
                          Builtins.y2milestone("Untarring image %1 (%2) to %3", id, file, target)
                    Severity: Minor
                    Found in src/modules/ImageInstallation.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 main has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def main
                          Yast.import "UI"
                    
                          textdomain "installation"
                    
                    
                    Severity: Minor
                    Found in src/lib/installation/clients/inst_installation_options.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

                    Class ProposalStore has 33 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class ProposalStore
                        include Yast::Logger
                        include Yast::I18n
                    
                        # How many times to maximally (re)run the proposal while some proposal clients
                    Severity: Minor
                    Found in src/lib/installation/proposal_store.rb - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language