Showing 806 of 967 total issues
Avoid deeply nested control flow statements. Open
Open
ret << str if !unique || !Builtins.contains(ret, str)
Method Replace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def Replace(input, source, target)
return nil if input.nil?
if source.nil? || source == ""
Builtins.y2warning("invalid parameter source: %1", source)
- 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
Open
ret << str if !unique || !ret.include?(str)
Avoid deeply nested control flow statements. Open
Open
elsif character == "\\\""
str << "\""
else
str << character
Method FromString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def FromString(string)
return {} if string.nil?
ret = {}
Builtins.foreach(Builtins.splitstring(string, " ")) do |vals|
- 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
Open
elsif character == "\\\""
str << "\""
else
str << character
Avoid deeply nested control flow statements. Open
Open
str = (character == "\\\"") ? "\"" : character
Consider simplifying this complex logical expression. Open
Open
if key != "label" ||
(Ops.get(v, "widget") != :radio_buttons &&
Ops.get(v, "widget") != :custom &&
Ops.get(v, "widget") != :rich_text &&
Ops.get(v, "widget") != :func)
Method SetContentsButtons
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def SetContentsButtons(title, contents, help_text, back_label, next_label)
Method SetContents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def SetContents(title, contents, help_text, has_back, has_next)
Method TableItem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def TableItem(id, col1, col2, col3, col4)
Method StartPackage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def StartPackage(name, _location, _summary, installsize, is_delete)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(successful, failed, remaining, srcremaining, update_messages)
Method start_package
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def start_package(_name, _location, _summary, _installsize, _is_delete)
Method source_report_end
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def source_report_end(_src_id, _url, _task, _error, _description)
Method SourceReportEnd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def SourceReportEnd(src_id, url, task, error, description)
Method ItemSignedWithUnknownSignature
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ItemSignedWithUnknownSignature(item_type, item_name, key_id, dont_show_dialog_ident, repoid)
Method ReplaceWorkflowModule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ReplaceWorkflowModule(workflow, old, new, domain, keep)
Method ErrorAnyQuestion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus)
Method event_loop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def event_loop(content, focus, timeout, details, style)