Showing 806 of 967 total issues
Method StoreWorkflowFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def StoreWorkflowFile(file_from, file_to)
if file_from.nil? || file_from == "" || file_to.nil? || file_to == ""
Builtins.y2error("Cannot copy '%1' to '%2'", file_from, file_to)
return nil
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 updateOptionMap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def updateOptionMap(opt_descr, fallbacks)
opt_descr = deep_copy(opt_descr)
fallbacks = deep_copy(fallbacks)
# ensure that the submaps exist
Ops.set(opt_descr, "table", Ops.get_map(opt_descr, "table", {}))
- 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 event_loop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def event_loop(content, focus, timeout, details, style)
res = Yast::UI.OpenDialog(dialog_options(style), content)
raise "Failed to open dialog, see logs." unless res
begin
- 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 GetBooleanFeatureWithFallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def GetBooleanFeatureWithFallback(section, feature, fallback)
value = GetFeature(section, feature)
return fallback if value.nil?
return value if Ops.is_boolean?(value)
- 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 AnyQuestionRichText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def AnyQuestionRichText(headline, richtext, hdim, vdim, yes_button_message, no_button_message, focus)
yes_button = PushButton(
Id(:ok),
if focus == :focus_yes
Opt(:default, :key_F10, :okButton)
- 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 Image
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Image(icon_type, options)
options = deep_copy(options)
LazyInit()
return Empty() if !@has_image_support
- 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 MergeURLs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def MergeURLs(url_base, url_with_modifs)
if url_base.nil? || url_with_modifs.nil?
Builtins.y2error("Wrong URLs: %1 or %2", url_base, url_with_modifs)
return nil
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 GetFileRealType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def GetFileRealType(target)
info = Convert.to_map(SCR.Read(path(".target.lstat"), target))
if Ops.get_boolean(info, "islink", false) == true
"link"
- 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 GetShowQuestionAgain
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def GetShowQuestionAgain(params)
params = deep_copy(params)
LazyLoadCurrentConf()
q_type = Ops.get(params, "q_type")
- 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 GetFileType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def GetFileType(target)
info = Convert.to_map(SCR.Read(path(".target.stat"), target))
if Ops.get_boolean(info, "isdir", false) == true
"directory"
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def run
func, param = Yast::WFM.Args
log.info "Called #{self.class}.run with #{func} and params #{param}"
case func
- 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 MergeURLsParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def MergeURLsParams(base_url, url_with_modifs)
if base_url.nil? || url_with_modifs.nil?
Builtins.y2error("Wrong params: %1 or %2", base_url, url_with_modifs)
return nil
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 DocodeDomainNames
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def DocodeDomainNames(encoded_domain_names)
encoded_domain_names = deep_copy(encoded_domain_names)
decoded_domain_names = []
strings_to_decode = []
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def Check(url)
# We don't allow empty URLs
return false if url.nil? || Ops.less_than(Builtins.size(url), 1)
# We don't allow URLs with spaces
- 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 too many return
statements within this method. Open
return Convert.to_symbol(
WS_error(Builtins.sformat("Next not found: %1", current))
)
Avoid too many return
statements within this method. Open
return :empty if !File.size?(file)
Avoid too many return
statements within this method. Open
return :back if Ops.less_than(Builtins.size(stack), 2)
Avoid too many return
statements within this method. Open
return :closed if allowed_interfaces.empty?
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return "I"