You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This currently uses file locations with the row indicating the message
index, as the framework does not yet have support for more fitting
location reporting for binary and time-based formats.
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not greater than {rule['is_greater_than']}.",
187
-
level=IssueSeverity.ERROR,
188
-
rule_uid=rule_uid,
214
+
register_issue(
215
+
result,
216
+
message,
217
+
index,
218
+
time,
219
+
rule_uid,
220
+
IssueSeverity.ERROR,
221
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not greater than {rule['is_greater_than']}.",
189
222
)
190
223
if (
191
224
"is_greater_than_or_equal_to"inrule
192
225
andnotvalue>=rule["is_greater_than_or_equal_to"]
193
226
):
194
-
result.register_issue(
195
-
checker_bundle_name=constants.BUNDLE_NAME,
196
-
checker_id=osirules_constants.CHECKER_ID,
197
-
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not greater or equal to {rule['is_greater_than_or_equal_to']}.",
198
-
level=IssueSeverity.ERROR,
199
-
rule_uid=rule_uid,
227
+
register_issue(
228
+
result,
229
+
message,
230
+
index,
231
+
time,
232
+
rule_uid,
233
+
IssueSeverity.ERROR,
234
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not greater or equal to {rule['is_greater_than_or_equal_to']}.",
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not less than {rule['is_less_than']}.",
206
-
level=IssueSeverity.ERROR,
207
-
rule_uid=rule_uid,
237
+
register_issue(
238
+
result,
239
+
message,
240
+
index,
241
+
time,
242
+
rule_uid,
243
+
IssueSeverity.ERROR,
244
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not less than {rule['is_less_than']}.",
208
245
)
209
246
if (
210
247
"is_less_than_or_equal_to"inrule
211
248
andnotvalue<=rule["is_less_than_or_equal_to"]
212
249
):
213
-
result.register_issue(
214
-
checker_bundle_name=constants.BUNDLE_NAME,
215
-
checker_id=osirules_constants.CHECKER_ID,
216
-
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not less or equal to {rule['is_less_than_or_equal_to']}.",
217
-
level=IssueSeverity.ERROR,
218
-
rule_uid=rule_uid,
250
+
register_issue(
251
+
result,
252
+
message,
253
+
index,
254
+
time,
255
+
rule_uid,
256
+
IssueSeverity.ERROR,
257
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not less or equal to {rule['is_less_than_or_equal_to']}.",
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not equal to {rule['is_equal_to']}.",
225
-
level=IssueSeverity.ERROR,
226
-
rule_uid=rule_uid,
260
+
register_issue(
261
+
result,
262
+
message,
263
+
index,
264
+
time,
265
+
rule_uid,
266
+
IssueSeverity.ERROR,
267
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not equal to {rule['is_equal_to']}.",
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not different from {rule['is_different_to']}.",
233
-
level=IssueSeverity.ERROR,
234
-
rule_uid=rule_uid,
270
+
register_issue(
271
+
result,
272
+
message,
273
+
index,
274
+
time,
275
+
rule_uid,
276
+
IssueSeverity.ERROR,
277
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not different from {rule['is_different_to']}.",
235
278
)
236
279
if"is_iso_country_code"inrule:
237
280
ifvalue>999orvalue<0:
238
-
result.register_issue(
239
-
checker_bundle_name=constants.BUNDLE_NAME,
240
-
checker_id=osirules_constants.CHECKER_ID,
241
-
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not a valid numeric ISO country code (must be between 000 and 999).",
242
-
level=IssueSeverity.ERROR,
243
-
rule_uid=rule_uid,
281
+
register_issue(
282
+
result,
283
+
message,
284
+
index,
285
+
time,
286
+
rule_uid,
287
+
IssueSeverity.ERROR,
288
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not a valid numeric ISO country code (must be between 000 and 999).",
244
289
)
245
290
ifiso3166.countries.get(value, None) isNone:
246
-
result.register_issue(
247
-
checker_bundle_name=constants.BUNDLE_NAME,
248
-
checker_id=osirules_constants.CHECKER_ID,
249
-
description=f"Message {index} at {time}: Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not a valid numeric ISO country code (not found in ISO 3166).",
250
-
level=IssueSeverity.WARNING,
251
-
rule_uid=rule_uid,
291
+
register_issue(
292
+
result,
293
+
message,
294
+
index,
295
+
time,
296
+
rule_uid,
297
+
IssueSeverity.ERROR,
298
+
description=f"Field '{field.name}' value {value} in message '{message.DESCRIPTOR.full_name}' is not a valid numeric ISO country code (not found in ISO 3166).",
252
299
)
253
300
if"is_globally_unique"inrule:
254
301
ifvalue.valueinid_message_map:
255
302
existing_message=id_message_map[value.value]
256
303
ifexisting_message!=message:
257
-
result.register_issue(
258
-
checker_bundle_name=constants.BUNDLE_NAME,
259
-
checker_id=osirules_constants.CHECKER_ID,
260
-
description=f"Message {index} at {time}: Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' is not globally unique, already used by different message '{existing_message.DESCRIPTOR.full_name}'.",
261
-
level=IssueSeverity.ERROR,
262
-
rule_uid=rule_uid,
304
+
register_issue(
305
+
result,
306
+
message,
307
+
index,
308
+
time,
309
+
rule_uid,
310
+
IssueSeverity.ERROR,
311
+
description=f"Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' is not globally unique, already used by different message '{existing_message.DESCRIPTOR.full_name}'.",
description=f"Message {index} at {time}: Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' does not refer to any existing message.",
271
-
level=IssueSeverity.ERROR,
272
-
rule_uid=rule_uid,
316
+
register_issue(
317
+
result,
318
+
message,
319
+
index,
320
+
time,
321
+
rule_uid,
322
+
IssueSeverity.ERROR,
323
+
description=f"Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' does not refer to any existing message.",
273
324
)
274
325
else:
275
326
# Check if referred message matches the expected type
description=f"Message {index} at {time}: Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' refers to message '{referred_message.DESCRIPTOR.full_name}', which does not match the expected type '{expected_type}'.",
282
-
level=IssueSeverity.ERROR,
283
-
rule_uid=rule_uid,
329
+
register_issue(
330
+
result,
331
+
message,
332
+
index,
333
+
time,
334
+
rule_uid,
335
+
IssueSeverity.ERROR,
336
+
description=f"Field '{field.name}' value {value.value} in message '{message.DESCRIPTOR.full_name}' refers to message '{referred_message.DESCRIPTOR.full_name}', which does not match the expected type '{expected_type}'.",
description=f"Message {index}: Version field value {message.version.version_major}.{message.version.version_minor}.{message.version.version_patch} is not the expected version {'.'.join([str(s) forsinexpected_version])}.",
409
-
level=IssueSeverity.ERROR,
410
-
rule_uid=exp_version_rule_uid,
465
+
register_issue(
466
+
result,
467
+
message,
468
+
index,
469
+
time,
470
+
exp_version_rule_uid,
471
+
IssueSeverity.ERROR,
472
+
description=f"Version field value {message.version.version_major}.{message.version.version_minor}.{message.version.version_patch} is not the expected version {'.'.join([str(s) forsinexpected_version])}.",
0 commit comments