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|
- Read upRead up
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
- Read upRead up
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?
- Read upRead up
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 || []
- Read upRead up
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?
- Read upRead up
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
- Read upRead up
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 || {}
- Read upRead up
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,
- Read upRead up
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"
Avoid too many return
statements within this method. Open
return "hsi"
Avoid too many return
statements within this method. Open
return "escon"
Avoid too many return
statements within this method. Open
return "wlan"
Avoid too many return
statements within this method. Open
return "modem"
Avoid too many return
statements within this method. Open
return false if !@gui
Avoid too many return
statements within this method. Open
return false if Abort()
Avoid too many return
statements within this method. Open
return "lo"
Avoid too many return
statements within this method. Open
return "atm"
Avoid too many return
statements within this method. Open
return "usb" # #22739
Avoid too many return
statements within this method. Open
return ""
Avoid too many return
statements within this method. Open
return "sit"