ppt4j 1.0
 
All Classes Namespaces Files Functions Variables Pages
Loading...
Searching...
No Matches
ppt4j.analysis.patch.PatchAnalyzer Class Reference

Public Member Functions

 PatchAnalyzer (Vulnerability cve, ExtractorFactory factory) throws IOException
 
 PatchAnalyzer (Vulnerability cve, DatabaseType type) throws IOException
 
PatchAnalyzer filterIfMatch (String... patterns)
 
PatchAnalyzer filterIfNotMatch (String... patterns)
 
boolean analyze () throws IOException
 

Static Public Member Functions

static void main (String[] args) throws IOException
 

Constructor & Destructor Documentation

◆ PatchAnalyzer() [1/2]

ppt4j.analysis.patch.PatchAnalyzer.PatchAnalyzer ( Vulnerability cve,
ExtractorFactory factory ) throws IOException

◆ PatchAnalyzer() [2/2]

ppt4j.analysis.patch.PatchAnalyzer.PatchAnalyzer ( Vulnerability cve,
DatabaseType type ) throws IOException

Member Function Documentation

◆ analyze()

boolean ppt4j.analysis.patch.PatchAnalyzer.analyze ( ) throws IOException

Analyzes the patch for a specific CVE (Common Vulnerabilities and Exposures) entry. It processes the differences between the patched files and the original files, identifying pure additions, pure deletions, and modifications. It calculates a similarity score between the additions and deletions, and determines if the patch is present based on a threshold.

Returns
true if the patch is present, false otherwise
Exceptions
IOExceptionif an I/O error occurs during analysis

◆ filterIfMatch()

PatchAnalyzer ppt4j.analysis.patch.PatchAnalyzer.filterIfMatch ( String... patterns)

Adds the given patterns to the list of filters to be applied during matching analysis.

Parameters
patternsthe patterns to add to the filter list
Returns
the PatchAnalyzer object to allow method chaining

◆ filterIfNotMatch()

PatchAnalyzer ppt4j.analysis.patch.PatchAnalyzer.filterIfNotMatch ( String... patterns)

Adds the specified patterns to the list of patterns to filter if they do not match.

Parameters
patternsthe patterns to be added to the filterNotMatch list
Returns
the PatchAnalyzer object with the updated filterNotMatch list

◆ main()

static void ppt4j.analysis.patch.PatchAnalyzer.main ( String[] args) throws IOException
static

This method is the entry point of the PatchAnalyzer program. It takes in two command line arguments: dataset id and database type (PREPATCH or POSTPATCH). It then creates a new PatchAnalyzer object and calls the analyze method to perform analysis on the specified dataset with the given database type.

Parameters
argsThe command line arguments containing dataset id and database type
Exceptions
IOExceptionIf an I/O error occurs

The documentation for this class was generated from the following file: