codacy recommended updates

This commit is contained in:
Jeremy Long
2017-02-17 14:20:43 -05:00
parent 36945fb84d
commit c9e8e6cf0e
17 changed files with 102 additions and 116 deletions

View File

@@ -606,7 +606,7 @@ public class Engine implements FileFilter {
* @param analyzer the analyzer to obtain an executor
* @return the executor service
*/
ExecutorService getExecutorService(Analyzer analyzer) {
protected ExecutorService getExecutorService(Analyzer analyzer) {
if (analyzer.supportsParallelProcessing()) {
// just a fair trade-off that should be reasonable for all analyzer types
final int maximumNumberOfThreads = 4 * Runtime.getRuntime().availableProcessors();

View File

@@ -810,10 +810,7 @@ public class CPEAnalyzer extends AbstractAnalyzer {
if (this.confidence != other.confidence) {
return false;
}
if (this.identifier != other.identifier && (this.identifier == null || !this.identifier.equals(other.identifier))) {
return false;
}
return true;
return !(this.identifier != other.identifier && (this.identifier == null || !this.identifier.equals(other.identifier)));
}
//</editor-fold>

View File

@@ -168,11 +168,6 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
//</editor-fold>
/**
* Constructs a new JarAnalyzer.
*/
public JarAnalyzer() {
}
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
/**

View File

@@ -44,10 +44,7 @@ public class NvdCveAnalyzer extends AbstractAnalyzer {
* The Logger for use throughout the class
*/
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(NvdCveAnalyzer.class);
/**
* The maximum number of query results to return.
*/
private static final int MAX_QUERY_RESULTS = 100;
/**
* The CVE Index.
*/

View File

@@ -53,12 +53,6 @@ public class NugetPackage {
*/
private String licenseUrl;
/**
* Creates an empty NugetPackage.
*/
public NugetPackage() {
}
/**
* Sets the id.
* @param id the id

View File

@@ -138,10 +138,7 @@ public class VulnerableSoftware extends IndexEntry implements Serializable, Comp
return false;
}
final VulnerableSoftware other = (VulnerableSoftware) obj;
if ((this.name == null) ? (other.getName() != null) : !this.name.equals(other.getName())) {
return false;
}
return true;
return !((this.name == null) ? (other.getName() != null) : !this.name.equals(other.getName()));
}
/**

View File

@@ -24,12 +24,15 @@ import org.slf4j.LoggerFactory;
/**
* <p>
* DependencyCheck uses {@link org.slf4j.Logger} as a logging framework, and Apache Velocity uses a custom logging implementation
* that outputs to a file named velocity.log by default. This class is an implementation of a custom Velocity logger that
* redirects all velocity logging to the Java Logger class.
* DependencyCheck uses {@link org.slf4j.Logger} as a logging framework, and
* Apache Velocity uses a custom logging implementation that outputs to a file
* named velocity.log by default. This class is an implementation of a custom
* Velocity logger that redirects all velocity logging to the Java Logger class.
* </p><p>
* This class was written to address permission issues when using Dependency-Check in a server environment (such as the Jenkins
* plugin). In some circumstances, Velocity would attempt to create velocity.log in an un-writable directory.</p>
* This class was written to address permission issues when using
* Dependency-Check in a server environment (such as the Jenkins plugin). In
* some circumstances, Velocity would attempt to create velocity.log in an
* un-writable directory.</p>
*
* @author Steve Springett
*/
@@ -51,7 +54,8 @@ public class VelocityLoggerRedirect implements LogChute {
}
/**
* Given a Velocity log level and message, this method will call the appropriate Logger level and log the specified values.
* Given a Velocity log level and message, this method will call the
* appropriate Logger level and log the specified values.
*
* @param level the logging level
* @param message the message to be logged
@@ -76,12 +80,13 @@ public class VelocityLoggerRedirect implements LogChute {
break;
default:
LOGGER.info(message);
break;
}
}
/**
* Given a Velocity log level, message and Throwable, this method will call the appropriate Logger level and log the specified
* values.
* Given a Velocity log level, message and Throwable, this method will call
* the appropriate Logger level and log the specified values.
*
* @param level the logging level
* @param message the message to be logged