Showing 255 of 2,705 total issues
Avoid deeply nested control flow statements. Open
Open
id.sub!(/:([^:]+)$/, ":"+'\1'+target["path"]) if target["path"]
Avoid deeply nested control flow statements. Open
Open
if report_data and !report_data.empty?
report ||= {}
report[elt_namestr] = report_data
end
Avoid deeply nested control flow statements. Open
Open
rescue StandardError => e
MU.log e.inspect, MU::WARN, details: cfg
next
Avoid deeply nested control flow statements. Open
Open
MU.log "Filesystem #{pool.name}: #{pool.file_system_id} already deleted", MU::NOTICE if e.to_s.start_with?("invalid file system ID")
Avoid deeply nested control flow statements. Open
Open
public = dnsrec["target_type"] == "private" ? false : true
Avoid deeply nested control flow statements. Open
Open
if type['level'] == node['glusterfs']['server']['raid_level'] and type['spare'] == node['glusterfs']['server']['raid_spare_vol'] and node['glusterfs']['server']['devices'.size] >= type['min_devcies']
spare_device = node['glusterfs']['server']['devices'].pop
raid_with_spare(node['glusterfs']['server']['raid_dev'], node['glusterfs']['server']['raid_level'], node['glusterfs']['server']['devices'].size, node['glusterfs']['server']['devices'].join(" "), spare_device)
end
Avoid deeply nested control flow statements. Open
Open
if bucket_style
statement["Principal"] << { "AWS" => id }
else
statement["Principal"] << id
end
Avoid deeply nested control flow statements. Open
Open
if cfg['account_number'] and name.to_s == cfg['account_number'].to_s
return name_only ? acctname : $MU_CFG['aws'][acctname]
end
Avoid deeply nested control flow statements. Open
Open
if !MU::Cloud::Google.hosted?
raise MuError, "Google Cloud credentials not found in Vault #{vault}:#{item}"
end
Avoid deeply nested control flow statements. Open
Open
rescue
MU.log function['code']['zip_file']+" does not contain function.js or index.js, at least one must be present for runtime #{function['runtime']}", MU::ERR
ok = false
Method find
has a Cognitive Complexity of 78 (exceeds 75 allowed). Consider refactoring. Open
Open
def self.find(**args)
credcfg = MU::Cloud::Google.credConfig(args[:credentials])
customer = MU::Cloud::Google.customerID(args[:credentials])
my_org = MU::Cloud::Google.getOrg(args[:credentials])
- 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
if !noop
MU::Cloud::Google.iam(credentials: credentials).delete_project_role(id)
end
Avoid deeply nested control flow statements. Open
Open
raise e if !e.message.match(/(?:forbidden|notFound): /)
Avoid deeply nested control flow statements. Open
Open
elsif entitytype == "role"
resp = MU::Cloud::AWS.iam(credentials: @credentials).list_attached_role_policies(
role_name: entityname
)
Avoid deeply nested control flow statements. Open
Open
if args[:types].include?(shortclass) and
!(entity_type == "serviceAccount" and
MU::Cloud::Google::User.cannedServiceAcctName?(entity))
MU.log "Role #{@cloud_id}: Skipping #{shortclass} binding for #{entity}; we are adopting that type and will set bindings from that resource", MU::DEBUG
next
Avoid deeply nested control flow statements. Open
Open
if retries < 6
retries = retries + 1
sleep 10
retry
else
Avoid deeply nested control flow statements. Open
Open
"arn:"+(MU::Cloud::AWS.isGovCloud?(@region) ? "aws-us-gov" : "aws")+":iam::aws:policy/"+policy
Avoid deeply nested control flow statements. Open
Open
path.pop if path.last == name
Avoid deeply nested control flow statements. Open
Open
if tier[:value].is_a?(Hash)
if name
tier[:value].delete("entity")
tier[:value].delete(name.sub(/\[.*/, '')) if name
end
Method validate
has a Cognitive Complexity of 78 (exceeds 75 allowed). Consider refactoring. Open
Open
def self.validate(db, configurator)
ok = true
read_replicas = []
cluster_nodes = []
- 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"