@@ -49,9 +49,13 @@ def set_oss_items(self, new_oss_list, exclude=False, exclude_msg=""):
49
49
# Append New input OSS
50
50
self .oss_items .extend (new_oss_list )
51
51
52
- def get_vulnerability_items (self ):
53
- nvd_url = [urllib .parse .unquote (vul_item .nvd_url ) for vul_item in self .vulnerability_items ]
54
- return ", " .join (nvd_url ).strip ()
52
+ def get_vulnerability_items (self , oss ):
53
+ nvd_url = set ([urllib .parse .unquote (vul_item .nvd_url ) for vul_item in self .vulnerability_items ])
54
+ nvd_url = ", " .join (nvd_url ).strip ()
55
+
56
+ if nvd_url and len (nvd_url ) > MAX_EXCEL_URL_LENGTH :
57
+ oss .comment += f"\n Exceeded the maximum vulnerability URL length of { MAX_EXCEL_URL_LENGTH } characters."
58
+ return nvd_url
55
59
56
60
def get_print_binary_only (self ):
57
61
return (self .source_name_or_path + "\t " + self .checksum + "\t " + self .tlsh )
@@ -62,12 +66,7 @@ def get_print_array(self):
62
66
for oss in self .oss_items :
63
67
lic = "," .join (oss .license )
64
68
exclude = EXCLUDE_TRUE_VALUE if (self .exclude or oss .exclude ) else ""
65
- nvd_url = self .get_vulnerability_items ()
66
- if nvd_url and len (nvd_url ) > MAX_EXCEL_URL_LENGTH :
67
- logger .info (f"self.source_name_or_path: { self .source_name_or_path } " )
68
- logger .info (f"oss name: { oss .name } " )
69
- logger .info (f"length_url:{ len (nvd_url )} , nvd_url: { nvd_url } " )
70
- nvd_url = nvd_url [:242 ] + '...(truncated)'
69
+ nvd_url = self .get_vulnerability_items (oss )
71
70
items .append ([self .source_name_or_path , oss .name , oss .version ,
72
71
lic , oss .download_location , oss .homepage ,
73
72
oss .copyright , exclude , oss .comment ,
0 commit comments