yast/yast-yast2

View on GitHub
library/packages/src/modules/PackageCallbacks.rb

Summary

Maintainability
F
3 wks
Test Coverage

File PackageCallbacks.rb has 2396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "yast"
require "uri"
require "packages/dummy_callbacks"
require "packages/file_conflict_callbacks"

Severity: Major
Found in library/packages/src/modules/PackageCallbacks.rb - About 6 days to fix

    Class PackageCallbacksClass has 120 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class PackageCallbacksClass < Module
        include Yast::Logger
    
        # text to clean progress bar in command line
        CLEAR_PROGRESS_TEXT = ("\b" * 10) + (" " * 10) + ("\b" * 10)
    Severity: Major
    Found in library/packages/src/modules/PackageCallbacks.rb - About 2 days to fix

      Method MediaChange has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
      Open

          def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
            devices = deep_copy(devices)
            if @autorefreshing && @autorefreshing_aborted
              Builtins.y2milestone("Refresh aborted")
              return "C"
      Severity: Minor
      Found in library/packages/src/modules/PackageCallbacks.rb - About 2 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

      Method MediaChange has 279 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
            devices = deep_copy(devices)
            if @autorefreshing && @autorefreshing_aborted
              Builtins.y2milestone("Refresh aborted")
              return "C"
      Severity: Major
      Found in library/packages/src/modules/PackageCallbacks.rb - About 1 day to fix

        Method DonePackage has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            def DonePackage(error, reason)
              # remove invalid characters (bnc#876459)
              if !reason.valid_encoding?
                reason.encode!("UTF-16", undef: :replace, invalid: :replace, replace: "?")
                reason.encode!("UTF-8")
        Severity: Minor
        Found in library/packages/src/modules/PackageCallbacks.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

        Method DoneProvide has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

            def DoneProvide(error, reason, name)
              Builtins.y2milestone("DoneProvide: %1, %2, %3", error, reason, name)
        
              if @_provide_popup
                UI.CloseDialog
        Severity: Minor
        Found in library/packages/src/modules/PackageCallbacks.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

        Method DoneProvide has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def DoneProvide(error, reason, name)
              Builtins.y2milestone("DoneProvide: %1, %2, %3", error, reason, name)
        
              if @_provide_popup
                UI.CloseDialog
        Severity: Major
        Found in library/packages/src/modules/PackageCallbacks.rb - About 4 hrs to fix

          Method ProgressDownload has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              def ProgressDownload(percent, bps_avg, bps_current)
                if @autorefreshing && @autorefreshing_aborted
                  Builtins.y2milestone("Refresh aborted")
                  return false
                end
          Severity: Minor
          Found in library/packages/src/modules/PackageCallbacks.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 DonePackage has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def DonePackage(error, reason)
                # remove invalid characters (bnc#876459)
                if !reason.valid_encoding?
                  reason.encode!("UTF-16", undef: :replace, invalid: :replace, replace: "?")
                  reason.encode!("UTF-8")
          Severity: Major
          Found in library/packages/src/modules/PackageCallbacks.rb - About 3 hrs to fix

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

                def ErrorScanDb(error, description)
                  Builtins.y2error(
                    "ErrorScanDb callback: error: %1, description: %2",
                    error,
                    description
            Severity: Minor
            Found in library/packages/src/modules/PackageCallbacks.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 InitPackageCallbacks has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def InitPackageCallbacks
                  SetProcessCallbacks()
            
                  SetProvideCallbacks()
            
            
            Severity: Major
            Found in library/packages/src/modules/PackageCallbacks.rb - About 3 hrs to fix

              Method ErrorScanDb has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def ErrorScanDb(error, description)
                    Builtins.y2error(
                      "ErrorScanDb callback: error: %1, description: %2",
                      error,
                      description
              Severity: Major
              Found in library/packages/src/modules/PackageCallbacks.rb - About 2 hrs to fix

                Method main has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def main
                      Yast.import "Pkg"
                      Yast.import "UI"
                
                      textdomain "base"
                Severity: Major
                Found in library/packages/src/modules/PackageCallbacks.rb - About 2 hrs to fix

                  Method ScriptStart has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def ScriptStart(patch_name, patch_version, patch_arch, script_path)
                        patch_full_name = FormatPatchName(patch_name, patch_version, patch_arch)
                  
                        Builtins.y2milestone(
                          "ScriptStart callback: patch: %1, script: %2",
                  Severity: Minor
                  Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                    Method Authentication has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def Authentication(url, msg, username, password)
                          # FIXME: after SLE12 release
                          # The following 'if' block is a workaround for bnc#895719 that should be
                          # extracted to a proper private method (not sure if it will work as
                          # expected being a callback) and adapted to use normal _() instead of
                    Severity: Minor
                    Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                      Method ProgressDownload has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def ProgressDownload(percent, bps_avg, bps_current)
                            if @autorefreshing && @autorefreshing_aborted
                              Builtins.y2milestone("Refresh aborted")
                              return false
                            end
                      Severity: Minor
                      Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                        Method ProgressStart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
                              Builtins.y2milestone("ProgressStart: %1", id)
                        
                              @tick_progress = is_alive
                              @val_progress = !in_percent && !is_alive
                        Severity: Minor
                        Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr 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 SourceProbeError has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def SourceProbeError(url, error, description)
                              Builtins.y2milestone(
                                "Source probe: error: url: %1, error: %2, description: %3",
                                URL.HidePassword(url),
                                error,
                        Severity: Minor
                        Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                          Method SourceCreateError has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def SourceCreateError(url, error, description)
                                Builtins.y2milestone(
                                  "Source create: error: url: %1, error: %2, description: %3",
                                  URL.HidePassword(url),
                                  error,
                          Severity: Minor
                          Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                            Method SourceReportError has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def SourceReportError(source_id, url, error, description)
                                  Builtins.y2milestone(
                                    "Source report: error: id: %1, url: %2, error: %3, description: %4",
                                    source_id,
                                    URL.HidePassword(url),
                            Severity: Minor
                            Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                              Method ProgressStart has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
                                    Builtins.y2milestone("ProgressStart: %1", id)
                              
                                    @tick_progress = is_alive
                                    @val_progress = !in_percent && !is_alive
                              Severity: Minor
                              Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                Method ProgressProgress has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def ProgressProgress(id, val_raw, val_percent)
                                      Builtins.y2debug("ProgressProgress: %1, %2%% ", id, val_percent)
                                
                                      if Mode.commandline
                                        if @tick_progress
                                Severity: Minor
                                Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr 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 MediaChange has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
                                Severity: Major
                                Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                  Method StartProvide has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def StartProvide(name, archivesize, remote)
                                        Builtins.y2milestone("StartProvide: name: %1, remote: %2", name, remote)
                                        if remote
                                          sz = String.FormatSizeWithPrecision(archivesize, 2, false)
                                          if Mode.commandline
                                  Severity: Minor
                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr 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 AskAbortRefresh has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def AskAbortRefresh
                                        UI.OpenDialog(
                                          MarginBox(
                                            1,
                                            0.5,
                                  Severity: Minor
                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                    Method ProgressProgress has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def ProgressProgress(id, val_raw, val_percent)
                                          Builtins.y2debug("ProgressProgress: %1, %2%% ", id, val_percent)
                                    
                                          if Mode.commandline
                                            if @tick_progress
                                    Severity: Minor
                                    Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                      Method StartScanDb has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def StartScanDb
                                            Builtins.y2milestone("Scanning RPM DB...")
                                      
                                            if Mode.commandline
                                              # progress message (command line mode)
                                      Severity: Minor
                                      Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                        Method cd_devices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def cd_devices(preferred)
                                              cds = Convert.convert(
                                                SCR.Read(path(".probe.cdrom")),
                                                from: "any",
                                                to:   "list <map>"
                                        Severity: Minor
                                        Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr 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 ProcessStart has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            def ProcessStart(task, stages, help)
                                              stages = deep_copy(stages)
                                              Builtins.y2milestone(
                                                "Process: Start: task: %1, stages: %2, help: %3",
                                                task,
                                        Severity: Minor
                                        Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                          Method StartPackage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              def StartPackage(name, _location, _summary, installsize, is_delete)
                                                return if !@enable_asterix_package
                                          
                                                @_package_name = name
                                                @_package_size = installsize
                                          Severity: Minor
                                          Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                            Method cd_devices has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                def cd_devices(preferred)
                                                  cds = Convert.convert(
                                                    SCR.Read(path(".probe.cdrom")),
                                                    from: "any",
                                                    to:   "list <map>"
                                            Severity: Minor
                                            Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                              Method layout_popup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  def layout_popup(message, button_box, info_on)
                                                    vertical_size = info_on ? 10 : 1
                                                    VBox(
                                                      HSpacing(50), # enforce width
                                                      VSpacing(0.1),
                                              Severity: Minor
                                              Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                                Method ProgressStart has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    def ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
                                                Severity: Major
                                                Found in library/packages/src/modules/PackageCallbacks.rb - About 1 hr to fix

                                                  Method StartPackage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                      def StartPackage(name, _location, _summary, installsize, is_delete)
                                                        return if !@enable_asterix_package
                                                  
                                                        @_package_name = name
                                                        @_package_size = installsize
                                                  Severity: Minor
                                                  Found in library/packages/src/modules/PackageCallbacks.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 ScriptProgress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                      def ScriptProgress(ping, output)
                                                        Builtins.y2milestone("ScriptProgress: ping:%1, output: %2", ping, output)
                                                  
                                                        if @_script_popup
                                                          if ping
                                                  Severity: Minor
                                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 45 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 FormatPatchName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                      def FormatPatchName(patch_name, patch_version, patch_arch)
                                                        patch_full_name = (!patch_name.nil? && patch_name != "") ? patch_name : ""
                                                  
                                                        if patch_full_name != ""
                                                          if !patch_version.nil? && patch_version != ""
                                                  Severity: Minor
                                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 45 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 SourceReportEnd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      def SourceReportEnd(src_id, url, task, error, description)
                                                  Severity: Minor
                                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 35 mins to fix

                                                    Method StartPackage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        def StartPackage(name, _location, _summary, installsize, is_delete)
                                                    Severity: Minor
                                                    Found in library/packages/src/modules/PackageCallbacks.rb - About 35 mins to fix

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

                                                          def SourceCreateError(url, error, description)
                                                            Builtins.y2milestone(
                                                              "Source create: error: url: %1, error: %2, description: %3",
                                                              URL.HidePassword(url),
                                                              error,
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 ScriptStart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def ScriptStart(patch_name, patch_version, patch_arch, script_path)
                                                            patch_full_name = FormatPatchName(patch_name, patch_version, patch_arch)
                                                      
                                                            Builtins.y2milestone(
                                                              "ScriptStart callback: patch: %1, script: %2",
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 ProgressEnd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def ProgressEnd(id)
                                                            Builtins.y2milestone("ProgressFinish: %1", id)
                                                      
                                                            # remove the last element from the progress stack
                                                            @progress_stack = Builtins.remove(
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 process_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def process_message(msg, max_len)
                                                            words = msg.split
                                                      
                                                            log.info "words: %{words}"
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 SourceProbeError has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def SourceProbeError(url, error, description)
                                                            Builtins.y2milestone(
                                                              "Source probe: error: url: %1, error: %2, description: %3",
                                                              URL.HidePassword(url),
                                                              error,
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 SourceReportError has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def SourceReportError(source_id, url, error, description)
                                                            Builtins.y2milestone(
                                                              "Source report: error: id: %1, url: %2, error: %3, description: %4",
                                                              source_id,
                                                              URL.HidePassword(url),
                                                      Severity: Minor
                                                      Found in library/packages/src/modules/PackageCallbacks.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 "C" if r == :abort
                                                      Severity: Major
                                                      Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                  return "R" if r == :retry
                                                        Severity: Major
                                                        Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  return "E" if eject_device == ""
                                                          Severity: Major
                                                          Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                    return "R" if r == :retry
                                                            Severity: Major
                                                            Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                        return "I"
                                                              Severity: Major
                                                              Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                          return "I"
                                                                Severity: Major
                                                                Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                        return "I" if r == :ignore
                                                                  Severity: Major
                                                                  Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                            return "S"
                                                                    Severity: Major
                                                                    Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                return "I"
                                                                      Severity: Major
                                                                      Found in library/packages/src/modules/PackageCallbacks.rb - About 30 mins to fix

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

                                                                            def ProgressScanDb(value)
                                                                              if Mode.commandline
                                                                                CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{value}%")
                                                                              elsif @_scan_popup && UI.WidgetExists(Id(:label_scanDB_popup))
                                                                                UI.ChangeWidget(Id(:progress), :Value, value)
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.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

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                            def SetProvideCallbacks
                                                                              Pkg.CallbackStartProvide(
                                                                                fun_ref(method(:StartProvide), "void (string, integer, boolean)")
                                                                              )
                                                                              Pkg.CallbackProgressProvide(
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 55 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2623..2641

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 45.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                            def SetDownloadCallbacks
                                                                              Pkg.CallbackInitDownload(fun_ref(method(:InitDownload), "void (string)"))
                                                                              Pkg.CallbackStartDownload(
                                                                                fun_ref(method(:StartDownload), "void (string, string)")
                                                                              )
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 55 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2720..2746

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 45.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                        Open

                                                                            def SetSourceCreateCallbacks
                                                                              # source create callbacks
                                                                              Pkg.CallbackSourceCreateStart(
                                                                                fun_ref(method(:SourceCreateStart), "void (string)")
                                                                              )
                                                                        Severity: Major
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 2 other locations - About 45 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2680..2701
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2779..2806

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 39.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                        Open

                                                                            def SetSourceReportCallbacks
                                                                              # source report callbacks
                                                                              Pkg.CallbackSourceReportStart(
                                                                                fun_ref(method(:SourceReportStart), "void (integer, string, string)")
                                                                              )
                                                                        Severity: Major
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 2 other locations - About 45 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2656..2677
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2680..2701

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 39.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                        Open

                                                                            def SetSourceProbeCallbacks
                                                                              # source probing callbacks
                                                                              Pkg.CallbackSourceProbeStart(
                                                                                fun_ref(method(:SourceProbeStart), "void (string)")
                                                                              )
                                                                        Severity: Major
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 2 other locations - About 45 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2656..2677
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2779..2806

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 39.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                            def SetHeaderSourcePopup(text)
                                                                              # Qt UI uses bold font, the string must be shortened even more
                                                                              ui_adjustment = textmode ? 0 : 5
                                                                        
                                                                              if Ops.greater_than(
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 35 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1047..1062

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 34.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                            def SetLabelSourcePopup(text)
                                                                              # Qt uses proportional font, the string might be longer
                                                                              ui_adjustment = textmode ? 0 : 6
                                                                        
                                                                              if Ops.greater_than(
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 35 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1030..1044

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 34.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Identical blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                              if Mode.commandline
                                                                                CommandLine.Print(message)
                                                                                CommandLine.Print(URL.HidePassword(url))
                                                                                CommandLine.Print(description)
                                                                        
                                                                        
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 30 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1168..1187

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 33.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Identical blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                              if Mode.commandline
                                                                                CommandLine.Print(message)
                                                                                CommandLine.Print(URL.HidePassword(url))
                                                                                CommandLine.Print(description)
                                                                        
                                                                        
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 30 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1299..1318

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 33.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                                      error_symbol = "ERROR"
                                                                        
                                                                                      # https://github.com/openSUSE/libzypp/blob/8dda46306f06440e1acaefb36fb60f6ce909fd42/zypp/ZYppCallbacks.h#L106
                                                                                      case error
                                                                                      when 2
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 25 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2196..2213

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 30.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                                    error_symbol = "UNKNOWN"
                                                                        
                                                                                    case error
                                                                                    when 0
                                                                                      error_symbol = "NO_ERROR"
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 25 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 343..361

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 30.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Open

                                                                            def SetScanDBCallbacks
                                                                              Pkg.CallbackStartScanDb(fun_ref(method(:StartScanDb), "void ()"))
                                                                              Pkg.CallbackProgressScanDb(
                                                                                fun_ref(method(:ProgressScanDb), "boolean (integer)")
                                                                              )
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 3 other locations - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1998..2008
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2068..2080
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2704..2717

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Identical blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                                  if CommandLine.Interactive
                                                                                    CommandLine.Print("")
                                                                        
                                                                                    # command line mode - ask user whether installation of the failed package should be retried
                                                                                    CommandLine.Print(_("Retry installation of the package?"))
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 528..547

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Open

                                                                            def SetRebuildDBCallbacks
                                                                              Pkg.CallbackStartRebuildDb(fun_ref(method(:StartRebuildDB), "void ()"))
                                                                              Pkg.CallbackProgressRebuildDb(
                                                                                fun_ref(method(:ProgressRebuildDB), "void (integer)")
                                                                              )
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 3 other locations - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2068..2080
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2599..2611
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2704..2717

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Open

                                                                            def SetConvertDBCallbacks
                                                                              Pkg.CallbackStartConvertDb(
                                                                                fun_ref(method(:StartConvertDB), "void (string)")
                                                                              )
                                                                              Pkg.CallbackProgressConvertDb(
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 3 other locations - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1998..2008
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2599..2611
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2704..2717

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Identical blocks of code found in 2 locations. Consider refactoring.
                                                                        Open

                                                                                  if CommandLine.Interactive
                                                                                    CommandLine.Print("")
                                                                        
                                                                                    # command line mode - ask user whether installation of the failed package should be retried
                                                                                    CommandLine.Print(_("Retry installation of the package?"))
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 1 other location - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 286..305

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Open

                                                                            def SetProcessCallbacks
                                                                              # register process callbacks (total progress)
                                                                              Pkg.CallbackProcessStart(
                                                                                fun_ref(method(:ProcessStart), "void (string, list <string>, string)")
                                                                              )
                                                                        Severity: Minor
                                                                        Found in library/packages/src/modules/PackageCallbacks.rb and 3 other locations - About 20 mins to fix
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 1998..2008
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2068..2080
                                                                        library/packages/src/modules/PackageCallbacks.rb on lines 2599..2611

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 27.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        There are no issues that match your filters.

                                                                        Category
                                                                        Status