Showing 255 of 2,705 total issues
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
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
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
Method schema
has 613 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.schema(_config)
toplevel_required = []
schema = {
"flavor" => {
Method initialize
has a Cognitive Complexity of 175 (exceeds 75 allowed). Consider refactoring. Open
def initialize(**args)
raise MuError, "Cannot invoke Cloud objects without a configuration" if args[:kitten_cfg].nil?
# We are a parent wrapper object. Initialize our child object and
# housekeeping bits accordingly.
- 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
Method method_missing
has a Cognitive Complexity of 171 (exceeds 75 allowed). Consider refactoring. Open
def method_missing(method_sym, *arguments)
retries = 0
actual_resource = nil
enable_on_fail = true
- 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
Method create
has 491 lines of code (exceeds 150 allowed). Consider refactoring. 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
Method insertKitten
has a Cognitive Complexity of 159 (exceeds 75 allowed). Consider refactoring. 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
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 vpc.rb
has 1493 lines of code (exceeds 1000 allowed). Consider refactoring. Open
module MU
class Cloud
class AWS
# Creation of Virtual Private Clouds and associated artifacts (routes, subnets, etc).
Method create
has a Cognitive Complexity of 152 (exceeds 75 allowed). Consider refactoring. 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
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 toKitten
has a Cognitive Complexity of 150 (exceeds 75 allowed). Consider refactoring. Open
def toKitten(**args)
bok = {
"cloud" => "Google",
"credentials" => @config['credentials'],
- 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
File database.rb
has 1412 lines of code (exceeds 1000 allowed). Consider refactoring. Open
autoload :Net, 'net/ssh/gateway'
module MU
class Cloud
class AWS
Class AWS
has 74 methods (exceeds 20 allowed). Consider refactoring. Open
class AWS
@@myRegion_var = nil
@@creds_loaded = {}
File aws.rb
has 1356 lines of code (exceeds 1000 allowed). Consider refactoring. Open
require "net/http"
require 'open-uri'
require 'timeout'
require 'inifile'
autoload :Aws, "aws-sdk-core"
Method printSchema
has a Cognitive Complexity of 135 (exceeds 75 allowed). Consider refactoring. Open
def self.printSchema(kitten_rb, class_hierarchy, schema, in_array = false, required = false, prefix: nil)
return if schema.nil?
if schema["type"] == "object"
printme = []
- 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
Method validateConfig
has a Cognitive Complexity of 129 (exceeds 75 allowed). Consider refactoring. Open
def self.validateConfig(pool, configurator)
ok = true
if pool["termination_policy"]
valid_policies = MU::Cloud::AWS.autoscale(region: pool['region']).describe_termination_policy_types.termination_policy_types
- 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
Method common_properties
has 354 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.common_properties
{
"name" => {"type" => "string"},
"ansible_vars" => {
"type" => "object",
Method processReference
has 352 lines of code (exceeds 150 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
Method cloudFormationBase
has 351 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.cloudFormationBase(type, cloudobj = nil, name: nil, tags: [], scrub_mu_isms: false)
desc = {}
tags = [] if tags.nil?
realtags = []
havenametag = false