Showing 218 of 255 total issues
Method ControllerType
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ControllerType(hwdevice)
hwdevice = deep_copy(hwdevice)
return "modem" if Ops.get_string(hwdevice, "subclass", "") == "Modem"
return "isdn" if Ops.get_string(hwdevice, "subclass", "") == "ISDN"
return "dsl" if Ops.get_string(hwdevice, "subclass", "") == "DSL"
- 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 load_wireless
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_wireless(config, interface_section)
if !interface_section.wireless_mode.to_s.empty?
config.mode = interface_section.wireless_mode
end
config.ap = interface_section.wireless_ap if !interface_section.wireless_ap.to_s.empty?
Method cmdline_definition
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmdline_definition
{
# Commandline help title
"help" => _("DNS Configuration"),
"id" => "dns",
Method PackagesInstall
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def PackagesInstall(packages)
packages = deep_copy(packages)
return :next if packages == []
log.info "Checking packages: #{packages}"
- 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 initialize_network_lan_dhcp
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_network_lan_dhcp(include_target)
Yast.import "UI"
textdomain "network"
Method load_generic
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_generic(config, interface_section)
if interface_section.bootproto.to_s.empty?
issues_list.add(::Installation::AutoinstIssues::MissingValue,
interface_section, :bootproto)
else
Method init_from_config
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def init_from_config(config)
# nil bootproto is valid use case (missing explicit setup) - wicked defaults to static then
@bootproto = config.bootproto&.name
@name = config.name
@lladdr = config.lladdress
- 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 validate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate
return true if value != :bootproto_static
ipa = Yast::UI.QueryWidget(:bootproto_ipaddr, :Value)
if !Yast::IP.Check(ipa)
Method MainDialog
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def MainDialog(init_tab)
caption = _("Network Settings")
widget_descr = {
"tab" => CWMTab.CreateWidget(
"tab_order" => if Systemd.Running
Method adapt_for_autoyast
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def adapt_for_autoyast(settings)
settings = deep_copy(settings)
interfaces = settings["interfaces"] || []
log.info("interfaces: #{interfaces.inspect}")
net_udev = settings["net-udev"] || []
Method init
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init
case @settings.boot_protocol
when Y2Network::BootProtocol::STATIC
Yast::UI.ChangeWidget(Id(:bootproto), :CurrentButton, :bootproto_static)
Yast::UI.ChangeWidget(
Method IsHostLocal
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def IsHostLocal(check_host)
Read()
current_dhcp_data = {}
connections = Yast::Lan.yast_config.connections
- 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 save
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def save
@connection_config.name = name
@connection_config.interface = name
@connection_config.ip_aliases = aliases_to_ip_configs
- 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 init_from_config
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_from_config(config)
# nil bootproto is valid use case (missing explicit setup) - wicked defaults to static then
@bootproto = config.bootproto&.name
@name = config.name
@lladdr = config.lladdress
Method contents
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def contents
type = @settings.type
drvtype = driver_type(type.short_name)
# TODO: check if this kind of device is still valid and used
Method main
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
textdomain "network"
Method store
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def store
# FIXME: this value reset should be in backend in general not Yast::UI responsibility
@settings.ip_address = ""
@settings.subnet_prefix = ""
case value
Method help
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def help
# tricky init only to not break long help text translations
items_help =
[
# TRANSLATORS: help text for Device Activation
Method ListHandler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def ListHandler(options)
config = Yast::Lan.yast_config
CommandLine.Print("id\tname\tbootproto")
config.interfaces.to_a.each_with_index do |interface, index|
connection = config.connections.by_name(interface.name)
- 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 propose_startmode
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def propose_startmode
Yast.import "ProductFeatures"
if root_filesystem_in_network?
log.info "startmode nfsroot"
- 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"