@@ -22,17 +22,13 @@ class TestCode(File):
2222 Inherits from the base `File` class and adds a `vuln_type` attribute
2323 specific to this dataset.
2424
25- Attributes:
26- vuln_type (str): The type of vulnerability present in the file.
27-
2825 """
2926
3027 def __init__ (
3128 self ,
3229 filepath : Path ,
3330 content : str | bytes ,
3431 cwes : list [CWE ],
35- vuln_type : str ,
3632 has_vuln : bool ,
3733 ) -> None :
3834 """Initialize a TestCode instance.
@@ -41,16 +37,13 @@ def __init__(
4137 filepath: The path to the file.
4238 content: The content of the file, as a string or bytes.
4339 cwes: A list of CWEs associated with the file.
44- vuln_type: The type of vulnerability.
4540 has_vuln: A boolean indicating if the vulnerability is real or a false positive test case.
4641
4742 """
4843 super ().__init__ (
4944 filepath = filepath , content = content , cwes = cwes , has_vuln = has_vuln
5045 )
5146
52- self .vuln_type = vuln_type
53-
5447
5548class BenchmarkJava (PrebuiltFileDataset ):
5649 """Represents the BenchmarkJava dataset.
@@ -151,14 +144,12 @@ def load_dataset(self) -> list[TestCode]:
151144 filepath = testcode_dir / filename
152145 content = filepath .read_text ()
153146 cwes = [CWEs .from_id (int (row [3 ]))]
154- vuln_type = row [1 ]
155147 has_vuln = True if row [2 ] == "true" else False
156148 files .append (
157149 TestCode (
158150 filepath .relative_to (self .directory ),
159151 content ,
160152 cwes ,
161- vuln_type ,
162153 has_vuln ,
163154 )
164155 )
0 commit comments