Showing 806 of 967 total issues
Method AskPackageKit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def AskPackageKit
ret = false
if PackageKit.IsRunning
# ask to send quit signal to PackageKit
- 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 EnableDisableNow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def EnableDisableNow(force: false)
return unless force || Modified()
if current_name && Modified()
stop_service(current_name)
- 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 AnyRPCServiceInConfiguration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def AnyRPCServiceInConfiguration
ret = false
Builtins.foreach(GetKnownFirewallZones()) do |fw_zone|
fw_rule = Builtins.sformat("FW_SERVICES_%1_RPC", fw_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 ReadServicesDefinedByRPMPackages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ReadServicesDefinedByRPMPackages
log.info "Reading FirewallD services from #{SERVICES_DIRECTORIES.join(" and ")}"
@services ||= {}
- 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 GetListOfForwardsIntoMasquerade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def GetListOfForwardsIntoMasquerade
list_of_rules = []
Builtins.foreach(
Builtins.splitstring(
- 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 add_port
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_port(port_or_range, protocol, interface)
return false unless valid_port?(port_or_range)
return false unless supported_protocol?(protocol)
zone = interface_zone(interface)
- 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 CreateNewPortRange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CreateNewPortRange(min_pr, max_pr)
if min_pr.nil? || min_pr == 0
Builtins.y2error(
"Wrong definition of the starting port '%1', it must be between 1 and 65535",
min_pr
- 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 ArePortsOrServicesAllowed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ArePortsOrServicesAllowed(needed_ports, protocol, zone, check_for_aliases)
needed_ports = deep_copy(needed_ports)
are_allowed = true
if Ops.less_than(Builtins.size(needed_ports), 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 ValidateValueType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ValidateValueType(key, value, widget)
types = {
# general
"widget" => "symbol",
"custom_widget" => "term",
- 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 release_notes_content_for_lang_and_format
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def release_notes_content_for_lang_and_format(lang, format)
# If there is an index and the language is not indexed
return nil unless release_notes_index.empty? || indexed_release_notes_for?(lang, format)
# Where we want to store the downloaded release notes
- 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 CreateStartStopWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CreateStartStopWidget(settings)
settings = deep_copy(settings)
start_now_button = Ops.get_locale(
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 DisableButtons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def DisableButtons(buttons)
Builtins.foreach(buttons) do |button|
Wizard.DisableBackButton if button == "back_button"
Wizard.DisableAbortButton if button == "abort_button"
Wizard.DisableNextButton if button == "next_button"
- 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 CreateAutoStartWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def CreateAutoStartWidget(settings)
settings = deep_copy(settings)
start_auto_button = Ops.get_locale(
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 set_property
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_property(key, value)
current_value = get_property(key)
# Redefining already existent information
if !current_value.nil? && !current_value.empty? && current_value != 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 AutoStartInit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def AutoStartInit(widget, _key)
widget = deep_copy(widget)
if !UI.WidgetExists(Id("_cwm_service_startup"))
Builtins.y2error("Widget _cwm_service_startup does not exist")
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 SelectPackages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def SelectPackages(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
ok = true
- 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 WaitForYesNoCancelUserInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def WaitForYesNoCancelUserInput
user_input = nil
ret = nil
loop do
- 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 ProgressScanDb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ProgressScanDb(value)
if Mode.commandline
CommandLine.PrintVerboseNoCR(CLEAR_PROGRESS_TEXT + "#{value}%")
elsif @_scan_popup && UI.WidgetExists(Id(:label_scanDB_popup))
UI.ChangeWidget(Id(:progress), :Value, 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 ImportGPGKeyIntoTrustedDialog
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ImportGPGKeyIntoTrustedDialog(key, repository)
key = deep_copy(key)
# additional Richtext (HTML) warning text (kind of help), 1/2
warning_text = _(
"<p>The owner of the key may distribute updates,\n" \
- 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 product_package
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def product_package(name, _repo_id = nil)
return nil unless name
# find the highest version
Y2Packager::Resolvable.find(kind: :package, name: name).reduce(nil) do |a, p|
- 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"