Showing 237 of 748 total issues
Method apply_role_pre_chef_call
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Horizon apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
server_elements, server_nodes, ha_enabled = role_expand_elements(role, "horizon-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 apply_role_pre_chef_call
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Rabbitmq apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
# prepare extra users
- Create a ticketCreate a ticket
File compute_ha.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
remote_nodes = CrowbarPacemakerHelper.remote_nodes(node)
return if remote_nodes.empty?
nova = remote_nodes.first
unless nova.roles.any? { |role| /^nova-compute-/ =~ role }
- Create a ticketCreate a ticket
Function ml2_mechanism_drivers_check
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ml2_mechanism_drivers_check() {
var values = $('#ml2_mechanism_drivers').val() || [];
// auto-select openvswitch & vlan if cisco is selected
if (values.indexOf("cisco_nexus") >= 0) {
- Create a ticketCreate a ticket
Method update_ovs_bridge_attributes
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_ovs_bridge_attributes(attributes, node)
needs_save = false
ovs_bridge_networks = []
ml2_mechanism_drivers = []
if attributes["networking_plugin"] == "ml2"
- Create a ticketCreate a ticket
Method action_create
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def action_create
unless exists?
begin
encoding = @new_resource.encoding
if encoding != "DEFAULT"
- 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_proposal
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_proposal
@logger.debug("Nova create_proposal: entering")
base = super
@logger.debug("Nova create_proposal: done with base")
- 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_proposal
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_proposal
@logger.debug("Nova create_proposal: entering")
base = super
@logger.debug("Nova create_proposal: done with base")
- Create a ticketCreate a ticket
Method apply_role_pre_chef_call
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Horizon apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
server_elements, server_nodes, ha_enabled = role_expand_elements(role, "horizon-server")
- Create a ticketCreate a ticket
Method validate_cisco_aci
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def validate_cisco_aci(proposal)
# Checks for Cisco ACI ml2 driver
ml2_mechanism_drivers = proposal["attributes"]["neutron"]["ml2_mechanism_drivers"]
ml2_type_drivers = proposal["attributes"]["neutron"]["ml2_type_drivers"]
- 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 database_settings
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.database_settings(node, barclamp)
instance = node[barclamp][:database_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Cinder apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
controller_elements, controller_nodes, ha_enabled = role_expand_elements(role, "cinder-controller")
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
validate_one_for_role proposal, "ironic-server"
net_svc = NetworkService.new @logger
network_proposal = Proposal.find_by(barclamp: net_svc.bc_name, name: "default")
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Database apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
database_elements, database_nodes, database_ha_enabled = role_expand_elements(role, "database-server")
- Create a ticketCreate a ticket
Method validate_proposal_after_save
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
# first, check for conflict with ceph
Proposal.where(barclamp: "ceph").each {|p|
next unless (p.status == "ready") || (p.status == "pending")
ceph_role = p.role
- Create a ticketCreate a ticket
Method database_settings
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.database_settings(node, barclamp)
instance = node[barclamp][:database_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- Create a ticketCreate a ticket
Method validate_ha_attributes
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_ha_attributes(attributes, cluster)
storage_mode = attributes["ha"]["storage"]["mode"]
role = available_clusters[cluster]
case attributes["sql_engine"]
- Create a ticketCreate a ticket
Method apply_role_pre_chef_call
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Glance 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 to get the actual list of nodes.
- Create a ticketCreate a ticket
Method validate_proposal_after_save
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
validate_one_for_role proposal, "rabbitmq-server"
attributes = proposal["attributes"][@bc_name]
- Create a ticketCreate a ticket
Method upgrade
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def upgrade ta, td, a, d
# Old proposals had passwords created in the cookbook, so we need to migrate
# them in the proposal and in the role. We use a class variable to set the
# same password in the proposal and in the role.
unless defined?(@@keystone_db_password)
- 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"