Showing 806 of 967 total issues
Method CheckAndCreatePath
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CheckAndCreatePath(pathvalue)
check_path = pathvalue
# remove the final slash
# but never the last one "/"
Method Stage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def Stage(stage, title, step)
return if !@visible
Step(step) if -1 != step
- 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 SetContentsFocus
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def SetContentsFocus(title, contents, help_text, has_back, has_next, set_focus)
contents = deep_copy(contents)
if UI.WizardCommand(term(:SetDialogHeading, title)) == true
UI.WizardCommand(term(:SetHelpText, help_text))
UI.WizardCommand(term(:EnableNextButton, has_next))
- 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 Start
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def Start(log)
if (@type == "dsl" && @capi_adsl) || @type == "isdn"
status = Service.Status("isdn")
Builtins.y2milestone("We need ISDN service, status: %1", status)
if status != 0 && !Service.Start("isdn")
- 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 RemovePortFromPortRanges
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def RemovePortFromPortRanges(port_number, port_ranges)
port_ranges = deep_copy(port_ranges)
# Checking necessarity of filtering and params
return deep_copy(port_ranges) if port_ranges.nil? || port_ranges == []
return deep_copy(port_ranges) if port_number.nil? || port_number == 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 sanitize_services_and_ports
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def sanitize_services_and_ports(allowed_services, protocol)
services = []
ports = []
allowed_services.each do |s|
Builtins.y2debug("Examining %1", s)
- 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 ValidateMaps
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ValidateMaps(widgets)
widgets = deep_copy(widgets)
ret = true
Builtins.foreach(widgets) do |k, v|
Builtins.foreach(v) do |kk, vv|
- 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 ProgressStart
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ProgressStart(id, task, in_percent, is_alive, _min, _max, _val_raw, val_percent)
Builtins.y2milestone("ProgressStart: %1", id)
@tick_progress = is_alive
@val_progress = !in_percent && !is_alive
- 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 GetSlideList
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def GetSlideList(lang)
slide_list = nil
txt_path = Builtins.sformat("%1/txt/%2", @slide_base_path, lang)
if FileUtils.Exists(txt_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 PrintGeneralHelp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def PrintGeneralHelp
# display custom defined help instead of generic one
if Builtins.haskey(@modulecommands, "customhelp")
Print(Ops.get_string(@modulecommands, "customhelp", ""))
return
- 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 CreateTableDescr
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def CreateTableDescr(attrib, widget_descr)
attrib = deep_copy(attrib)
widget_descr = deep_copy(widget_descr)
ValidateTableAttr(attrib)
- 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 PrintTable
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def PrintTable(header, content)
header = deep_copy(header)
content = deep_copy(content)
aligns = []
widths = []
- 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 UpdateProposals
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def UpdateProposals(proposals, prod_name, domain)
proposals = deep_copy(proposals)
Builtins.foreach(proposals) do |proposal|
name = Ops.get_string(proposal, "name", "")
stage = Ops.get_string(proposal, "stage", "")
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def Run(settings)
settings = deep_copy(settings)
screens = Ops.get_map(settings, "screens", {})
widget_descr = Ops.get_map(settings, "widget_descr", {})
initial_screen = Ops.get_string(settings, "initial_screen", "")
- 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_start_mode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def save_start_mode
return unless changed?(:start_mode)
result =
case changes[:start_mode]
- 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 TimedAnyQuestion
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds)
button_box = AnyQuestionButtonBox(
yes_button_message,
no_button_message,
focus
- 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 Parse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def Parse(url)
Builtins.y2debug("url=%1", url)
# We don't parse empty URLs
return {} if url.nil? || Ops.less_than(Builtins.size(url), 1)
- 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 reserved4
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def reserved4(ip)
raise "Invalid IP address passed '#{ip}'" unless Check4(ip)
# RFC#1700
return true if ip.start_with?("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 Display
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Display(parameters)
parameters = deep_copy(parameters)
@param = deep_copy(parameters)
# menubutton
Method Read
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Read
# Do not read it again and again
# to avoid rewriting changes already made
if @configuration_has_been_read
Builtins.y2milestone(