Showing 806 of 967 total issues
Method CreateHelp
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def CreateHelp(logs, parameters)
parameters = deep_copy(parameters)
help = Ops.get_string(parameters, "help", "")
return help if help != "" && !help.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 ChooseItem
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ChooseItem(_title, items, selected)
items = deep_copy(items)
item = nil
items = Builtins.maplist(items) do |i|
- 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 read
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def read(name)
info = Y2Firewall::Firewalld.instance.api.info_service(name)
raise(Service::NotFound, name) if $CHILD_STATUS.exitstatus == 101
service = Service.new(name: 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 parse_zones
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse_zones
current_zone = nil
current_attribute = nil
zones_definition.each_with_object(zone_entries) do |line, entries|
next if line.lstrip.empty?
- 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 all_products
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def all_products(force_repos: false)
linuxrc_special_products = if Yast::Linuxrc.InstallInf("specialproduct")
linuxrc_string(Yast::Linuxrc.InstallInf("specialproduct")).split(",")
else
[]
- 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 FindBaseProducts
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def FindBaseProducts
return unless load_zypp
log.info "Looking for base products"
- 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 FormatFilename
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def FormatFilename(file_path, len)
return nil unless file_path
return file_path if len && len > file_path.size
dir = file_path.split("/", -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 GetAllKnownInterfaces
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def GetAllKnownInterfaces
known_interfaces = []
# All dial-up interfaces
dialup_interfaces = NetworkInterfaces.List("dialup")
Method main
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "Pkg"
Yast.import "UI"
textdomain "base"
Method UseItemWithNoChecksum
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def UseItemWithNoChecksum(item_type, item_name, dont_show_dialog_ident)
description_text = Builtins.sformat(
if item_type == :package
# popup question, %1 stands for the package name
_(
Method Run
has 51 lines of code (exceeds 25 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", "")
File AsciiFile.rb
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
# Assume this /etc/fstab file
#
Method MergeProposal
has 50 lines of code (exceeds 25 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(
Method ScriptStart
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ScriptStart(patch_name, patch_version, patch_arch, script_path)
patch_full_name = FormatPatchName(patch_name, patch_version, patch_arch)
Builtins.y2milestone(
"ScriptStart callback: patch: %1, script: %2",
Method Authentication
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Authentication(url, msg, username, password)
# FIXME: after SLE12 release
# The following 'if' block is a workaround for bnc#895719 that should be
# extracted to a proper private method (not sure if it will work as
# expected being a callback) and adapted to use normal _() instead of
Method getProposals
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getProposals(stage, mode, proptype)
props = getMatchingProposal(stage, mode, proptype)
unique_id = Ops.get_string(props, [0, "unique_id"], "")
disabled_subprops = GetDisabledSubProposals()
Method DocodeDomainNames
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DocodeDomainNames(encoded_domain_names)
encoded_domain_names = deep_copy(encoded_domain_names)
decoded_domain_names = []
strings_to_decode = []
Method Run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Run(aliases, sequence)
aliases = deep_copy(aliases)
sequence = deep_copy(sequence)
# Check aliases and sequence correctness
return Convert.to_symbol(WS_error("CHECK FAILED")) if @docheck && WS_check(aliases, sequence) != true
Method ProgressDownload
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ProgressDownload(percent, bps_avg, bps_current)
if @autorefreshing && @autorefreshing_aborted
Builtins.y2milestone("Refresh aborted")
return false
end
Method Run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Run(widgets, functions, skip_store_for: [])
widgets = deep_copy(widgets)
functions = deep_copy(functions)
widgets = mergeFunctions(widgets, functions)
PushSettings()