Showing 2,704 of 2,705 total issues
Class has too many lines. [1926/1000] Open
class Server < MU::Cloud::Server
# A list of block device names to use if we get a storage block that
# doesn't declare one explicitly.
# This probably fails on some AMIs. It's crude.
- 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 processReference is too high. [584.8/75] 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 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. [1766/1000] Open
class ContainerCluster < MU::Cloud::ContainerCluster
# 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
- 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. [613/200] Open
def self.schema(_config)
toplevel_required = []
schema = {
"flavor" => {
- 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.
Block has too many lines. [694/100] Open
@@resource_types.each_key { |name|
Object.const_get("MU").const_get("Cloud").const_get(name).class_eval {
attr_reader :cloudclass
attr_reader :cloudobj
attr_reader :destroyed
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [692/100] Open
Object.const_get("MU").const_get("Cloud").const_get(name).class_eval {
attr_reader :cloudclass
attr_reader :cloudobj
attr_reader :destroyed
attr_reader :delayed_save
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for create is too high. [458.7/75] Open
def create
if @config["zones"] == nil
@config["zones"] = MU::Cloud::AWS.listAZs(region: @region)
MU.log "Using zones from #{@region}", MU::DEBUG, details: @config['zones']
end
- 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 method_missing is too high. [405.5/75] Open
def method_missing(method_sym, *arguments)
retries = 0
actual_resource = nil
enable_on_fail = true
- 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 insertKitten is too high. [397.2/75] Open
def insertKitten(descriptor, type, delay_validation = false, ignore_duplicates: false, overwrite: false)
append = false
start = Time.now
shortclass, cfg_name, cfg_plural, classname = MU::Cloud.getResourceNames(type)
- 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 dependencies is too high. [391.6/75] Open
def dependencies(use_cache: false, debug: false)
@dependencies ||= {}
@loadbalancers ||= []
@firewall_rules ||= []
- 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. [613/100] Open
module MU
# Subclass core thread so we can gracefully handle it when we hit system
# thread limits. Back off and wait makes sense for us, since most of our
# threads are terminal (in the dependency sense) and this is unlikely to get
- 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.
Class has too many lines. [1485/1000] Open
class VPC < MU::Cloud::VPC
require 'mu/providers/aws/vpc_subnet'
# 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
- 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. [491/200] Open
def create
if @config["zones"] == nil
@config["zones"] = MU::Cloud::AWS.listAZs(region: @region)
MU.log "Using zones from #{@region}", MU::DEBUG, details: @config['zones']
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.
Class has too many lines. [1404/1000] Open
class Database < MU::Cloud::Database
# Map legal storage values for each disk type and database engine so
# our validator can check them for us.
STORAGE_RANGES = {
- 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 processReference
has a Cognitive Complexity of 250 (exceeds 75 allowed). Consider refactoring. 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
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 toKitten is too high. [303.2/75] Open
def toKitten(**_args)
bok = {
"cloud" => "Google",
"project" => @config['project'],
- 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 genParams is too high. [300.9/75] Open
def genParams(ext = nil)
params = {
:domain_name => @config['domain_name'] || @deploydata['domain_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 writeCloudFormationTemplate is too high. [297.4/75] Open
def self.writeCloudFormationTemplate(tails: MU::Config.tails, config: {}, path: nil, mommacat: nil)
cfm_template = {
"AWSTemplateFormatVersion" => "2010-09-09",
"Description" => "Automatically generated by Mu",
"Parameters" => {
- 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 validateConfig is too high. [290.3/75] Open
def self.validateConfig(cluster, configurator)
ok = true
start = Time.now
cluster['size'] = MU::Cloud.resourceClass("AWS", "Server").validateInstanceType(cluster["instance_type"], cluster["region"])
ok = false if cluster['size'].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 run is too high. [274.8/75] Open
def run
Signal.trap("INT") do
# Don't use MU.log in here, it does a synchronize {} and that ain't
# legal inside a trap.
die = true if (Time.now.to_i - @last_sigterm) < 5
- 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