mirror of https://github.com/google/oss-fuzz.git
introspector_page: only display if numbers are accurate (#9545)
Some old reports e.g. https://storage.googleapis.com/oss-fuzz-introspector/upb/inspector-report/20221025/summary.json have deprecated data. We should not display this information. Only show if the percentage numbers make sense. Signed-off-by: David Korczynski <david@adalogics.com> Signed-off-by: David Korczynski <david@adalogics.com>
This commit is contained in:
parent
47bdea931b
commit
b048be69a8
|
@ -212,6 +212,15 @@ def refine_percentage_string(percentage_string):
|
|||
|
||||
if len(percentage_string) > 5:
|
||||
percentage_string = percentage_string[:5]
|
||||
|
||||
# Check if the percentage is withing range of [0.0 : 100.0]
|
||||
# Some old reports from 2022 have deprecated data, which we do not want to
|
||||
# display.
|
||||
float_val = float(percentage_string)
|
||||
if float_val < 0.0 or float_val > 100.0:
|
||||
# Raise exception to make the code display '-' elements.
|
||||
raise Exception('Out of range numbers')
|
||||
|
||||
return percentage_string + "%"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue