Showing 255 of 2,705 total issues
Class VPC
has 39 methods (exceeds 20 allowed). Consider refactoring. 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
Method validate
has a Cognitive Complexity of 104 (exceeds 75 allowed). Consider refactoring. Open
def self.validate(vpc, configurator)
ok = true
have_public = false
have_private = false
- 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 1120 lines of code (exceeds 1000 allowed). Consider refactoring. Open
module MU
class Cloud
class Google
# A Kubernetes cluster as configured in {MU::Config::BasketofKittens::container_clusters}
class ContainerCluster < MU::Cloud::ContainerCluster
Method records_primitive
has 245 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.records_primitive(need_target: true, default_type: nil, need_zone: false, embedded_type: nil)
dns_records_primitive = {
"type" => "array",
"maxItems" => 100,
"items" => {
File role.rb
has 1114 lines of code (exceeds 1000 allowed). Consider refactoring. Open
module MU
class Cloud
class AWS
# A user as configured in {MU::Config::BasketofKittens::roles}
class Role < MU::Cloud::Role
Method dependencies
has 243 lines of code (exceeds 150 allowed). Consider refactoring. Open
def dependencies(use_cache: false, debug: false)
@dependencies ||= {}
@loadbalancers ||= []
@firewall_rules ||= []
Method genParams
has a Cognitive Complexity of 99 (exceeds 75 allowed). Consider refactoring. Open
def genParams(ext = nil)
params = {
:domain_name => @config['domain_name'] || @deploydata['domain_name']
}
- 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 writeCloudFormationTemplate
has 231 lines of code (exceeds 150 allowed). Consider refactoring. 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" => {
Method run
has 227 lines of code (exceeds 150 allowed). Consider refactoring. 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
Method create_update
has 226 lines of code (exceeds 150 allowed). Consider refactoring. Open
def create_update
@config = MU::Config.manxify(@config)
@config['region'] ||= MU::Cloud::Azure.myRegion(@config['credentials'])
tags = {}
if !@config['scrub_mu_isms']
Method groom
has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring. 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
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 writeCloudFormationTemplate
has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring. 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
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 findLitterMate
has a Cognitive Complexity of 96 (exceeds 75 allowed). Consider refactoring. Open
def findLitterMate(type: nil, name: nil, mu_name: nil, cloud_id: nil, created_only: false, return_all: false, credentials: nil, habitat: nil, ignore_missing: false, debug: false, **flags)
_shortclass, _cfg_name, type, _classname, attrs = MU::Cloud.getResourceNames(type)
# If we specified a habitat, which we may also have done by its shorthand
# sibling name, or a Ref. Convert to something we can use.
- 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
Class Chef
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Chef
Object.class_eval {
def self.const_missing(symbol)
if symbol.to_sym == :Chef or symbol.to_sym == :ChefVault
Method schema
has 215 lines of code (exceeds 150 allowed). Consider refactoring. Open
def self.schema(_config)
toplevel_required = []
schema = {
"domain_names" => {
"type" => "array",
Class VPC
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class VPC < MU::Cloud::VPC
attr_reader :cloud_desc_cache
attr_reader :routes
# 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.
Method validateConfig
has a Cognitive Complexity of 94 (exceeds 75 allowed). Consider refactoring. Open
def self.validateConfig(vpc, configurator)
ok = true
if vpc["enable_traffic_logging"]
logdesc = {
- 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 run
has a Cognitive Complexity of 94 (exceeds 75 allowed). Consider refactoring. 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
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
Class Server
has 28 methods (exceeds 20 allowed). Consider refactoring. 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)
Class ContainerCluster
has 28 methods (exceeds 20 allowed). Consider refactoring. 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