Showing 806 of 967 total issues
Method GetMenuButtonWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GetMenuButtonWidget(actions, save, mb_label)
actions = deep_copy(actions)
menubutton = []
if save
# menubutton entry
- 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 deeply nested control flow statements. Open
if firstspace.nil?
modulename = module_data
moduleargs = ""
else
modulename = Builtins.substring(module_data, 0, firstspace)
Method RunDepmod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def RunDepmod(force)
Yast.import "Kernel"
kernel_version = Convert.to_string(
SCR.Read(
- 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 deeply nested control flow statements. Open
command << Builtins.sformat(" | tail -n +%1", lines_count.to_s.shellescape) if Ops.greater_than(lines_count, 0)
Method New
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def New(window_title, progress_title, length, stg, tits, help_text)
Method Load
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Load(modulename, moduleargs, vendorname, devicename, ask_before_loading, with_modprobe)
Method FileChangedFromPackage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def FileChangedFromPackage(file)
# queryformat: no trailing newline!
cmd = Builtins.sformat(
"/usr/bin/rpm -qf %1 --qf %%{NAME}-%%{VERSION}-%%{RELEASE}",
file.shellescape
- 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 OpenFirewallHandle
has a Cognitive Complexity of 8 (exceeds 5 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"
- 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 deeply nested control flow statements. Open
module_data = Builtins.substring(module_data, firstspace) if !firstspace.nil?
Method SetContentsFocus
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def SetContentsFocus(title, contents, help_text, has_back, has_next, set_focus)
Method GetTypeFromIfcfg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GetTypeFromIfcfg(ifcfg)
ifcfg = deep_copy(ifcfg)
type = nil
return nil if IsEmpty(ifcfg)
- 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 SignFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def SignFile(keyid, file, passphrase, ascii_signature)
if passphrase.nil? || keyid.nil? || keyid == "" || file.nil? ||
file == ""
Builtins.y2error(
"Invalid parameters: keyid: %1, file: %2, passphrase: %3",
- 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 deeply nested control flow statements. Open
lines_count = 0 if Ops.less_than(lines_count, 0)
Method LogHandle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def LogHandle(_key, event)
event = deep_copy(event)
@param = CWM.GetProcessedWidget
LogViewCore.Update(Id(:_cwm_log))
ret = Ops.get(event, "ID")
- 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 CreateOpenFirewallWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def CreateOpenFirewallWidget(settings)
settings = deep_copy(settings)
services = adapt_settings_services!(settings)
- 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 AddServiceSupportIntoZone
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def AddServiceSupportIntoZone(service, zone)
Yast.import "SuSEFirewallServices" # lazy import due to circular dependencies
needed = SuSEFirewallServices.GetNeededPortsAndProtocols(service)
# unknown service
- 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 deeply nested control flow statements. Open
if SuSEFirewall.HaveService(one_port, "TCP", zone) != true
set_vnc_enabled_to = false
raise Break
end
Method SetServicesForZones
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def SetServicesForZones(services_ids, firewall_zones, new_status)
# setting for each service
Builtins.foreach(services_ids) do |service_id|
Builtins.foreach(firewall_zones) do |firewall_zone|
# zone must be known one
- 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 AddForwardIntoMasqueradeRule
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def AddForwardIntoMasqueradeRule(source_net, forward_to_ip, protocol, req_port, redirect_to_port, requested_ip)
Method SetFirewallKernelModules
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def SetFirewallKernelModules(k_modules)
k_modules = deep_copy(k_modules)
k_modules = Builtins.filter(k_modules) do |one_module|
if one_module.nil?
Builtins.y2error(
- 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"