apppackio / apppack

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
2 months ago2 months old
func SetScaleParameter has a cyclomatic complexity of 19 with "high" risk
 982
 983// SetScaleParameter updates process count and cpu/ram with any non-nil values provided
 984// if it is not yet set, the defaults from ECSConfig will be used
 985func (a *App) SetScaleParameter(processType string, minProcessCount, maxProcessCount, cpu, memory *int) error { 986	ssmSvc := ssm.New(a.Session)
 987	var parameterName string
 988	if a.IsReviewApp() {
func DescribeTasks has a cyclomatic complexity of 18 with "high" risk
 780}
 781
 782// DescribeTasks generate a URL which will sign the user in to the AWS console and redirect to the desinationURL
 783func (a *App) DescribeTasks() ([]*ecs.Task, error) { 784	err := a.LoadSettings()
 785	if err != nil {
 786		return nil, err
func FlagsToStruct has a cyclomatic complexity of 16 with "high" risk
 42}
 43
 44// FlagsToStruct applies flag to a Struct using `flag` tags
 45func FlagsToStruct(s interface{}, flags *pflag.FlagSet) error { 46	ref := reflect.ValueOf(s).Elem()
 47	fields := reflect.VisibleFields(ref.Type())
 48	// get a list of all flags present in the command
func watchBuildPhase has a cyclomatic complexity of 16 with "high" risk
378	}
379}
380
381func watchBuildPhase(a *app.App, buildStatus *app.BuildStatus) error {382	ui.StartSpinner()
383	buildStatus, err := a.GetBuildStatus(buildStatus.BuildNumber)
384	if err != nil {
func StreamEvents has a cyclomatic complexity of 22 with "high" risk
266	return nil
267}
268
269func StreamEvents(sess *session.Session, logURL string, marker *string, stopTailing <-chan bool) error {270	var lastSeenTime *int64
271	var seenEventIDs map[string]bool
272	var markerStart *string