Skip to content

Commit a20fbe9

Browse files
authored
remove undefined from statistics #355 (#356)
1 parent 4559aa5 commit a20fbe9

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

tests/full/test_05_statistics.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def test_epss_stats(client, api_schema, patched_helper):
111111
)
112112
print(data)
113113
assert data == [
114-
{"range_group": "undefined", "count": 3},
115114
{"range_group": "0.0 - 0.1", "count": 552},
116115
{"range_group": "0.2 - 0.3", "count": 3},
117116
{"range_group": "0.3 - 0.4", "count": 1},
@@ -137,7 +136,6 @@ def test_cve_stats(client, api_schema, patched_helper):
137136
"created_since": {"d1": 103, "d7": 438, "d30": 438, "d365": 567},
138137
"by_year": [{"year": "2024", "count": 567}],
139138
"cvss_v2": [
140-
{"range_group": "undefined", "count": 512},
141139
{"range_group": "2.7 - 2.8", "count": 2},
142140
{"range_group": "3.3 - 3.4", "count": 2},
143141
{"range_group": "4.0 - 4.1", "count": 15},
@@ -148,7 +146,6 @@ def test_cve_stats(client, api_schema, patched_helper):
148146
{"range_group": "7.5 - 7.6", "count": 7},
149147
],
150148
"cvss_v3": [
151-
{"range_group": "undefined", "count": 7},
152149
{"range_group": "2.4 - 2.5", "count": 1},
153150
{"range_group": "3.3 - 3.4", "count": 1},
154151
{"range_group": "3.5 - 3.6", "count": 3},
@@ -192,7 +189,6 @@ def test_cve_stats(client, api_schema, patched_helper):
192189
{"range_group": "10", "count": 1},
193190
],
194191
"cvss_v4": [
195-
{"range_group": "undefined", "count": 526},
196192
{"range_group": "2.1 - 2.2", "count": 1},
197193
{"range_group": "5.1 - 5.2", "count": 4},
198194
{"range_group": "5.3 - 5.4", "count": 20},

vulmatch/server/statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def get_cve_numeric_stat(
303303
groups = []
304304
for group, cve_count in self.execute_query(query, bind_vars=dict(prop=prop)):
305305
if group is None:
306-
name = "undefined"
306+
continue
307307
elif group == 10 or (group == 1 and prop == 'x_opencti_epss_score'):
308308
name = str(int(group))
309309
else:

0 commit comments

Comments
 (0)