Showing 6,062 of 6,062 total issues
Function removeValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.removeValue = function() {
var a = arguments;
var L = a.length;
var what;
var ax;
- 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["chef"].key?("solr_heap")
a.delete["chef"]["solr_heap"]
end
unless ta["chef"].key?("solr_tmpfs")
- 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 add_restart_management_node_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_restart_management_node_attributes
@node.set[:crowbar_wall] = {} unless @node[:crowbar_wall]
@node.set[:crowbar_wall][:requires_restart] = {} \
unless @node[:crowbar_wall][:requires_restart]
@node.set[:crowbar_wall][:requires_restart][cookbook] = {} \
- 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("chef")
a["chef"] = ta["chef"]
end
unless a["chef"].key?("solr_heap")
- 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 get_host_for_admin_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_host_for_admin_url(node, use_cluster = false)
if use_cluster && defined?(CrowbarPacemakerHelper)
# loose dependency on the pacemaker cookbook
cluster_vhostname = CrowbarPacemakerHelper.cluster_vhostname(node)
- 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(template_attrs, template_deployment, attrs, deployment)
unless defined?(@@dns_designate_rndc_key)
service = ServiceObject.new "fake-logger"
@@dns_designate_rndc_key = service.random_password
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 kill_nic_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def kill_nic_files(nic)
case node[:platform_family]
when "rhel"
# Redhat and Centos have lots of small files definining interfaces.
# Delete the ones we no longer care about here.
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.create(nic, slaves = [])
Chef::Log.info("Creating new bridge #{nic}")
if self.exists?(nic)
raise ::ArgumentError.new("#{nic} already exists.")
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 release_chef_locks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def release_chef_locks(locks)
return if locks.empty?
queue = Queue.new
locks.each { |l| queue.push l }
- 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 attribute_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def attribute_names
super.tap do |values|
unless values.include?("includes")
values.push("includes")
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 unlock_crowbar_ui_package
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unlock_crowbar_ui_package
ui_unlock = run_cmd("sudo zypper-retry removelock 'crowbar-ui*'")
unless ui_unlock[:exit_code].zero?
raise_node_upgrade_error(
"Removing crowbar-ui package lock has failed. " \
- 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_compute_nodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_compute_nodes(virt)
Rails.logger.info("Upgrading #{virt} compute nodes... ")
compute_nodes = ::Node.find("roles:nova-compute-#{virt}")
if compute_nodes.empty?
Rails.logger.info("There are no compute nodes of #{virt} type.")
- 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_archive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_archive
if file.nil?
errors.add_on_blank :file
return false
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 skip_unchanged_node?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def skip_unchanged_node?(node_name, old_role, new_role)
# if old_role is nil, then we are applying the barclamp for the first time
return false if old_role.nil?
# if the servers have changed, we need to apply
- 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_nodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_nodes(nodes)
return if nodes.empty?
queue = Queue.new
nodes.each { |n| queue.push n }
- 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!
if upgrading?
return {
status: :unprocessable_entity,
message: I18n.t("api.crowbar.upgrade_ongoing")
- 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_config_to_databag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_config_to_databag(old_role, role)
if role.nil?
config = nil
else
server_nodes_names = role.override_attributes["ntp"]["elements"]["ntp-server"]
- 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 run_remote_chef_client
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_remote_chef_client(node, command, logfile_name)
Thread.new do
# Exec command
# the -- tells sudo to stop interpreting options
- 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 expander
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def expander(values)
{}.tap do |result|
values.each do |full|
barclamp, proposal = full.split(".")
- 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 enable_compute_service
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enable_compute_service(controller, node, only_enable = false)
hostname = node[:hostname]
controller.run_ssh_cmd(
"source /root/.openrc; " \
"openstack --insecure compute service set --enable #{hostname} nova-compute"
- 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"