yast/yast-yast2

View on GitHub

Showing 967 of 967 total issues

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 singleOptionEditPopup has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def singleOptionEditPopup(option)
          option = deep_copy(option)
          opt_key = Ops.get_string(option, "_cwm_key", "")
          opt_id = Ops.get(option, "_cwm_id")
    
    
    Severity: Major
    Found in library/cwm/src/modules/TablePopup.rb - About 3 hrs to fix

      File Arch.rb has 308 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "yast"
      
      module Yast
        # Representing architecture information yast have.
        #
      Severity: Minor
      Found in library/general/src/modules/Arch.rb - About 3 hrs to fix

        Method CreateAutoStartWidget has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def CreateAutoStartWidget(settings)
              settings = deep_copy(settings)
        
              start_auto_button = Ops.get_locale(
                settings,
        Severity: Major
        Found in library/cwm/src/modules/CWMServiceStart.rb - About 3 hrs to fix

          Method RemoveAllowedPortsOrServices has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def RemoveAllowedPortsOrServices(remove_ports, protocol, zone, check_for_aliases)
                remove_ports = deep_copy(remove_ports)
                if Ops.less_than(Builtins.size(remove_ports), 1)
                  Builtins.y2warning(
                    "Undefined list of %1 services/ports for service",
          Severity: Major
          Found in library/network/src/lib/network/susefirewall.rb - About 3 hrs to fix

            Method DoInstallAndRemoveInt has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def DoInstallAndRemoveInt(toinstall, toremove)
                  toinstall = deep_copy(toinstall)
                  toremove = deep_copy(toremove)
                  Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
                  return false if !PackageLock.Check
            Severity: Major
            Found in library/packages/src/modules/PackageSystem.rb - About 3 hrs to fix

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

                  def startController(controller)
                    controller = deep_copy(controller)
                    # check module information
                    # skip controller if no module info available
              
              
              Severity: Minor
              Found in library/system/src/modules/Hotplug.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 DoInstallAndRemoveInt has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  def DoInstallAndRemoveInt(toinstall, toremove)
                    toinstall = deep_copy(toinstall)
                    toremove = deep_copy(toremove)
                    Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
                    return false if !PackageLock.Check
              Severity: Minor
              Found in library/packages/src/modules/PackageSystem.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 Build has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  def Build(tokens)
                    tokens = deep_copy(tokens)
                    url = ""
                    userpass = ""
              
              
              Severity: Minor
              Found in library/types/src/modules/URL.rb - About 3 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                class CWMServiceStartClass < Module
                  def main
                    Yast.import "UI"
                    textdomain "base"
              
              
              Severity: Minor
              Found in library/cwm/src/modules/CWMServiceStart.rb - About 3 hrs to fix

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

                  class ServiceClass < Module
                    include Yast::Logger
                
                  private
                
                
                Severity: Minor
                Found in library/systemd/src/modules/Service.rb - About 3 hrs to fix

                  File Desktop.rb has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "yast"
                  
                  module Yast
                    class DesktopClass < Module
                      def main
                  Severity: Minor
                  Found in library/desktop/src/modules/Desktop.rb - About 3 hrs to fix

                    Method InterfacesValidate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def InterfacesValidate(_widget, _key, _event)
                          trusted_zone = firewalld.find_zone("trusted")
                    
                          ifaces = Convert.convert(
                            UI.QueryWidget(Id("_cwm_interface_list"), :SelectedItems),
                    Severity: Major
                    Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 3 hrs to fix

                      Method ImportGPGKeyIntoTrustedDialog has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def ImportGPGKeyIntoTrustedDialog(key, repository)
                            key = deep_copy(key)
                            # additional Richtext (HTML) warning text (kind of help), 1/2
                            warning_text = _(
                              "<p>The owner of the key may distribute updates,\n" \
                      Severity: Major
                      Found in library/packages/src/modules/SignatureCheckDialogs.rb - About 3 hrs to fix

                        Method Parse has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def Parse(url)
                              Builtins.y2debug("url=%1", url)
                        
                              # We don't parse empty URLs
                              return {} if url.nil? || Ops.less_than(Builtins.size(url), 1)
                        Severity: Major
                        Found in library/types/src/modules/URL.rb - About 3 hrs to fix

                          Method Read has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def Read(values_to_parse)
                                values_to_parse = deep_copy(values_to_parse)
                                extract_desktop_filename = lambda do |fullpath|
                                  path_components = Builtins.splitstring(fullpath, "/")
                                  filename = Ops.get(
                          Severity: Major
                          Found in library/desktop/src/modules/Desktop.rb - About 3 hrs to fix

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

                                def Start(widget, data)
                                  widget = deep_copy(widget)
                                  data = deep_copy(data)
                                  if !@id.nil?
                                    SCR.Execute(path(".process.release"), @id)
                            Severity: Minor
                            Found in library/log/src/modules/LogViewCore.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 Run has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def Run(aliases, sequence)
                                  aliases = deep_copy(aliases)
                                  sequence = deep_copy(sequence)
                                  # Check aliases and sequence correctness
                                  return Convert.to_symbol(WS_error("CHECK FAILED")) if @docheck && WS_check(aliases, sequence) != true
                            Severity: Minor
                            Found in library/sequencer/src/modules/Sequencer.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 WriteConfiguration has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def WriteConfiguration
                                  # just disabled
                                  return true if !SuSEFirewallIsInstalled()
                            
                                  # Progress only for normal configuration and command line
                            Severity: Minor
                            Found in library/network/src/lib/network/susefirewall2.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 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

                            Severity
                            Category
                            Status
                            Source
                            Language