Showing 806 of 967 total issues
Avoid deeply nested control flow statements. Open
ret = nil unless functions[:abort].call
Method PrepareScripts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def PrepareScripts(workflow)
workflow = deep_copy(workflow)
tmp_dir = Convert.to_string(WFM.Read(path(".local.tmpdir"), []))
if Builtins.haskey(workflow, "prescript")
interpreter = Ops.get_string(workflow, ["prescript", "interpreter"], "shell")
- 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 ValidateValueType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ValidateValueType(key, value, widget, popup)
value = deep_copy(value)
success = true
if popup
case 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
Avoid deeply nested control flow statements. Open
tableEntryChanged(opt_id, option_map) ? "*" : ""
Method MergeProposal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def MergeProposal(base, additional_control, prod_name, domain)
base = deep_copy(base)
additional_control = deep_copy(additional_control)
# Additional proposal settings - Replacing items
replaces = Builtins.listmap(
- 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 MergeWorkflows
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def MergeWorkflows
Builtins.y2milestone("Merging additional control files from scratch...")
@unmerged_changes = false
# Init the Base Workflow 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 LazyLoadCurrentConf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def LazyLoadCurrentConf
if !@already_read
if FileUtils.Exists(@conf_file) && FileUtils.IsFile(@conf_file)
Builtins.y2milestone("Reading %1 file", @conf_file)
# Read and evaluate the current configuration
- 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 anyTimedMessageTypeInternal
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def anyTimedMessageTypeInternal(headline, message, timeout, richtext, width, height)
Method handle_event
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_event(res, details, remaining_time, focus)
case res
when :__details
show(details)
nil
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds)
Method plain_text
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plain_text(tags: nil, replacements: nil, &block)
regex = tags ? Regexp.union(tags.map { |t| /<[^>]*#{t}[^>]*>/i }) : /<.+?>/
replacements ||= Refinements::DEFAULT_HTML_TAGS_REPLACEMENTS
result = gsub(regex) do |match|
- 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 EditTable
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def EditTable(table_header, table_contents, above_table, below_table, below_buttons, buttons)
Method TimedErrorAnyQuestion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def TimedErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds)
Method wrap_text
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wrap_text(line_width = 76, n_lines: nil, cut_text: "")
return self if line_width > length
wrapped_text = lines.collect! do |line|
l = (line.length > line_width) ? line.gsub(/(.{1,#{line_width}})(?:\s+|$)/, "\\1\n") : 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 anyMessageDetailsInternalType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def anyMessageDetailsInternalType(headline, message, details, richtext, width, height)
button_box = ButtonBox(
PushButton(Id(:ok_msg), Opt(:default, :okButton), Label.OKButton),
# FIXME: BNC #422612, Use `opt(`noSanityCheck) later
# button label
- 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 anyMessageDetailsInternalType
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def anyMessageDetailsInternalType(headline, message, details, richtext, width, height)
Method AssertLineValid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def AssertLineValid(file, line)
if Builtins.haskey(Ops.get_map(file.value, "l", {}), line) &&
Ops.get_boolean(file.value, ["l", line, "buildline"], false)
delim = Builtins.substring(
Ops.get_string(file.value, "delim", " "),
- 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
minimum_step = Ops.add(minimum_step, 1) if Ops.less_or_equal(@current_step, minimum_step) && !allow_back
Method AnyQuestion3
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus)
Avoid deeply nested control flow statements. Open
str = CutBlanks(str) if remove_whitespace