yast/yast-network

View on GitHub

Showing 218 of 255 total issues

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

        def write_wep_auth_settings(conn)
          file.wifi_security["key-mgmt"] = "none"
          default_key_idx = conn.default_key || 0
          file.wifi_security["wep-tx-keyidx"] = default_key_idx.to_s if !default_key_idx.zero?
          conn.keys.each_with_index do |v, i|
Severity: Minor
Found in src/lib/y2network/network_manager/connection_config_writers/wireless.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 write has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def write(conn, opts = {})
          file.connection["id"] = conn.name
          file.connection["autoconnect"] = "false" if ["manual", "off"].include? conn.startmode.name
          file.connection["permissions"] = nil
          file.connection["interface-name"] = conn.interface
Severity: Minor
Found in src/lib/y2network/network_manager/connection_config_writers/base.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 possible_vlans has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def possible_vlans
        yast_config.interfaces.to_a.each_with_object({}) do |interface, result|
          next if interface.type.vlan? # does not make sense to have vlan of vlan

          result[interface.name] = if interface.hardware && interface.hardware.present?
Severity: Minor
Found in src/lib/y2network/interface_config_builders/vlan.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 handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def handle(event)
        if event["EventReason"] == "SelectionChanged"
          enable_position_buttons
        elsif event["EventReason"] == "Activated" && event["WidgetClass"] == :PushButton
          items = ui_items || []
Severity: Minor
Found in src/lib/y2network/widgets/bond_port.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        ret = super
        if ret == :next
          _stdout, stderr, status = activator.configure
          configured = status.zero?
Severity: Minor
Found in src/lib/y2network/dialogs/s390_device_activation.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 find_handler_class has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def find_handler_class(type)
        return unless type

        if !type.is_a?(InterfaceType)
          t = InterfaceType.from_short_name(type) or
Severity: Minor
Found in src/lib/y2network/wicked/connection_config_reader.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 to_hashes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def to_hashes
        result = {}
        result["dns"] = dns&.to_hashes || {}
        unless managed
          result["routing"] = routing&.to_hashes || {}
Severity: Minor
Found in src/lib/y2network/autoinst_profile/networking_section.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 handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def handle
        return nil unless connection_config # unconfigured physical device. Delete do nothing

        if connection_config.startmode.name == "nfsroot" && !Yast::Popup.YesNoHeadline(
          Yast::Label.WarningMsg,
Severity: Minor
Found in src/lib/y2network/widgets/delete_interface.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 "wlan"
Severity: Major
Found in src/include/network/routines.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return "hsi"
    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 "wlan"
        Severity: Major
        Found in src/include/network/routines.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return "modem"
          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 !@gui
            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 Abort()
              Severity: Major
              Found in src/modules/Lan.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

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

                    Avoid too many return statements within this method.
                    Open

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

                      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 "sit"
                        Severity: Major
                        Found in src/include/network/routines.rb - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language