Package org.eclipse.steady.report
Class Report
- java.lang.Object
-
- org.eclipse.steady.report.Report
-
public class Report extends Object
Report class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReport.AggregatedVuln
-
Field Summary
Fields Modifier and Type Field Description static StringTHRESHOLD_ACT_EXEConstantTHRESHOLD_ACT_EXE="actuallyExecutes"static StringTHRESHOLD_DEP_ONConstantTHRESHOLD_DEP_ON="dependsOn"static StringTHRESHOLD_NONEConstantTHRESHOLD_NONE="noException"static StringTHRESHOLD_POT_EXEConstantTHRESHOLD_POT_EXE="potentiallyExecutes"
-
Constructor Summary
Constructors Constructor Description Report(GoalContext _ctx, Application _app, Set<Application> _modules)Constructor for Report.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchAppVulnerabilities()Downloads vulnerable dependencies for allApplications in member variablemodules.Map<String,String>getConfiguration()Returns a human-readable description of the configuration.StringgetExceptionMessage()getExceptionMessage.StringgetExceptionThreshold()Getter for the fieldexceptionThreshold.StringgetResultAsString()getResultAsString.Map<String,Long>getStats()Getter for the fieldstats.booleanisCreateAffectedLibraries()isCreateAffectedLibraries.booleanisThrowBuildException()Returns true if a build exception shall be thrown, which is the case if a threshold other thanTHRESHOLD_NONEis defined and vulnerabilities exist above this threshold.voidprocessVulnerabilities()Processes all the vulnerabilities of all application modules as obtained from the backend.voidsetCreateAffectedLibraries(boolean createAffectedLibraries)Setter for the fieldcreateAffectedLibraries.voidsetExceptionThreshold(String _threshold)Setter for the fieldexceptionThreshold.voidsetExemptions(ExemptionSet _exemptions)Setter for the fieldexcemptions.voidwriteResult(Path _dir)Creates result reports in HTML, XML and JSON.PathwriteResult(Path _dir, String _template, String _report)writeResult.PathwriteResultAsHtml(Path _dir)writeResultAsHtml.PathwriteResultAsJson(Path _dir)writeResultAsJson.PathwriteResultAsXml(Path _dir)writeResultAsXml.
-
-
-
Field Detail
-
THRESHOLD_NONE
public static final String THRESHOLD_NONE
ConstantTHRESHOLD_NONE="noException"- See Also:
- Constant Field Values
-
THRESHOLD_DEP_ON
public static final String THRESHOLD_DEP_ON
ConstantTHRESHOLD_DEP_ON="dependsOn"- See Also:
- Constant Field Values
-
THRESHOLD_POT_EXE
public static final String THRESHOLD_POT_EXE
ConstantTHRESHOLD_POT_EXE="potentiallyExecutes"- See Also:
- Constant Field Values
-
THRESHOLD_ACT_EXE
public static final String THRESHOLD_ACT_EXE
ConstantTHRESHOLD_ACT_EXE="actuallyExecutes"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Report
public Report(GoalContext _ctx, Application _app, Set<Application> _modules)
Constructor for Report.
- Parameters:
_ctx- aGoalContextobject._app- aApplicationobject._modules- aSetobject.
-
-
Method Detail
-
getExceptionThreshold
public String getExceptionThreshold()
Getter for the field
exceptionThreshold.- Returns:
- a
Stringobject.
-
setExceptionThreshold
public void setExceptionThreshold(String _threshold)
Setter for the field
exceptionThreshold.- Parameters:
_threshold- aStringobject.
-
isCreateAffectedLibraries
public boolean isCreateAffectedLibraries()
isCreateAffectedLibraries.
- Returns:
- a boolean
-
setCreateAffectedLibraries
public void setCreateAffectedLibraries(boolean createAffectedLibraries)
Setter for the field
createAffectedLibraries.- Parameters:
createAffectedLibraries- a boolean
-
setExemptions
public void setExemptions(ExemptionSet _exemptions)
Setter for the field
excemptions.- Parameters:
_exemptions- aSetofExemptionBugs.
-
fetchAppVulnerabilities
public void fetchAppVulnerabilities() throws IOException, BackendConnectionExceptionDownloads vulnerable dependencies for allApplications in member variablemodules. The member variablemodulesonly contains multipleApplications if the report is created through the Maven plugin and the respective Maven project (for which the report goal is executed) is a multi-module aggregator project. If both conditions are met, each project module corresponds to oneApplicationin member variablemodules.
-
processVulnerabilities
public void processVulnerabilities()
Processes all the vulnerabilities of all application modules as obtained from the backend. Populates the Velocitycontextrequired for rendering the templates inwriteResult(Path).
-
isThrowBuildException
public boolean isThrowBuildException()
Returns true if a build exception shall be thrown, which is the case if a threshold other thanTHRESHOLD_NONEis defined and vulnerabilities exist above this threshold.- Returns:
- a boolean.
-
getConfiguration
public Map<String,String> getConfiguration()
Returns a human-readable description of the configuration.- Returns:
- a
Mapobject.
-
getExceptionMessage
public String getExceptionMessage()
getExceptionMessage.
- Returns:
- a
Stringobject.
-
writeResult
public void writeResult(@NotNull Path _dir)Creates result reports in HTML, XML and JSON.- Parameters:
_dir- aPathobject.
-
writeResult
public Path writeResult(@NotNull Path _dir, String _template, String _report)
writeResult.
-
-