Showing 237 of 748 total issues
Method has_cephfs_internal_cluster?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.has_cephfs_internal_cluster?(node)
# are we using a crowbar-deployed ceph cluster?
node[:manila][:shares].each do |share|
next unless share[:backend_driver] == "cephfs"
return true if share[:cephfs][:use_crowbar]
- Read upRead up
- Create a ticketCreate a ticket
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 validate_gre
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_gre(gre_settings)
if gre_settings["tunnel_id_start"] < 1 || gre_settings["tunnel_id_start"] > 2147483647
validation_error I18n.t("barclamp.#{@bc_name}.validation.start_id")
end
if gre_settings["tunnel_id_end"] < 1 || gre_settings["tunnel_id_end"] > 2147483647
- Read upRead up
- Create a ticketCreate a ticket
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 upgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upgrade(ta, td, a, d)
unless a["volume_defaults"]["nfs"].key? "nfs_snapshot"
a["volume_defaults"]["nfs"]["nfs_snapshot"] = ta["volume_defaults"]["nfs"]["nfs_snapshot"]
a["volumes"].each do |volume|
- Read upRead up
- Create a ticketCreate a ticket
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 downgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def downgrade(tattr, tdep, att, dep)
att["apic"]["opflex"].each_with_index do |opflex, i|
unless tattr["apic"]["opflex"][0].key?("integration_bridge")
att["apic"]["opflex"][i].delete("integration_bridge") if opflex.key?("integration_bridge")
end
- Read upRead up
- Create a ticketCreate a ticket
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 upgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upgrade(ta, td, a, d)
a["share_defaults"]["generic"] = ta["share_defaults"]["generic"]
# update shares
a["shares"].each do |share|
- Read upRead up
- Create a ticketCreate a ticket
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 upgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upgrade ta, td, a, d
unless a.key? "max_pool_size"
a["max_pool_size"] = ta["max_pool_size"]
end
unless a.key? "max_overflow"
- Read upRead up
- Create a ticketCreate a ticket
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 save_proposal!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_proposal!(prop, options = {})
# Fill in missing defaults for infoblox grid configurations
if prop.raw_data[:attributes][:neutron][:use_infoblox]
prop.raw_data[:attributes][:neutron][:infoblox][:grids].each do |grid|
defaults = prop.raw_data["attributes"]["neutron"]["infoblox"]["grid_defaults"]
- Read upRead up
- Create a ticketCreate a ticket
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 downgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def downgrade(ta, td, a, d)
unless ta["volume_defaults"]["netapp"].key? "max_over_subscription_ratio"
a["volume_defaults"]["netapp"].delete("max_over_subscription_ratio")
a["volumes"].each do |volume|
next if volume["backend_driver"] != "netapp"
- Read upRead up
- Create a ticketCreate a ticket
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 apply_role_pre_chef_call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Neutron apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
net_svc = NetworkService.new @logger
- Read upRead up
- Create a ticketCreate a ticket
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 downgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def downgrade(ta, td, a, d)
unless ta["mysql"].key?("innodb_flush_log_at_trx_commit")
a["mysql"].delete("innodb_flush_log_at_trx_commit")
end
unless ta["mysql"].key?("innodb_buffer_pool_instances")
- Read upRead up
- Create a ticketCreate a ticket
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 downgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def downgrade ta, td, a, d
unless ta.key? "max_pool_size"
a.delete "max_pool_size"
end
unless ta.key? "max_overflow"
- Read upRead up
- Create a ticketCreate a ticket
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 downgrade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def downgrade(template_attrs, template_deployment, attrs, deployment)
attrs["ldap"].delete("chase_referrals") unless template_attrs["ldap"].key?("chase_referrals")
unless template_attrs["domain_specific_config"]["ldap_users"]["ldap"].key?("chase_referrals")
attrs["domain_specific_config"].keys.each do |domain|
attrs["domain_specific_config"][domain]["ldap"].delete("chase_referrals")
- Read upRead up
- Create a ticketCreate a ticket
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 validate_proposal_after_save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
validate_one_for_role proposal, "designate-server"
validate_one_for_role proposal, "designate-worker"
designate_bc = proposal["attributes"][@bc_name]
- Read upRead up
- Create a ticketCreate a ticket
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_ha_repo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_ha_repo(logger)
return nil unless Proposal.where(barclamp: "pacemaker")
return false unless Crowbar::Repository.provided?("ha")
unless Crowbar::Repository.provided_and_enabled?("ha")
- Read upRead up
- Create a ticketCreate a ticket
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 apply_role_pre_chef_call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("octavia apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
if old_role
- Read upRead up
- Create a ticketCreate a ticket
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 apply_role_pre_chef_call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Watcher apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
# Role can be assigned to clusters, so we need to expand the elements
- Read upRead up
- Create a ticketCreate a ticket
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_ceph_repo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_ceph_repo(logger)
return nil unless Proposal.where(barclamp: "ceph")
return false unless Crowbar::Repository.provided?("ceph")
unless Crowbar::Repository.provided_and_enabled?("ceph")
- Read upRead up
- Create a ticketCreate a ticket
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"