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 3
3
Date: 2021-12-24 10:56:10
4
4
version:
5
5
LastEditors: 饕餮
6
- LastEditTime: 2021-12-27 18:34:21
6
+ LastEditTime: 2021-12-27 18:55:58
7
7
Description: Vuln Object
8
8
'''
9
9
import json
@@ -39,8 +39,12 @@ def Id(self):
39
39
return self .TryGetValue ("level_id" )
40
40
41
41
class VulnSummary (BaseObject ):
42
- def __init__ (self ,jsonData ):
42
+ WithOutRiskLevel = ["无风险" ]
43
+
44
+ def __init__ (self ,jsonData ,withOutRiskLevel :list = None ):
43
45
self .ObjectData = jsonData
46
+ if withOutRiskLevel is not None :
47
+ self .WithOutRiskLevel = withOutRiskLevel
44
48
45
49
@property
46
50
def Language (self ) -> List [LanguageSummary ]:
@@ -93,11 +97,19 @@ def LowRisk(self):
93
97
else :
94
98
return None
95
99
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
+
96
108
@property
97
109
def Count (self ):
98
110
tmpCount = 0
99
111
for tmpLevel in self .Level :
100
- if tmpLevel .Level not in [ "无风险" , "提示" ] :
112
+ if tmpLevel .Level not in self . WithOutRiskLevel :
101
113
tmpCount += tmpLevel .Count
102
114
return tmpCount
103
115
You can’t perform that action at this time.
0 commit comments