1919
2020/** This class contains a single vulnerability category. */
2121public class Category {
22- private String id ;
2322
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
2928
3029 /**
3130 * Create a vuln category.
@@ -35,43 +34,32 @@ public class Category {
3534 * @param cwe The associated CWE number.
3635 * @param isInjection Whether this vuln category is a type of injection attack.
3736 */
38- public Category (String id , String name , int cwe , boolean isInjection ) {
37+ public Category (String id , String name , int cwe , boolean isInjection , String shortname ) {
3938 this .id = id ;
4039 this .name = name ;
41- this .cwe = cwe ;
40+ this .CWE = cwe ;
4241 this .isInjection = isInjection ;
42+ this .shortName = shortname ;
4343 }
4444
4545 public String getId () {
46- return id ;
47- }
48-
49- public void setId (String id ) {
50- this .id = id ;
46+ return this .id ;
5147 }
5248
5349 public String getName () {
54- return name ;
50+ return this . name ;
5551 }
5652
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 ;
6755 }
6856
6957 public boolean isInjection () {
70- return isInjection ;
58+ return this . isInjection ;
7159 }
7260
73- public void setInjection ( boolean isInjection ) {
74- this .isInjection = isInjection ;
61+ public String getShortName ( ) {
62+ return this .shortName ;
7563 }
7664
7765 @ Override
0 commit comments