File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 33Date: 2021-12-24 10:56:10
44version:
55LastEditors: 饕餮
6- LastEditTime: 2021-12-27 18:34:21
6+ LastEditTime: 2021-12-27 18:55:58
77Description: Vuln Object
88'''
99import json
@@ -39,8 +39,12 @@ def Id(self):
3939 return self .TryGetValue ("level_id" )
4040
4141class VulnSummary (BaseObject ):
42- def __init__ (self ,jsonData ):
42+ WithOutRiskLevel = ["无风险" ]
43+
44+ def __init__ (self ,jsonData ,withOutRiskLevel :list = None ):
4345 self .ObjectData = jsonData
46+ if withOutRiskLevel is not None :
47+ self .WithOutRiskLevel = withOutRiskLevel
4448
4549 @property
4650 def Language (self ) -> List [LanguageSummary ]:
@@ -93,11 +97,19 @@ def LowRisk(self):
9397 else :
9498 return None
9599
100+ @property
101+ def TipsRisk (self ):
102+ tmpData = [tmpLevel for tmpLevel in self .Level if tmpLevel .Level == "提示" ]
103+ if len (tmpData ) > 0 :
104+ return tmpData [0 ]
105+ else :
106+ return None
107+
96108 @property
97109 def Count (self ):
98110 tmpCount = 0
99111 for tmpLevel in self .Level :
100- if tmpLevel .Level not in [ "无风险" , "提示" ] :
112+ if tmpLevel .Level not in self . WithOutRiskLevel :
101113 tmpCount += tmpLevel .Count
102114 return tmpCount
103115
You can’t perform that action at this time.
0 commit comments