Showing 28 of 55 total issues
Function New
has 94 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func New(ctx context.Context, projectID, impersonateServiceAccount string) (*GCP, error) {
gcp := &GCP{
Organizations: make([]*Organization, 0),
Projects: make([]*Project, 0),
Regions: []string{"global"},
Function execute
has 91 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func execute(c *cli.Context) error {
ctx, cancel := context.WithCancel(c.Context)
defer cancel()
gcp, err := gcputil.New(ctx, c.String("project-id"), c.String("impersonate-service-account"))
Function execute
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func execute(c *cli.Context) error {
project, err := gcputil.New(c.Context, c.String("project-id"), c.String("impersonate-service-account"))
if err != nil {
return err
}
Method KMSKeyLister.List
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (l *KMSKeyLister) List(ctx context.Context, o interface{}) ([]resource.Resource, error) {
var resources []resource.Resource
opts := o.(*nuke.ListerOpts)
if err := opts.BeforeList(nuke.Regional, "cloudkms.googleapis.com"); err != nil {
Function init
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func init() {
flags := []cli.Flag{
&cli.PathFlag{
Name: "config",
Usage: "path to config file",
Method CloudFunctionLister.List
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (l *CloudFunctionLister) List(ctx context.Context, o interface{}) ([]resource.Resource, error) {
var resources []resource.Resource
opts := o.(*nuke.ListerOpts)
if err := opts.BeforeList(nuke.Regional, "cloudfunctions.googleapis.com"); err != nil {
Method IAMWorkloadIdentityPoolProviderLister.List
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (l *IAMWorkloadIdentityPoolProviderLister) List(ctx context.Context, o interface{}) ([]resource.Resource, error) {
var resources []resource.Resource
opts := o.(*nuke.ListerOpts)
if err := opts.BeforeList(nuke.Global, "iam.googleapis.com"); err != nil {
Function New
has 10 return statements (exceeds 4 allowed). Open
Open
func New(ctx context.Context, projectID, impersonateServiceAccount string) (*GCP, error) {
gcp := &GCP{
Organizations: make([]*Organization, 0),
Projects: make([]*Project, 0),
Regions: []string{"global"},
Function execute
has 6 return statements (exceeds 4 allowed). Open
Open
func execute(c *cli.Context) error {
ctx, cancel := context.WithCancel(c.Context)
defer cancel()
gcp, err := gcputil.New(ctx, c.String("project-id"), c.String("impersonate-service-account"))
Method FirebaseRealtimeDatabase.EmptyDefaultDatabase
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *FirebaseRealtimeDatabase) EmptyDefaultDatabase(ctx context.Context) error {
if r.settings == nil {
return nil
}
Method FirebaseDatabaseService.ListDatabaseInstances
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *FirebaseDatabaseService) ListDatabaseInstances(ctx context.Context, parent string) ([]*DatabaseInstance, error) {
url1 := fmt.Sprintf("%sv1beta/%s/instances", s.BasePath, parent)
logrus.Tracef("url: %s", url1)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url1, nil)
Method VPCGlobalIPAddress.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *VPCGlobalIPAddress) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method ComputeForwardingRule.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ComputeForwardingRule) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method CloudFunctionLister.List
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *CloudFunctionLister) List(ctx context.Context, o interface{}) ([]resource.Resource, error) {
var resources []resource.Resource
opts := o.(*nuke.ListerOpts)
if err := opts.BeforeList(nuke.Regional, "cloudfunctions.googleapis.com"); err != nil {
Method VPCNetwork.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *VPCNetwork) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method GKECluster.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *GKECluster) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method FirebaseRealtimeDatabaseLister.List
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *FirebaseRealtimeDatabaseLister) List(ctx context.Context, o interface{}) ([]resource.Resource, error) {
var resources []resource.Resource
opts := o.(*nuke.ListerOpts)
if err := opts.BeforeList(nuke.Regional, "firebasedatabase.googleapis.com"); err != nil {
Method ComputeTargetHTTPSProxy.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ComputeTargetHTTPSProxy) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method ComputeSecurityPolicy.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ComputeSecurityPolicy) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}
Method ComputeBackendService.HandleWait
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ComputeBackendService) HandleWait(ctx context.Context) error {
if r.removeOp == nil {
return nil
}