Showing 2,704 of 2,705 total issues
Assignment Branch Condition size for updateAWSMetaData is too high. [273.4/75] Open
def updateAWSMetaData(deploys = MU::MommaCat.listDeploys, nodes = [])
deploys.each { |muid|
mommacat = MU::MommaCat.new(muid)
if mommacat.original_config.nil?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
File server.rb
has 1941 lines of code (exceeds 1000 allowed). Consider refactoring. Open
require 'net/ssh'
require 'net/ssh/multi'
require 'net/ssh/proxy/command'
autoload :OpenStruct, "ostruct"
autoload :Timeout, "timeout"
Method dependencies
has a Cognitive Complexity of 220 (exceeds 75 allowed). Consider refactoring. Open
def dependencies(use_cache: false, debug: false)
@dependencies ||= {}
@loadbalancers ||= []
@firewall_rules ||= []
- 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
Assignment Branch Condition size for createUpdateLaunchConfig is too high. [270.5/75] Open
def createUpdateLaunchConfig
return if !@config['basis'] or !@config['basis']["launch_config"]
instance_secret = Password.random(50)
@deploy.saveNodeSecret("default", instance_secret, "instance_secret")
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create_update is too high. [259.1/75] Open
def create_update
@config = MU::Config.manxify(@config)
@config['region'] ||= MU::Cloud::Azure.myRegion(@config['credentials'])
tags = {}
if !@config['scrub_mu_isms']
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class has too many lines. [1243/1000] Open
class ServerPool < MU::Cloud::ServerPool
# Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like +@vpc+, for us.
# @param args [Hash]: Hash of named arguments passed via Ruby's double-splat
def initialize(**args)
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for create is too high. [250/75] Open
def create
@cfm_name, @cfm_template = MU::Cloud::CloudFormation.cloudFormationBase(self.class.cfg_name, self, tags: @config['tags'], scrub_mu_isms: @config['scrub_mu_isms']) if @cfm_template.nil?
MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "CidrBlock", @config['ip_block'])
["enable_dns_support", "enable_dns_hostnames"].each { |arg|
if !@config[arg].nil?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [250.7/75] Open
def create
@cfm_name, @cfm_template = MU::Cloud::CloudFormation.cloudFormationBase(self.class.cfg_name, self, tags: @config['tags'], scrub_mu_isms: @config['scrub_mu_isms']) if @cfm_template.nil?
@cfm_launch_name, launch_template = MU::Cloud::CloudFormation.cloudFormationBase("launch_config", self, scrub_mu_isms: @config['scrub_mu_isms'])
MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "LaunchConfigurationName", { "Ref" => @cfm_launch_name } )
MU::Cloud::CloudFormation.setCloudFormationProp(@cfm_template[@cfm_name], "DependsOn", @cfm_launch_name)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Module has too many lines. [332/100] Open
module Helper
# Fetch a Google instance metadata parameter (example: instance/id).
# @param param [String]: The parameter name to fetch
# @return [String, nil]
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for groom is too high. [248.4/75] Open
def groom
if @config['notifications'] and @config['notifications']['topic']
# XXX expand to a full reference block for a Notification resource
arn = if @config['notifications']['topic'].match(/^arn:/)
@config['notifications']['topic']
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [247.2/75] Open
def create
flag="SUCCESS"
MU.setVar("curRegion", @region) if !@region.nil?
region = @region
server=@config["name"]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [246.3/75] Open
def create
# RDS is picky, we can't just use our regular node names for things
# like the default schema or username. And it varies from engine to
# engine.
basename = @config["name"].to_s
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [238.8/75] Open
def create
labels = Hash[@tags.keys.map { |k|
[k.downcase, @tags[k].downcase.gsub(/[^-_a-z0-9]/, '-')] }
]
labels["name"] = MU::Cloud::Google.nameStr(@mu_name)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
File container_cluster.rb
has 1773 lines of code (exceeds 1000 allowed). Consider refactoring. Open
module MU
class Cloud
class AWS
# A ContainerCluster as configured in {MU::Config::BasketofKittens::container_clusters}
class ContainerCluster < MU::Cloud::ContainerCluster
Assignment Branch Condition size for groom is too high. [235.3/75] Open
def groom
labelCluster
me = cloud_desc
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class has too many lines. [1204/1000] Open
class Server < MU::Cloud::Server
# Initialize this cloud resource object. Calling +super+ will invoke the initializer defined under {MU::Cloud}, which should set the attribtues listed in {MU::Cloud::PUBLIC_ATTRS} as well as applicable dependency shortcuts, like <tt>@vpc</tt>, for us.
# @param args [Hash]: Hash of named arguments passed via Ruby's double-splat
def initialize(**args)
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class has too many lines. [1203/1000] Open
class AWS
@@myRegion_var = nil
@@creds_loaded = {}
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [354/200] Open
def self.common_properties
{
"name" => {"type" => "string"},
"ansible_vars" => {
"type" => "object",
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method schema
has 613 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.schema(_config)
toplevel_required = []
schema = {
"flavor" => {
Method has too many lines. [352/200] Open
def self.processReference(vpc_block, parent_type, parent, configurator, sibling_vpcs: [], dflt_region: MU.curRegion, dflt_project: nil, credentials: nil)
if !vpc_block.is_a?(Hash) and vpc_block.kind_of?(MU::Cloud::VPC)
return true
end
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.