go-graphite / carbonapi

Value assigned to a variable is never read before being overwritten SCC-SA4006
Bug risk
Major
3 months ago4 years old
this value of denominator is never used
386	if changed || len(numerator.Values) != len(denominator.Values) {
387		alignedSeries := ScaleToCommonStep(types.CopyMetricDataSlice(pair), step)
388		numerator = alignedSeries[0]
389		denominator = alignedSeries[1]390
391		return alignedSeries[0], alignedSeries[1]
392	}
this value of numerator is never used
385	step, changed := GetCommonStep(pair)
386	if changed || len(numerator.Values) != len(denominator.Values) {
387		alignedSeries := ScaleToCommonStep(types.CopyMetricDataSlice(pair), step)
388		numerator = alignedSeries[0]389		denominator = alignedSeries[1]
390
391		return alignedSeries[0], alignedSeries[1]
 47	refetch := false
 48	switch e.Arg(1).Type() {
 49	case parser.EtConst:
 50		windowPoints, err = e.GetIntArg(1) 51		argstr = strconv.Itoa(windowPoints)
 52		if windowPoints < 0 {
 53			// we only care about the absolute value