Some of the rules have errors with the documentation. There are two problems:
Some Rules have more detections listed as possible than can actually be detected
Some Rule have less detections listed than can be detected.
We need to come up with a strategy to detect when detections aren't documented properly.
A place to start is in the Validator Project, in class
org.immregistries.mqe.validator.engine.ValidationRule
Method buildResults(...)
one possible way to detect the EXTRA detections that aren't documented:
for (ValidationReport vr : issues) {
MqeDetection d = vr.getDetection();
String mqeCode = d.getMqeMqeCode();
Detection detection = Detection.getByMqeErrorCodeString(mqeCode);
if (!ruleDetections.contains(detection)) {
//blow up really bad
throw new UnsupportedOperationException(
"Somehow you triggered a detection that wasn't listed in the possible detections for this rule");
}
}
We wouldn't want it to run all the time when the code is being run for a real process, but we would want to run it during unit tests.
Other ideas needed for having too many detections listed as possible.
Some of the rules have errors with the documentation. There are two problems:
We need to come up with a strategy to detect when detections aren't documented properly.
A place to start is in the Validator Project, in class org.immregistries.mqe.validator.engine.ValidationRule
Method buildResults(...)
one possible way to detect the EXTRA detections that aren't documented: for (ValidationReport vr : issues) { MqeDetection d = vr.getDetection(); String mqeCode = d.getMqeMqeCode(); Detection detection = Detection.getByMqeErrorCodeString(mqeCode); if (!ruleDetections.contains(detection)) { //blow up really bad throw new UnsupportedOperationException( "Somehow you triggered a detection that wasn't listed in the possible detections for this rule"); } }
We wouldn't want it to run all the time when the code is being run for a real process, but we would want to run it during unit tests.
Other ideas needed for having too many detections listed as possible.