func getFailureThresholds()

in internal/platform/thresholds.go [33:65]


func getFailureThresholds(c thirdpartyscan.Context) map[string]string {
	yaml := c.QodanaYamlConfig()
	ret := make(map[string]string)
	if yaml.FailThreshold != nil {
		ret[severityAny] = strconv.Itoa(*yaml.FailThreshold)
	}
	if yaml.FailureConditions.SeverityThresholds != nil {
		thresholds := *yaml.FailureConditions.SeverityThresholds
		if thresholds.Any != nil {
			ret[severityAny] = strconv.Itoa(*thresholds.Any)
		}
		if thresholds.Critical != nil {
			ret[severityCritical] = strconv.Itoa(*thresholds.Critical)
		}
		if thresholds.High != nil {
			ret[severityHigh] = strconv.Itoa(*thresholds.High)
		}
		if thresholds.Moderate != nil {
			ret[severityModerate] = strconv.Itoa(*thresholds.Moderate)
		}
		if thresholds.Low != nil {
			ret[severityLow] = strconv.Itoa(*thresholds.Low)
		}
		if thresholds.Info != nil {
			ret[severityInfo] = strconv.Itoa(*thresholds.Info)
		}
	}
	if c.FailThreshold() != "" { // console option overrides the behavior
		ret = make(map[string]string)
		ret[severityAny] = c.FailThreshold()
	}
	return ret
}