yast/yast-network

View on GitHub

Showing 218 of 255 total issues

Avoid too many return statements within this method.
Open

          return ""
Severity: Major
Found in src/include/network/routines.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return "ib" if Ops.get_integer(hwdevice, "class_id", -1) == 12 && (subclass_id == 6)
    Severity: Major
    Found in src/include/network/routines.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return "dsl"
      Severity: Major
      Found in src/include/network/routines.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return false if Abort()
        Severity: Major
        Found in src/modules/Lan.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false if !@gui
          Severity: Major
          Found in src/modules/Lan.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                      return "ctc"
            Severity: Major
            Found in src/include/network/routines.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                        return "escon"
              Severity: Major
              Found in src/include/network/routines.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return false
                Severity: Major
                Found in src/lib/y2network/widgets/boot_protocol.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                            return false
                  Severity: Major
                  Found in src/lib/y2network/widgets/boot_protocol.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                              return false
                    Severity: Major
                    Found in src/lib/y2network/interface_config_builders/bridge.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                return false
                      Severity: Major
                      Found in src/lib/y2network/interface_config_builders/bridge.rb - About 30 mins to fix

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

                            def needed_modules(netcards_hwinfo)
                              netcards_hwinfo.each_with_object([]) do |h, modules|
                                name = h.fetch("module", "")
                                next if name.empty?
                        
                        
                        Severity: Minor
                        Found in src/modules/NetHwDetection.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

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

                            def AddHandler(options)
                              # slaves option is marked as obsolete, bond_ports should be used instead.
                              # If both options are present, new one (bond_ports) wins.
                              if !options.key?("bond_ports") && options.key?("slaves")
                                options["bond_ports"] = options.delete("slaves")
                        Severity: Minor
                        Found in src/include/network/lan/cmdline.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

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

                            def ensure_network_running
                              network = false
                              timeout = NM_DHCP_TIMEOUT
                              while timeout > 0
                                if NetworkService.isNetworkRunning
                        Severity: Minor
                        Found in src/modules/Lan.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

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

                            def encode_hosts_line(canonical, aliases)
                              encoded_aliases = aliases ? Punycode.EncodePunycodes(aliases) : []
                              encoded_canonical = canonical ? Punycode.EncodeDomainName(canonical) : ""
                        
                              encoded = ""
                        Severity: Minor
                        Found in src/include/network/services/host.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

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

                            def HardwareName(hardware, id)
                              return "" if id.nil? || id.empty?
                              return "" if hardware.nil? || hardware.empty?
                        
                              # filter out a list of hwinfos which correspond to the given id
                        Severity: Minor
                        Found in src/include/network/complex.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

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

                            def Modified
                              return true if @modified
                              return true unless system_config == yast_config
                              return true if NetworkConfig.Modified
                              return true if NetworkService.Modified
                        Severity: Minor
                        Found in src/modules/Lan.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

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

                            def AddressDialog(builder:)
                              ret = Y2Network::Dialogs::EditInterface.run(builder)
                        
                              log.info "AddressDialog res: #{ret.inspect}"
                        
                        
                        Severity: Minor
                        Found in src/include/network/lan/address.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

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

                              def config
                                configs = @section.interfaces.map do |interface_section|
                                  log.info "Creating config for interface section: #{interface_section.inspect}"
                                  config = create_config(interface_section)
                                  config.propose # propose reasonable defaults for not set attributes
                        Severity: Minor
                        Found in src/lib/y2network/autoinst/interfaces_reader.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

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

                              def handle(event)
                                return nil if event["EventReason"] != "Activated"
                        
                                cur = Yast::UI.QueryWidget(Id(:address_table), :CurrentItem).to_i
                                case event["ID"]
                        Severity: Minor
                        Found in src/lib/y2network/widgets/additional_addresses.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

                        Severity
                        Category
                        Status
                        Source
                        Language