Package crypto.reporting
Class Reporter
- java.lang.Object
-
- crypto.analysis.CrySLAnalysisListener
-
- crypto.reporting.ErrorMarkerListener
-
- crypto.reporting.Reporter
-
- All Implemented Interfaces:
ICrySLPerformanceListener,ICrySLResultsListener
- Direct Known Subclasses:
CommandLineReporter,CSVReporter,CSVSummaryReporter,GitHubAnnotationReporter,SARIFReporter,TXTReporter
public abstract class Reporter extends ErrorMarkerListener
Superclass for all reporters. This class is used to define and implement the basic parts, which all reporter should be able to support. This includes the computation of all statistics for the analysis and the basic logic for methods defined in theICrySLResultsListener. This class is abstract. Subclasses have to call the constructor and overwrite the method handleAnalysisResults(), which is called after the analysis is finished.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.base.StopwatchanalysisWatchThe stopwatch to measure to time for the actual analysisprotected Set<soot.SootMethod>dataflowReachableMethodsASetto store and count all reachable methods in the dataflowprotected Collection<IAnalysisSeed>objectsACollectionto store and count all analyzed objectsprotected ReportStatisticsstatisticsAn instance ofReportStatisticsto store all relevant analysis statistics-
Fields inherited from class crypto.reporting.ErrorMarkerListener
errorMarkerCount, errorMarkers, secureObjects
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidafterAnalysis()voidbeforeAnalysis()voiddiscoveredSeed(IAnalysisSeed object)Collection<IAnalysisSeed>getObjects()FilegetOutputFolder()List<CrySLRule>getRules()ReportStatisticsgetStatistics()abstract voidhandleAnalysisResults()This method is called after the analysis is finished and all statistics have been computed.booleanincludeStatistics()voidonSeedFinished(IAnalysisSeed seed, boomerang.results.ForwardBoomerangResults<typestate.TransitionFunction> forwardResults)-
Methods inherited from class crypto.reporting.ErrorMarkerListener
addProgress, afterConstraintCheck, afterPredicateCheck, beforeConstraintCheck, beforePredicateCheck, boomerangQueryFinished, boomerangQueryStarted, checkedConstraints, collectedValues, ensuredPredicates, filterQuotes, onSecureObjectFound, onSeedTimeout, reportError, seedStarted
-
-
-
-
Field Detail
-
statistics
protected final ReportStatistics statistics
An instance ofReportStatisticsto store all relevant analysis statistics
-
analysisWatch
protected final com.google.common.base.Stopwatch analysisWatch
The stopwatch to measure to time for the actual analysis
-
objects
protected final Collection<IAnalysisSeed> objects
ACollectionto store and count all analyzed objects
-
-
Constructor Detail
-
Reporter
public Reporter(File outputFolder, String softwareID, List<CrySLRule> rules, long callgraphConstructionTime, boolean includeStatistics)
The constructor to initialize all attributes. Since this class is abstract, all subclasses have to call this constructor.- Parameters:
outputFolder- AFilefor the location of the report directory. The reportPath should end without an ending file separator.softwareID- AStringfor the analyzed software.rules- AListofCrySLRulecontaining the rules the program is analyzed with.callgraphConstructionTime- The time in milliseconds for the construction of the callgraph.includeStatistics- Set this value to true, if the analysis report should contain some analysis statistics (e.g. the callgraph construction time). If this value is set to false, no statistics will be output.
-
-
Method Detail
-
getOutputFolder
public File getOutputFolder()
-
includeStatistics
public boolean includeStatistics()
-
getStatistics
public ReportStatistics getStatistics()
-
getObjects
public Collection<IAnalysisSeed> getObjects()
-
beforeAnalysis
public void beforeAnalysis()
- Specified by:
beforeAnalysisin interfaceICrySLPerformanceListener- Overrides:
beforeAnalysisin classErrorMarkerListener
-
discoveredSeed
public void discoveredSeed(IAnalysisSeed object)
- Specified by:
discoveredSeedin interfaceICrySLResultsListener- Overrides:
discoveredSeedin classErrorMarkerListener
-
onSeedFinished
public void onSeedFinished(IAnalysisSeed seed, boomerang.results.ForwardBoomerangResults<typestate.TransitionFunction> forwardResults)
- Specified by:
onSeedFinishedin interfaceICrySLResultsListener- Overrides:
onSeedFinishedin classErrorMarkerListener
-
afterAnalysis
public void afterAnalysis()
- Specified by:
afterAnalysisin interfaceICrySLPerformanceListener- Overrides:
afterAnalysisin classErrorMarkerListener
-
handleAnalysisResults
public abstract void handleAnalysisResults()
This method is called after the analysis is finished and all statistics have been computed. A subclass can override this method to extend the actions after the analysis, e.g. creating an analysis report and write it into a file.
-
-