Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
7 occurrences in this check
func Start has a cyclomatic complexity of 18 with "high" risk
225	return nil
226}
227
228func (r *run) Start(ctx context.Context) (<-chan error, error) {229	ech := make(chan error, 6)
230	var eech, iech, sech, oech, cech <-chan error
231	var err error
func New has a cyclomatic complexity of 30 with "very-high" risk
 50	egress        egress.Client
 51}
 52
 53func New(cfg *config.Data) (r runner.Runner, err error) { 54	if addrs := cfg.Client.Addrs; len(addrs) == 0 {
 55		return nil, errors.ErrGRPCTargetAddrNotFound
 56	}
func Upsert has a cyclomatic complexity of 19 with "high" risk
2864	return locs, errs
2865}
2866
2867func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc *payload.Object_Location, err error) {2868	ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpsertRPCName), apiName+"/"+vald.UpsertRPCName)
2869	defer func() {
2870		if span != nil {
func Update has a cyclomatic complexity of 19 with "high" risk
2612	return locs, errs
2613}
2614
2615func (s *server) Update(ctx context.Context, req *payload.Update_Request) (loc *payload.Object_Location, err error) {2616	ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.UpdateRPCName), apiName+"/"+vald.UpdateRPCName)
2617	defer func() {
2618		if span != nil {
func Insert has a cyclomatic complexity of 19 with "high" risk
2339	return res, errs
2340}
2341
2342func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (loc *payload.Object_Location, err error) {2343	ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.InsertRPCName), apiName+"/"+vald.InsertRPCName)
2344	defer func() {
2345		if span != nil {
func LinearSearch has a cyclomatic complexity of 18 with "high" risk
1859	return res, errs
1860}
1861
1862func (s *server) LinearSearch(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {1863	ctx, span := trace.StartSpan(ctx, apiName+"/"+vald.LinearSearchRPCName)
1864	defer func() {
1865		if span != nil {
func Search has a cyclomatic complexity of 19 with "high" risk
1358	return s.gateway.Exists(ctx, meta, s.copts...)
1359}
1360
1361func (s *server) Search(ctx context.Context, req *payload.Search_Request) (res *payload.Search_Response, err error) {1362	ctx, span := trace.StartSpan(grpc.WithGRPCMethod(ctx, vald.PackageName+"."+vald.FilterRPCServiceName+"/"+vald.SearchRPCName), apiName+"/"+vald.SearchRPCName)
1363	defer func() {
1364		if span != nil {