mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 15:54:52 +01:00
Removed Checkstyle and PMD violations.
This commit is contained in:
@@ -30,8 +30,6 @@ import java.io.OutputStream;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
|
||||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
|
||||||
import org.apache.maven.doxia.sink.Sink;
|
import org.apache.maven.doxia.sink.Sink;
|
||||||
import org.apache.maven.plugin.AbstractMojo;
|
import org.apache.maven.plugin.AbstractMojo;
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
@@ -50,7 +48,6 @@ import org.owasp.dependencycheck.dependency.Dependency;
|
|||||||
import org.owasp.dependencycheck.dependency.Identifier;
|
import org.owasp.dependencycheck.dependency.Identifier;
|
||||||
import org.owasp.dependencycheck.dependency.Vulnerability;
|
import org.owasp.dependencycheck.dependency.Vulnerability;
|
||||||
import org.owasp.dependencycheck.reporting.ReportGenerator;
|
import org.owasp.dependencycheck.reporting.ReportGenerator;
|
||||||
import org.owasp.dependencycheck.utils.DependencyVersion;
|
|
||||||
import org.owasp.dependencycheck.utils.Settings;
|
import org.owasp.dependencycheck.utils.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,18 +76,8 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
/**
|
/**
|
||||||
* The Maven Project Object.
|
* The Maven Project Object.
|
||||||
*/
|
*/
|
||||||
@Parameter(property = "project", required=true, readonly=true)
|
@Parameter(property = "project", required = true, readonly = true)
|
||||||
private MavenProject project;
|
private MavenProject project;
|
||||||
/**
|
|
||||||
* A reference to the local repository.
|
|
||||||
*/
|
|
||||||
@Parameter(property = "localRepository", readonly = true)
|
|
||||||
private ArtifactRepository localRepository;
|
|
||||||
/**
|
|
||||||
* References to the remote repositories.
|
|
||||||
*/
|
|
||||||
@Parameter(property = "project.remoteArtifactRepositories", readonly = true)
|
|
||||||
private List<ArtifactRepository> remoteRepositories;
|
|
||||||
/**
|
/**
|
||||||
* List of Maven project of the current build
|
* List of Maven project of the current build
|
||||||
*/
|
*/
|
||||||
@@ -434,7 +421,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
final Object obj = current.getContextValue(getDataFileContextKey());
|
final Object obj = current.getContextValue(getDataFileContextKey());
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
if (obj instanceof String) {
|
if (obj instanceof String) {
|
||||||
File f = new File((String) obj);
|
final File f = new File((String) obj);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -923,11 +910,9 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
file = new File(writeTo, dataFileName);
|
file = new File(writeTo, dataFileName);
|
||||||
}
|
}
|
||||||
final File parent = file.getParentFile();
|
final File parent = file.getParentFile();
|
||||||
if (!parent.isDirectory()) {
|
if (!parent.isDirectory() && parent.mkdirs()) {
|
||||||
if (parent.mkdirs()) {
|
getLog().error(String.format("Directory '%s' does not exist and cannot be created; unable to write data file.",
|
||||||
getLog().error(String.format("Directory '%s' does not exist and cannot be created; unable to write data file.",
|
parent.getAbsolutePath()));
|
||||||
parent.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputStream os = null;
|
OutputStream os = null;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Analyzer initializeAnalyzer(Analyzer analyzer) {
|
protected Analyzer initializeAnalyzer(Analyzer analyzer) {
|
||||||
if ((analyzer instanceof CPEAnalyzer)) {
|
if (analyzer instanceof CPEAnalyzer) {
|
||||||
CPEAnalyzer cpe = getPreviouslyLoadedCPEAnalyzer();
|
CPEAnalyzer cpe = getPreviouslyLoadedCPEAnalyzer();
|
||||||
if (cpe != null && cpe.isOpen()) {
|
if (cpe != null && cpe.isOpen()) {
|
||||||
return cpe;
|
return cpe;
|
||||||
@@ -152,7 +152,7 @@ public class Engine extends org.owasp.dependencycheck.Engine {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void closeAnalyzer(Analyzer analyzer) {
|
protected void closeAnalyzer(Analyzer analyzer) {
|
||||||
if ((analyzer instanceof CPEAnalyzer)) {
|
if (analyzer instanceof CPEAnalyzer) {
|
||||||
if (getPreviouslyLoadedCPEAnalyzer() == null) {
|
if (getPreviouslyLoadedCPEAnalyzer() == null) {
|
||||||
super.closeAnalyzer(analyzer);
|
super.closeAnalyzer(analyzer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import org.apache.maven.plugin.MojoFailureException;
|
|||||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
|
||||||
import org.owasp.dependencycheck.utils.Settings;
|
import org.owasp.dependencycheck.utils.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user