cloudamatic/mu

View on GitHub

Showing 2,704 of 2,705 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

{
"type" => "array",
"minItems" => 1,
"items" => {
"description" => "Tags to apply to this resource. Will apply at the cloud provider level and in node groomers, where applicable.",
Severity: Minor
Found in modules/mu/config/schema_helpers.rb and 2 other locations - About 25 mins to fix
modules/mu/config/cache_cluster.rb on lines 125..139
modules/mu/config/function.rb on lines 81..95

Similar blocks of code found in 3 locations. Consider refactoring.
Open

when 'dynamodb'
sib_dynamo = @deploy.findLitterMate(name: name, type: "nosqldb")
arn = sib_dynamo ? sib_dynamo.arn : "arn:aws:dynamodb:#{@region}:#{MU::Cloud::AWS.credToAcct(@credentials)}:table/#{name}"
when 'apigateway'
Severity: Minor
Found in modules/mu/providers/aws/function.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/aws/function.rb on lines 188..191
modules/mu/providers/aws/function.rb on lines 197..200

Similar blocks of code found in 3 locations. Consider refactoring.
Open

when 'apigateway'
sib_apig = @deploy.findLitterMate(name: name, type: "endpoints")
arn = sib_apig ? sib_apig.arn : "arn:aws:apigateway:#{@region}:#{MU::Cloud::AWS.credToAcct(@credentials)}:#{name}"
when 's3'
Severity: Minor
Found in modules/mu/providers/aws/function.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/aws/function.rb on lines 188..191
modules/mu/providers/aws/function.rb on lines 194..197

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if found.id and !found.kitten
MU.log "GKE server #{server['name']} failed to locate service account #{server['service_account']} in project #{server['project']}", MU::ERR
ok = false
end
Severity: Minor
Found in modules/mu/providers/google/server.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/google/function.rb on lines 552..555
modules/mu/providers/google/server_pool.rb on lines 369..372

Similar blocks of code found in 5 locations. Consider refactoring.
Open

dnsrec['name'] = "#{dnsrec['name']}.#{MU.environment.downcase}" if dnsrec["append_environment_name"] && !dnsrec['name'].match(/\.#{MU.environment.downcase}$/)
}
Severity: Minor
Found in modules/mu/providers/aws/cache_cluster.rb and 4 other locations - About 25 mins to fix
modules/mu/mommacat/naming.rb on lines 321..322
modules/mu/providers/aws/dnszone.rb on lines 114..116
modules/mu/providers/aws/dnszone.rb on lines 203..204
modules/mu/providers/aws/loadbalancer.rb on lines 556..557

Similar blocks of code found in 3 locations. Consider refactoring.
Open

"environment_variable" => {
"type" => "array",
"minItems" => 1,
"items" => {
"description" => "environment variables",
Severity: Minor
Found in modules/mu/config/function.rb and 2 other locations - About 25 mins to fix
modules/mu/config/cache_cluster.rb on lines 125..139
modules/mu/config/schema_helpers.rb on lines 140..154

Similar blocks of code found in 5 locations. Consider refactoring.
Open

dnsrec['name'] = "#{dnsrec['name']}.#{MU.environment.downcase}" if dnsrec["append_environment_name"] && !dnsrec['name'].match(/\.#{MU.environment.downcase}$/)
end
Severity: Minor
Found in modules/mu/mommacat/naming.rb and 4 other locations - About 25 mins to fix
modules/mu/providers/aws/cache_cluster.rb on lines 412..413
modules/mu/providers/aws/dnszone.rb on lines 114..116
modules/mu/providers/aws/dnszone.rb on lines 203..204
modules/mu/providers/aws/loadbalancer.rb on lines 556..557

Similar blocks of code found in 3 locations. Consider refactoring.
Open

"parameter_group_parameters" => {
"type" => "array",
"minItems" => 1,
"items" => {
"description" => "The cache cluster parameter group parameter to change and when to apply the change.",
Severity: Minor
Found in modules/mu/config/cache_cluster.rb and 2 other locations - About 25 mins to fix
modules/mu/config/function.rb on lines 81..95
modules/mu/config/schema_helpers.rb on lines 140..154

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if found.id and !found.kitten
MU.log "GKE pool #{pool['name']} failed to locate service account #{pool['service_account']} in project #{pool['project']}", MU::ERR
ok = false
end
Severity: Minor
Found in modules/mu/providers/google/server_pool.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/google/function.rb on lines 552..555
modules/mu/providers/google/server.rb on lines 1531..1534

Similar blocks of code found in 3 locations. Consider refactoring.
Open

when 'sns'
sib_sns = @deploy.findLitterMate(name: name, type: "notifiers")
arn = sib_sns ? sib_sns.arn : "arn:aws:sns:#{@region}:#{MU::Cloud::AWS.credToAcct(@credentials)}:#{name}"
when 'alarm','events', 'event', 'cloudwatch_event'
Severity: Minor
Found in modules/mu/providers/aws/function.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/aws/function.rb on lines 194..197
modules/mu/providers/aws/function.rb on lines 197..200

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if found.id and !found.kitten
MU.log "Cloud Function #{function['name']} failed to locate service account #{function['service_account']} in project #{function['project']}", MU::ERR
ok = false
end
Severity: Minor
Found in modules/mu/providers/google/function.rb and 2 other locations - About 25 mins to fix
modules/mu/providers/google/server.rb on lines 1531..1534
modules/mu/providers/google/server_pool.rb on lines 369..372

Similar blocks of code found in 2 locations. Consider refactoring.
Open

desc = MU::Cloud::AWS.eks(region: args[:region], credentials: args[:credentials]).describe_cluster(name: c)
found[c] = desc.cluster if desc and desc.cluster
}
Severity: Minor
Found in modules/mu/providers/aws/container_cluster.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws/nosqldb.rb on lines 267..269

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if tag_param.size > 0
MU.log "Updating tags on IAM role #{@mu_name}", MU::NOTICE, details: tag_param
MU::Cloud::AWS.iam(credentials: @credentials).tag_role(role_name: @mu_name, tags: tag_param)
Severity: Minor
Found in modules/mu/providers/aws/role.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws/user.rb on lines 61..63

Similar blocks of code found in 2 locations. Consider refactoring.
Open

modules %w{status alias auth_basic authn_core authn_file authz_core authz_groupfile authz_host authz_user autoindex deflate dir env mime negotiation setenvif log_config logio unixd systemd headers proxy proxy_http rewrite ssl ldap authnz_ldap slotmem_shm}
Severity: Minor
Found in cookbooks/mu-master/recipes/default.rb and 1 other location - About 25 mins to fix
cookbooks/mu-master/recipes/basepackages.rb on lines 30..30

Similar blocks of code found in 2 locations. Consider refactoring.
Open

resp = MU::Cloud::AWS.iam(credentials: args[:credentials]).get_policy(
policy_arn: args[:cloud_id]
)
if resp and resp.policy
found[args[:cloud_id]] = resp.policy
Severity: Minor
Found in modules/mu/providers/aws/role.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws/user.rb on lines 362..365

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def self.config_example
sample = hosted_config
sample ||= {
"project" => "my-project",
"region" => "us-east4"
Severity: Minor
Found in modules/mu/providers/google.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws.rb on lines 573..583

Similar blocks of code found in 2 locations. Consider refactoring.
Open

resp = MU::Cloud::AWS.iam(credentials: args[:credentials]).get_user(user_name: args[:cloud_id])
if resp and resp.user
found[args[:cloud_id]] = resp.user
end
Severity: Minor
Found in modules/mu/providers/aws/user.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws/role.rb on lines 546..551

Similar blocks of code found in 2 locations. Consider refactoring.
Open

rhelbase = ["vim-enhanced", "zip", "unzip", "java-1.8.0-openjdk", "libxml2-devel", "libxslt-devel", "cryptsetup-luks", "python-pip", "lsof", "mlocate", "strace", "nmap", "openssl-devel", "readline-devel", "python-devel", "diffutils", "patch", "bind-utils", "httpd-tools", "mailx", "openssl", "libyaml", "graphviz", "ImageMagick-devel", "graphviz-devel", "jq", "vim", "libffi-devel"]
Severity: Minor
Found in cookbooks/mu-master/recipes/basepackages.rb and 1 other location - About 25 mins to fix
cookbooks/mu-master/recipes/default.rb on lines 222..222

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if @config['enable_dns_hostnames']
MU.log "Enabling DNS hostnames in #{@mu_name}"
MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).modify_vpc_attribute(
vpc_id: @cloud_id,
enable_dns_hostnames: {value: @config['enable_dns_hostnames']}
Severity: Minor
Found in modules/mu/providers/aws/vpc.rb and 1 other location - About 25 mins to fix
modules/mu/providers/aws/vpc.rb on lines 164..169

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def self.config_example
sample = hosted_config
sample ||= {
"region" => "us-east-1",
"account_number" => "123456789012",
Severity: Minor
Found in modules/mu/providers/aws.rb and 1 other location - About 25 mins to fix
modules/mu/providers/google.rb on lines 118..126
Severity
Category
Status
Source
Language