yast/yast-yast2

View on GitHub

Showing 806 of 967 total issues

Method FindBaseProducts has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def FindBaseProducts
      return unless load_zypp

      log.info "Looking for base products"

Severity: Minor
Found in library/packages/src/modules/Product.rb - About 1 hr to fix

    Method DisableAllModulesAndProposals has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def DisableAllModulesAndProposals(mode, stage)
          this_workflow = { "mode" => mode, "stage" => stage }
    
          if Builtins.contains(@already_disabled_workflows, this_workflow)
            Builtins.y2milestone("Workflow %1 already disabled", this_workflow)
    Severity: Minor
    Found in library/control/src/modules/ProductControl.rb - About 1 hr to fix

      Method ShowTextTimed has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def ShowTextTimed(headline, text, timeout)
            heading = if Builtins.size(headline) == 0
              VSpacing(0.2)
            else
              Heading(headline)
      Severity: Minor
      Found in library/general/src/modules/Popup.rb - About 1 hr to fix

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

            def main
              textdomain "base"
        
              Yast.import "Hostname"
              Yast.import "String"
        Severity: Minor
        Found in library/types/src/modules/URL.rb - About 1 hr to fix

          Method parse_key has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse_key(lines)
                lines = deep_copy(lines)
                ret = {}
          
                Builtins.foreach(lines) do |line|
          Severity: Minor
          Found in library/gpg/src/modules/GPG.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 adapt_old_config! has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def adapt_old_config!
                @Devices.each do |devtype, devices|
                  devices.each do |device, config|
                    bootproto = config["BOOTPROTO"] || "static"
                    next unless bootproto == "static" && config["IPADDR"] == "0.0.0.0"
          Severity: Minor
          Found in library/network/src/modules/NetworkInterfaces.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 initialize_zones has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

                def initialize_zones
                  zone_entries.each_with_object([]) do |(name, config), zones|
                    zone = Zone.new(name: name)
                    zones << zone
          
          
          Severity: Minor
          Found in library/network/src/lib/y2firewall/firewalld/zone_reader.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 read_zones has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def read_zones
                # Get all the information from zones and load them to @SETTINGS["zones"]
                # The following may seem somewhat complicated or fragile but it is more
                # efficient to only invoke a single firewall-cmd command instead of
                # iterating over the zones and then using all the different
          Severity: Minor
          Found in library/network/src/lib/network/susefirewalld.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 Check has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def Check
                # we already have a lock
                return @have_lock if !@have_lock.nil?
          
                # just to allow 'Retry', see more in bug #280383
          Severity: Minor
          Found in library/packages/src/modules/PackageLock.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 Setup has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def Setup(stages)
                stages = deep_copy(stages)
                log.info "SlideShow stages: #{stages}"
                # initiliaze the generic counters
                Reset()
          Severity: Minor
          Found in library/packages/src/modules/SlideShow.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 prepareWidget has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def prepareWidget(widget_descr)
                widget_descr = deep_copy(widget_descr)
                w = deep_copy(widget_descr)
                widget = Ops.get_symbol(w, "widget", :inputfield)
          
          
          Severity: Minor
          Found in library/cwm/src/modules/CWM.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 SaveInstallInf has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def SaveInstallInf(root)
                if Stage.initial && !Mode.test
                  inst_if_file = "/etc/install.inf"
          
                  if !root.nil? && root != "" && root != "/"
          Severity: Minor
          Found in library/general/src/modules/Linuxrc.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 CheckAndCreatePath has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def CheckAndCreatePath(pathvalue)
                check_path = pathvalue
          
                # remove the final slash
                # but never the last one "/"
          Severity: Minor
          Found in library/general/src/modules/FileUtils.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 Initialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def Initialize
                @_mode = "normal"
                @_test = "none"
                arg_count = Builtins.size(WFM.Args)
                arg_no = 0
          Severity: Minor
          Found in library/general/src/modules/Mode.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 ReadLocalizedKey has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def ReadLocalizedKey(fname, keypath, key)
                return Convert.to_string(SCR.Read(Builtins.add(keypath, key))) if key != "Name" && key != "GenericName" && key != "Comment"
          
                ret = ""
                fallback = Convert.to_string(SCR.Read(Builtins.add(keypath, key)))
          Severity: Minor
          Found in library/desktop/src/modules/Desktop.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 OpenFirewallHandle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def OpenFirewallHandle(widget, _key, event)
                widget = deep_copy(widget)
                event = deep_copy(event)
                event_id = Ops.get(event, "ID")
                if event_id == "_cwm_firewall_details"
          Severity: Minor
          Found in library/network/src/modules/CWMFirewallInterfaces.rb - About 1 hr to fix

            Method RunPackageSelector has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def RunPackageSelector(options)
                  options = deep_copy(options)
                  Builtins.y2milestone("Called RunPackageSelector(%1)", options)
            
                  enable_repo_mgr = Ops.get_boolean(options, "enable_repo_mgr")
            Severity: Minor
            Found in library/packages/src/modules/PackagesUI.rb - About 1 hr to fix

              Method ValidateValueType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def ValidateValueType(key, value, widget)
                    types = {
                      # general
                      "widget"        => "symbol",
                      "custom_widget" => "term",
              Severity: Minor
              Found in library/cwm/src/modules/CWM.rb - About 1 hr to fix

                Method StartStopHandle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def StartStopHandle(widget, _key, event)
                      widget = deep_copy(widget)
                      event = deep_copy(event)
                      event_id = Ops.get(event, "ID")
                      case event_id
                Severity: Minor
                Found in library/cwm/src/modules/CWMServiceStart.rb - About 1 hr to fix

                  Method CreateWidget has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def CreateWidget(parameters, log_files)
                        parameters = deep_copy(parameters)
                        log_files = deep_copy(log_files)
                        # logview caption
                        caption = Ops.get_locale(@param, "log_label", _("&Log"))
                  Severity: Minor
                  Found in library/log/src/modules/LogView.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language