Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add HTML report without JS #5053

Merged
merged 2 commits into from Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -229,12 +229,12 @@ public class Check extends Update {
*/
private Boolean autoUpdate;
/**
* The report format to be generated (HTML, XML, JUNIT, CSV, JSON, SARIF,
* The report format to be generated (HTML, XML, JUNIT, CSV, JSON, SARIF, JENKINS,
* ALL). Default is HTML.
*/
private String reportFormat = "HTML";
/**
* The report format to be generated (HTML, XML, JUNIT, CSV, JSON, SARIF,
* The report format to be generated (HTML, XML, JUNIT, CSV, JSON, SARIF, JENKINS,
* ALL). Default is HTML.
*/
private final List<String> reportFormats = new ArrayList<>();
Expand Down Expand Up @@ -2111,7 +2111,7 @@ private void checkForFailure(Dependency[] dependencies) throws BuildException {

/**
* An enumeration of supported report formats: "ALL", "HTML", "XML", "CSV",
* "JSON", "JUNIT", "SARIF", etc..
* "JSON", "JUNIT", "SARIF", 'JENkINS', etc..
*/
public static class ReportFormats extends EnumeratedAttribute {

Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/java/org/owasp/dependencycheck/CliParser.java
Expand Up @@ -64,7 +64,7 @@ public final class CliParser {
/**
* The supported reported formats.
*/
private static final String SUPPORTED_FORMATS = "HTML, XML, CSV, JSON, JUNIT, SARIF, or ALL";
private static final String SUPPORTED_FORMATS = "HTML, XML, CSV, JSON, JUNIT, SARIF, JENKINS, or ALL";

/**
* Constructs a new CLI Parser object with the configured settings.
Expand Down
Expand Up @@ -116,6 +116,10 @@ public enum Format {
* Generate Sarif report.
*/
SARIF,
/**
* Generate HTML report without script or non-vulnerable libraries for Jenkins.
*/
JENKINS,
/**
* Generate JUNIT report.
*/
Expand Down Expand Up @@ -373,6 +377,9 @@ public static File getReportFile(String outputLocation, Format format) {
if (format == Format.HTML && !pathToCheck.endsWith(".html") && !pathToCheck.endsWith(".htm")) {
return new File(outFile, "dependency-check-report.html");
}
if (format == Format.JENKINS && !pathToCheck.endsWith(".html") && !pathToCheck.endsWith(".htm")) {
return new File(outFile, "dependency-check-jenkins.html");
}
if (format == Format.JSON && !pathToCheck.endsWith(".json")) {
return new File(outFile, "dependency-check-report.json");
}
Expand Down