cloudamatic/mu

View on GitHub

Showing 255 of 2,705 total issues

Avoid deeply nested control flow statements.
Open

                        if retries < 6
                          retries = retries + 1
                          sleep 10
                          retry
                        else
Severity: Major
Found in modules/mu/providers/aws/loadbalancer.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        subnet.private? ? priv_nets << { "Ref" => "#{subnet.cfm_name}" } : pub_nets << { "Ref" => "#{subnet.cfm_name}" }
    Severity: Major
    Found in modules/mu/providers/cloudformation.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    raise MuError, "No valid credentials available! Either grant admin privileges to machine service account, or manually add a different one with mu-configure" if found.nil?
      Severity: Major
      Found in modules/mu/providers/google.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                          if !noop
                            MU::Cloud::Google.iam(credentials: credentials).delete_project_role(id)
                          end
        Severity: Major
        Found in modules/mu/providers/google/role.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                            raise e if !e.message.match(/(?:forbidden|notFound): /)
          Severity: Major
          Found in modules/mu/providers/google/role.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if !resp or !resp.attached_policies.map { |a_p| a_p.policy_name }.include?(p.policy_name)
                              MU.log "Attaching policy #{p.policy_name} to group #{entityname}", MU::NOTICE
                              MU::Cloud::AWS.iam(credentials: @credentials).attach_group_policy(
                                policy_arn: p.arn,
                                group_name: entityname
            Severity: Major
            Found in modules/mu/providers/aws/role.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if !MU::Cloud::Google.hosted?
                              raise MuError, "Google Cloud credentials not found in Vault #{vault}:#{item}"
                            end
              Severity: Major
              Found in modules/mu/providers/google.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if retries < max_retries
                                          sleep 30
                                          retries += 1
                                          puts retries
                                        else
                Severity: Major
                Found in modules/mu/providers/google/folder.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if public
                                        # Make sure we have a public canonical name to register. Use the private one if we don't
                                        deploydata['public_dns_name'].empty? ? deploydata['private_dns_name'] : deploydata['public_dns_name']
                                      else
                                        # If we specifically requested to register the private canonical name lets use that
                  Severity: Major
                  Found in modules/mu/providers/aws/dnszone.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                          if bucket_style
                                            statement["Principal"] << { "AWS" => id }
                                          else
                                            statement["Principal"] << id
                                          end
                    Severity: Major
                    Found in modules/mu/providers/aws/role.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          child_params = Hash.new if child_params.nil?
                      Severity: Major
                      Found in modules/mu/providers/cloudformation.rb - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      rescue StandardError => e
                                        MU.log e.inspect, MU::WARN, details: cfg
                                        next
                        Severity: Major
                        Found in modules/mu/providers/aws.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                new_args << {} if new_args.empty?
                          Severity: Major
                          Found in modules/mu/providers/aws.rb - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                raise MuError, "Couldn't find #{dnsrec['mu_type']} #{dnsrec["target"]}" if found.nil? || found.empty?
                            Severity: Major
                            Found in modules/mu/providers/aws/dnszone.rb - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            break if elt == other_elt # if they're identical, we're done
                              Severity: Major
                              Found in modules/mu.rb - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if cfg['account_number'] and name.to_s == cfg['account_number'].to_s
                                                return name_only ? acctname : $MU_CFG['aws'][acctname]
                                              end
                                Severity: Major
                                Found in modules/mu/providers/aws.rb - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                    if subpaths.size > 0
                                                      p_arn = "arn:"+(MU::Cloud::AWS.isGovCloud?(@region) ? "aws-us-gov" : "aws")+":iam::aws:policy/#{subpaths.shift}/"+policy
                                                      retry
                                                    end
                                  Severity: Major
                                  Found in modules/mu/providers/aws/role.rb - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                          if new_args.size == 1 and new_args.first.is_a?(Hash)
                                                            new_args[0][page_markers[paginator]] = new_page
                                                          else
                                                            MU.log "I don't know how to insert a #{paginator} into these arguments for #{method_sym}", MU::WARN, details: new_args
                                                          end
                                    Severity: Major
                                    Found in modules/mu/providers/aws.rb - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                            rescue ::Google::Apis::ClientError => e
                                                              MU.log "Error enabling #{svc_name} in #{project.gsub(/^projects\/([^\/]+)\/.*/, '\1')} for #{method_sym.to_s}: "+ e.message, MU::ERR, details: enable_obj
                                                              raise e
                                      Severity: Major
                                      Found in modules/mu/providers/google.rb - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                              if retval.error
                                                                raise MuError, retval.error.message
                                                              end
                                        Severity: Major
                                        Found in modules/mu/providers/google.rb - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language