you can extract a method named _validateMetricConfiguration containing these 2 conditions