go-graphite / carbonapi

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
7 days ago8 months old
func doTagQuery has a cyclomatic complexity of 20 with "high" risk
552	return nil, nil, types.ErrNotSupportedByBackend
553}
554
555func (c *IronDBGroup) doTagQuery(ctx context.Context, isTagName bool, query string, limit int64) ([]string, merry.Error) {556	logger := c.logger
557	params := make(map[string][]string)
558	var result []string
func Fetch has a cyclomatic complexity of 25 with "high" risk
271	return e
272}
273
274func (c *IronDBGroup) Fetch(ctx context.Context, request *protov3.MultiFetchRequest) (*protov3.MultiFetchResponse, *types.Stats, merry.Error) {275	logger := c.logger.With(zap.String("type", "fetch"), zap.String("request", request.String()))
276	stats := &types.Stats{}
277
func NewWithLimiter has a cyclomatic complexity of 22 with "high" risk
 50	graphitePrefix string
 51}
 52
 53func NewWithLimiter(logger *zap.Logger, config types.BackendV2, tldCacheDisabled, requireSuccessAll bool, limiter limiter.ServerLimiter) (types.BackendServer, merry.Error) { 54	logger = logger.With(zap.String("type", "irondb"), zap.String("protocol", config.Protocol), zap.String("name", config.GroupName))
 55
 56	logger.Warn("support for this backend protocol is experimental, use with caution")
func Metrics has a cyclomatic complexity of 47 with "very-high" risk
141	return expr, exist
142}
143
144func (e *expr) Metrics(from, until int64) []MetricRequest {145	switch e.etype {
146	case EtName:
147		return []MetricRequest{{Metric: e.target, From: from, Until: until}}
func Fetch has a cyclomatic complexity of 22 with "high" risk
 26	passFunctionsToBackend bool
 27}
 28
 29func (eval Evaluator) Fetch(ctx context.Context, exprs []parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (map[parser.MetricRequest][]*types.MetricData, error) { 30	if err := eval.limiter.Enter(ctx); err != nil {
 31		return nil, err
 32	}