Reliability based code calibration