19
19
20
20
/** This class contains a single vulnerability category. */
21
21
public class Category {
22
- private String id ;
23
22
24
- private String name ;
25
-
26
- private int cwe ;
27
-
28
- private boolean isInjection ;
23
+ private final String id ; // e.g., pathtraver
24
+ private final String name ; // e.g., Path Traversal
25
+ private final int CWE ;
26
+ private final boolean isInjection ;
27
+ private final String shortName ; // PATH
29
28
30
29
/**
31
30
* Create a vuln category.
@@ -35,43 +34,32 @@ public class Category {
35
34
* @param cwe The associated CWE number.
36
35
* @param isInjection Whether this vuln category is a type of injection attack.
37
36
*/
38
- public Category (String id , String name , int cwe , boolean isInjection ) {
37
+ public Category (String id , String name , int cwe , boolean isInjection , String shortname ) {
39
38
this .id = id ;
40
39
this .name = name ;
41
- this .cwe = cwe ;
40
+ this .CWE = cwe ;
42
41
this .isInjection = isInjection ;
42
+ this .shortName = shortname ;
43
43
}
44
44
45
45
public String getId () {
46
- return id ;
47
- }
48
-
49
- public void setId (String id ) {
50
- this .id = id ;
46
+ return this .id ;
51
47
}
52
48
53
49
public String getName () {
54
- return name ;
50
+ return this . name ;
55
51
}
56
52
57
- public void setName (String name ) {
58
- this .name = name ;
59
- }
60
-
61
- public int getCwe () {
62
- return cwe ;
63
- }
64
-
65
- public void setCwe (int cwe ) {
66
- this .cwe = cwe ;
53
+ public int getCWE () {
54
+ return this .CWE ;
67
55
}
68
56
69
57
public boolean isInjection () {
70
- return isInjection ;
58
+ return this . isInjection ;
71
59
}
72
60
73
- public void setInjection ( boolean isInjection ) {
74
- this .isInjection = isInjection ;
61
+ public String getShortName ( ) {
62
+ return this .shortName ;
75
63
}
76
64
77
65
@ Override
0 commit comments