convox / convox

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
11 hours ago8 months old
func ReleasePromote has a cyclomatic complexity of 22 with "high" risk
 96	return rs, nil
 97}
 98
 99func (p *Provider) ReleasePromote(app, id string, opts structs.ReleasePromoteOptions) error {100	a, err := p.AppGet(app)
101	if err != nil {
102		return errors.WithStack(err)
func processFromPod has a cyclomatic complexity of 19 with "high" risk
621	return v
622}
623
624func (p *Provider) processFromPod(pd ac.Pod) (*structs.Process, error) {625	app := pd.ObjectMeta.Labels["app"]
626
627	c, err := primaryContainer(pd.Spec.Containers, pd.ObjectMeta.Labels["app"])
func podSpecFromRunOptions has a cyclomatic complexity of 18 with "high" risk
525	return ps, nil
526}
527
528func (p *Provider) podSpecFromRunOptions(app, service string, opts structs.ProcessRunOptions) (*ac.PodSpec, error) {529	s, err := p.podSpecFromService(app, service, common.DefaultString(opts.Release, ""))
530	if err != nil {
531		return nil, errors.WithStack(err)
func podSpecFromService has a cyclomatic complexity of 19 with "high" risk
388	}
389}
390
391func (p *Provider) podSpecFromService(app, service, release string) (*ac.PodSpec, error) {392	a, err := p.AppGet(app)
393	if err != nil {
394		return nil, errors.WithStack(err)
func GetRackMetrics has a cyclomatic complexity of 17 with "high" risk
 30	}
 31}
 32
 33func (m *MetricScraperClient) GetRackMetrics(opts structs.MetricsOptions) (structs.Metrics, error) { 34	if m.host == "" {
 35		return nil, errors.WithStack(fmt.Errorf("unimplemented"))
 36	}