Showing 237 of 748 total issues
File ha_galera.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
resource_agent = "ocf:heartbeat:galera"
node[:mysql][:galera_packages].each do |p|
package p
end
- Create a ticketCreate a ticket
Method validate_ml2
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def validate_ml2(proposal)
ml2_mechanism_drivers = proposal["attributes"]["neutron"]["ml2_mechanism_drivers"]
ml2_type_drivers = proposal["attributes"]["neutron"]["ml2_type_drivers"]
ml2_type_drivers_default_provider_network = proposal["attributes"]["neutron"]["ml2_type_drivers_default_provider_network"]
ml2_type_drivers_default_tenant_network = proposal["attributes"]["neutron"]["ml2_type_drivers_default_tenant_network"]
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
validate_one_for_role proposal, "keystone-server"
api_versions = ["2.0", "3"]
unless api_versions.include? proposal["attributes"][@bc_name]["api"]["version"]
- 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
File ha.rb
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
vhostname = CrowbarRabbitmqHelper.get_ha_vhostname(node)
drbd_resource = "rabbitmq"
admin_vip_primitive = "vip-admin-#{vhostname}"
public_vip_primitive = "vip-public-#{vhostname}"
- Create a ticketCreate a ticket
Method validate_ml2
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_ml2(proposal)
ml2_mechanism_drivers = proposal["attributes"]["neutron"]["ml2_mechanism_drivers"]
ml2_type_drivers = proposal["attributes"]["neutron"]["ml2_type_drivers"]
ml2_type_drivers_default_provider_network = proposal["attributes"]["neutron"]["ml2_type_drivers_default_provider_network"]
ml2_type_drivers_default_tenant_network = proposal["attributes"]["neutron"]["ml2_type_drivers_default_tenant_network"]
- Create a ticketCreate a ticket
Method keystone_settings
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def self.keystone_settings(current_node, cookbook_name)
instance = current_node[cookbook_name][:keystone_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
File swift_service.rb
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rexml/document"
include ERB::Util # for html_escape
class SwiftService < OpenstackServiceObject
class ServiceError < StandardError
- Create a ticketCreate a ticket
Method action_grant
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def action_grant
db_name = new_resource.database_name || "*"
tbl_name = new_resource.table || "*"
username = client.escape(new_resource.username)
- 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 action_setup
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def action_setup
if @current_resource.generate_certs
unless ::File.exist?(@current_resource.certfile) \
&& ::File.exist?(@current_resource.keyfile)
- Create a ticketCreate a ticket
File helpers.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
module KeystoneHelper
def self.service_URL(protocol, host, port)
"#{protocol}://#{host}:#{port}"
end
- Create a ticketCreate a ticket
Function registerEvents
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
CiscoPorts.prototype.registerEvents = function() {
var self = this;
$('[data-name=switch]').live('change keyup', function() {
var node = $(this).data('node');
- Create a ticketCreate a ticket
Method set_role
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.set_role(nodes, role)
nodes.each do |nodename|
save_it = false
node = NodeObject.find_node_by_name nodename
- 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 keystone_settings
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.keystone_settings(current_node, cookbook_name)
instance = current_node[cookbook_name][:keystone_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
Class NeutronService
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class NeutronService < OpenstackServiceObject
def initialize(thelogger = nil)
super(thelogger)
@bc_name = "neutron"
end
- Create a ticketCreate a ticket
Method set_boot_kernel_grub2
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.set_boot_kernel_grub2(flavor = "default")
default_boot = "SLES12"
grub_env = `grub2-editenv list`
if grub_env.include?("saved_entry")
current_default = grub_env.strip.split("=")[1]
- 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 _fix_acl
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _fix_acl(certificate, group)
partial = "/"
certificate.split(::File::SEPARATOR).each do |entry|
next if entry.empty?
- 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_neutron_networks
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def enable_neutron_networks(attributes, nodename, net_svc, needs_external = true)
if needs_external
net_svc.enable_interface "default", "nova_floating", nodename
attributes["additional_external_networks"].each do |extnet|
net_svc.enable_interface "default", extnet, nodename
- 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
Function ml2_type_drivers_check
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function ml2_type_drivers_check() {
var values = $('#ml2_type_drivers').val() || [];
if (values.indexOf("vlan") >= 0) {
$('#num_vlans_container').show();
} else {
- 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 set_boot_kernel_grub1
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.set_boot_kernel_grub1(flavor = "default")
default_boot = 0
current_default = nil
# parse grub config, to find boot index for selected flavor
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def create_proposal
base = super
base[:attributes][:swift][:cluster_hash] = "%x%s" % [rand(100000),rand(100000)]
- 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"