superfly / flyctl

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
2 occurrences in this check
func CreateCluster has a cyclomatic complexity of 30 with "very-high" risk
274}
275
276// CreateCluster creates a Postgres cluster with an optional name. The name will be prompted for if not supplied.
277func CreateCluster(ctx context.Context, org *fly.Organization, region *fly.Region, params *ClusterParams) (err error) {278	var (
279		client = fly.ClientFromContext(ctx)
280		io     = iostreams.FromContext(ctx)
func run has a cyclomatic complexity of 27 with "very-high" risk
 94// Since we want to be able to create PG clusters from other commands,
 95// we pass the name, region and org to CreateCluster. Other flags that don't prompt may
 96// be safely passed through from other commands.
 97func run(ctx context.Context) (err error) { 98	var (
 99		appName  = flag.GetString(ctx, "name")
100		client   = fly.ClientFromContext(ctx)