Showing 806 of 967 total issues
Avoid too many return
statements within this method. Open
return true if ip.start_with?("203.0.113.")
Avoid too many return
statements within this method. Open
return true if private_network?(ip)
Avoid too many return
statements within this method. Open
return true if ip.start_with?("192.88.99.")
Method CheckFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CheckFiles(files)
files = deep_copy(files)
files = Builtins.filter(files) { |f| FileChanged(f) }
return true unless Ops.greater_than(Builtins.size(files), 0)
- 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 create_snapshot?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_snapshot?(snapshot_type)
disable_snapshots = Yast::Linuxrc.value_for(Yast::LinuxrcClass::DISABLE_SNAPSHOTS)
# Feature is not defined on Linuxrc commandline
return true if disable_snapshots.nil? || disable_snapshots.empty?
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def Save(force)
# make module names to one long string
# start with modules from linuxrc
# write module options to modules.conf, mk_initrd handles the rest
- 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 SetContentsButtons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def SetContentsButtons(title, contents, help_text, back_label, next_label)
contents = deep_copy(contents)
UI.PostponeShortcutCheck
RestoreBackButton()
- 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 CanonicalizeIP
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CanonicalizeIP(ifcfg)
ifcfg = deep_copy(ifcfg)
return nil if ifcfg.nil?
ipaddr, prefixlen = ifcfg["IPADDR"].to_s.split("/")
- 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 memory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.memory
memory = Yast::SCR.Read(Yast::Path.new(".probe.memory"))
log.debug("hwinfo memory: #{memory}")
raise "Memory detection failed" unless memory
- 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 detect_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def detect_type(text, children, node)
# backward compatibility. Newly maps should have its type
if text.empty? && !children.empty?
"map"
elsif (!text.empty? && children.empty?) ||
- 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 parseKeys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parseKeys(input)
# NOTE: see /usr/share/doc/packages/gpg/DETAILS for another way
ret = []
lines = Builtins.splitstring(input, "\n")
- 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 from_methods
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_methods(sequence_hash)
sequence_hash.keys.map do |name|
next nil if name == START
if self.class.skip_stack?(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 CreateTreeInternal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CreateTreeInternal(tree, parent)
tree = deep_copy(tree)
m = Builtins.filter(tree) do |c|
Ops.get_string(c, "parent", "") == parent
end
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(xml, schema)
xml = SCR.Read(path(".target.string"), xml.to_s) if xml.is_a?(Pathname)
if schema.is_a?(::String)
validator = Nokogiri::XML::RelaxNG(schema)
else
- 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 prepareVendorDeviceInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepareVendorDeviceInfo(controller)
controller = deep_copy(controller)
# build up vendor/device information
# if vendor not given, try sub_vendor
- 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 ShowReleaseNotesButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ShowReleaseNotesButton(label, id)
# has wizard? continue
# otherwise use dedicated ReplacePoint or reuse the back button
# show-releasenotes-button failed? continue
# use dedicated ReplacePoint or reuse the back button
- 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 GetTypeFromSysfs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def GetTypeFromSysfs(dev)
sys_dir_path = Builtins.sformat("/sys/class/net/%1", dev)
sys_type_path = Builtins.sformat("%1/type", sys_dir_path)
return nil if IsEmpty(dev) || !FileUtils.Exists(sys_type_path)
- 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 remove_port
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_port(port_or_range, protocol, interface)
return false unless valid_port?(port_or_range)
return false unless supported_protocol?(protocol)
zone = interface_zone(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 apply_changes!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_changes!
return true unless modified?
apply_relations_changes!
apply_attributes_changes!
- 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 enable_modifications_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enable_modifications_cache
# Return an array with all the modified attributes/relations
define_method "modified" do
@modified ||= []
end
- 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"