Showing 806 of 967 total issues
Method validateWidget
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validateWidget(widget, event, key)
widget = deep_copy(widget)
event = deep_copy(event)
self.processed_widget = deep_copy(widget)
failed = false
Method DisableAllModulesAndProposals
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DisableAllModulesAndProposals(mode, stage)
this_workflow = { "mode" => mode, "stage" => stage }
if Builtins.contains(@already_disabled_workflows, this_workflow)
Builtins.y2milestone("Workflow %1 already disabled", this_workflow)
Method ShowTextTimed
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ShowTextTimed(headline, text, timeout)
heading = if Builtins.size(headline) == 0
VSpacing(0.2)
else
Heading(headline)
Method main
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
textdomain "base"
Yast.import "Hostname"
Yast.import "String"
Method parse_key
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parse_key(lines)
lines = deep_copy(lines)
ret = {}
Builtins.foreach(lines) do |line|
- 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 adapt_old_config!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def adapt_old_config!
@Devices.each do |devtype, devices|
devices.each do |device, config|
bootproto = config["BOOTPROTO"] || "static"
next unless bootproto == "static" && config["IPADDR"] == "0.0.0.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 Check
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def Check
# we already have a lock
return @have_lock if !@have_lock.nil?
# just to allow 'Retry', see more in bug #280383
- 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 read_zones
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def read_zones
# Get all the information from zones and load them to @SETTINGS["zones"]
# The following may seem somewhat complicated or fragile but it is more
# efficient to only invoke a single firewall-cmd command instead of
# iterating over the zones and then using all the different
- 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_zones
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize_zones
zone_entries.each_with_object([]) do |(name, config), zones|
zone = Zone.new(name: name)
zones << zone
- 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 Setup
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def Setup(stages)
stages = deep_copy(stages)
log.info "SlideShow stages: #{stages}"
# initiliaze the generic counters
Reset()
- 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 prepareWidget
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def prepareWidget(widget_descr)
widget_descr = deep_copy(widget_descr)
w = deep_copy(widget_descr)
widget = Ops.get_symbol(w, "widget", :inputfield)
- 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 CheckAndCreatePath
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def CheckAndCreatePath(pathvalue)
check_path = pathvalue
# remove the final slash
# but never the last 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 SaveInstallInf
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def SaveInstallInf(root)
if Stage.initial && !Mode.test
inst_if_file = "/etc/install.inf"
if !root.nil? && root != "" && root != "/"
- 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
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def Initialize
@_mode = "normal"
@_test = "none"
arg_count = Builtins.size(WFM.Args)
arg_no = 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 ReadLocalizedKey
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def ReadLocalizedKey(fname, keypath, key)
return Convert.to_string(SCR.Read(Builtins.add(keypath, key))) if key != "Name" && key != "GenericName" && key != "Comment"
ret = ""
fallback = Convert.to_string(SCR.Read(Builtins.add(keypath, key)))
- 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 39 lines of code (exceeds 25 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"
Method RunPackageSelector
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def RunPackageSelector(options)
options = deep_copy(options)
Builtins.y2milestone("Called RunPackageSelector(%1)", options)
enable_repo_mgr = Ops.get_boolean(options, "enable_repo_mgr")
Method StartStopHandle
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def StartStopHandle(widget, _key, event)
widget = deep_copy(widget)
event = deep_copy(event)
event_id = Ops.get(event, "ID")
case event_id
Method ValidateValueType
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ValidateValueType(key, value, widget)
types = {
# general
"widget" => "symbol",
"custom_widget" => "term",
Method CreateWidget
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateWidget(parameters, log_files)
parameters = deep_copy(parameters)
log_files = deep_copy(log_files)
# logview caption
caption = Ops.get_locale(@param, "log_label", _("&Log"))