mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-13 23:33:37 +01:00
spelling corrections
Former-commit-id: 65fbce0a7f47161c2cc5f9c5327ce5f18cc483c1
This commit is contained in:
@@ -340,7 +340,7 @@ public class Engine {
|
||||
try {
|
||||
a.analyze(d, this);
|
||||
} catch (AnalysisException ex) {
|
||||
final String exMsg = String.format("An error occured while analyzing '%s'.", d.getActualFilePath());
|
||||
final String exMsg = String.format("An error occurred while analyzing '%s'.", d.getActualFilePath());
|
||||
Logger.getLogger(Engine.class.getName()).log(Level.WARNING, exMsg);
|
||||
Logger.getLogger(Engine.class.getName()).log(Level.FINE, "", ex);
|
||||
} catch (Throwable ex) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class AbstractFileTypeAnalyzer extends AbstractAnalyzer implemen
|
||||
try {
|
||||
enabled = Settings.getBoolean(key, true);
|
||||
} catch (InvalidSettingException ex) {
|
||||
String msg = String.format("Invalid settting for property '%s'", key);
|
||||
String msg = String.format("Invalid setting for property '%s'", key);
|
||||
LOGGER.log(Level.WARNING, msg);
|
||||
LOGGER.log(Level.FINE, "", ex);
|
||||
msg = String.format("%s has been disabled", getName());
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractFileTypeAnalyzer extends AbstractAnalyzer implemen
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="Field defentitions">
|
||||
//<editor-fold defaultstate="collapsed" desc="Field definitions">
|
||||
/**
|
||||
* The logger.
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,7 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
/**
|
||||
* The list of supported extensions
|
||||
*/
|
||||
private static final Set<String> SUPORTED_EXTENSIONS = newHashSet("dll", "exe");
|
||||
private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("dll", "exe");
|
||||
/**
|
||||
* The temp value for GrokAssembly.exe
|
||||
*/
|
||||
@@ -238,16 +238,16 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
final XPath xpath = XPathFactory.newInstance().newXPath();
|
||||
final String error = xpath.evaluate("/assembly/error", doc);
|
||||
if (p.waitFor() != 1 || error == null || "".equals(error)) {
|
||||
LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details.");
|
||||
LOG.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details.");
|
||||
LOG.fine("GrokAssembly.exe is not working properly");
|
||||
grokAssemblyExe = null;
|
||||
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
LOG.warning("An error occured with the .NET AssemblyAnalyzer; "
|
||||
LOG.warning("An error occurred with the .NET AssemblyAnalyzer; "
|
||||
+ "this can be ignored unless you are scanning .NET dlls. Please see the log for more details.");
|
||||
LOG.log(Level.FINE, "Could not execute GrokAssembly {0}", e.getMessage());
|
||||
throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e);
|
||||
throw new AnalysisException("An error occurred with the .NET AssemblyAnalyzer", e);
|
||||
} finally {
|
||||
if (rdr != null) {
|
||||
try {
|
||||
@@ -280,7 +280,7 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSupportedExtensions() {
|
||||
return SUPORTED_EXTENSIONS;
|
||||
return SUPPORTED_EXTENSIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.owasp.dependencycheck.suppression.SuppressionRule;
|
||||
*/
|
||||
public class CpeSuppressionAnalyzer extends AbstractSuppressionAnalyzer {
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.owasp.dependencycheck.dependency.VulnerableSoftware;
|
||||
*/
|
||||
public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
@@ -156,7 +156,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
||||
* Regex to identify core java libraries and a few other commonly misidentified ones.
|
||||
*/
|
||||
public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
|
||||
+ "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
|
||||
+ "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
|
||||
+ "jdk|jre|jsf|jsse)($|:.*)");
|
||||
/**
|
||||
* Regex to identify core java library files. This is currently incomplete.
|
||||
@@ -179,7 +179,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
||||
itr.remove();
|
||||
}
|
||||
|
||||
//replacecd with the regex above.
|
||||
//replaced with the regex above.
|
||||
// if (("cpe:/a:sun:java".equals(i.getValue())
|
||||
// || "cpe:/a:oracle:java".equals(i.getValue())
|
||||
// || "cpe:/a:ibm:java".equals(i.getValue())
|
||||
@@ -242,7 +242,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
||||
//Set<Evidence> artifactId = dependency.getVendorEvidence().getEvidence("pom", "artifactid");
|
||||
while (itr.hasNext()) {
|
||||
final Identifier i = itr.next();
|
||||
//TODO move this startswith expression to a configuration file?
|
||||
//TODO move this startsWith expression to a configuration file?
|
||||
if ("cpe".equals(i.getType())) {
|
||||
if ((i.getValue().matches(".*c\\+\\+.*")
|
||||
|| i.getValue().startsWith("cpe:/a:jquery:jquery")
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.owasp.dependencycheck.utils.DependencyVersionUtil;
|
||||
*/
|
||||
public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.owasp.dependencycheck.dependency.Evidence;
|
||||
*/
|
||||
public class HintAnalyzer extends AbstractAnalyzer implements Analyzer {
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
|
||||
@@ -364,7 +364,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
*
|
||||
* @param jar the JarFile to search
|
||||
* @return a list of pom.xml entries
|
||||
* @throws IOException thrown if there is an exception reading a JarEntryf
|
||||
* @throws IOException thrown if there is an exception reading a JarEntry
|
||||
*/
|
||||
private List<String> retrievePomListing(final JarFile jar) throws IOException {
|
||||
final List<String> pomEntries = new ArrayList<String>();
|
||||
@@ -408,7 +408,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
bos.flush();
|
||||
dependency.setActualFilePath(file.getAbsolutePath());
|
||||
} catch (IOException ex) {
|
||||
final String msg = String.format("An error occured reading '%s' from '%s'.", path, dependency.getFilePath());
|
||||
final String msg = String.format("An error occurred reading '%s' from '%s'.", path, dependency.getFilePath());
|
||||
LOGGER.warning(msg);
|
||||
LOGGER.log(Level.SEVERE, "", ex);
|
||||
} finally {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class JavaScriptAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
*/
|
||||
private static final Logger LOGGER = Logger.getLogger(JavaScriptAnalyzer.class.getName());
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer">
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
@@ -107,7 +107,7 @@ public class JavaScriptAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
*/
|
||||
@Override
|
||||
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
|
||||
BufferedReader fin = null;;
|
||||
BufferedReader fin = null;
|
||||
try {
|
||||
// /\*([^\*][^/]|[\r\n\f])+?\*/
|
||||
final Pattern extractComments = Pattern.compile("(/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/)|(//.*)", Pattern.MULTILINE);
|
||||
|
||||
@@ -168,7 +168,7 @@ public class NexusAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
LOGGER.info(String.format("invalid sha-1 hash on %s", dependency.getFileName()));
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
//dependency.addAnalysisException(new AnalysisException("Artifact not found on repository"));
|
||||
LOGGER.fine(String.format("Artificat not found in repository '%s'", dependency.getFileName()));
|
||||
LOGGER.fine(String.format("Artifact not found in repository '%s'", dependency.getFileName()));
|
||||
LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
|
||||
} catch (IOException ioe) {
|
||||
//dependency.addAnalysisException(new AnalysisException("Could not connect to repository", ioe));
|
||||
|
||||
@@ -83,7 +83,7 @@ public class NexusSearch {
|
||||
*
|
||||
* @param sha1 The SHA-1 hash string for which to search
|
||||
* @return the populated Maven coordinates
|
||||
* @throws IOException if it's unable to connect to the specified repositor or if the specified artifact is not
|
||||
* @throws IOException if it's unable to connect to the specified repository or if the specified artifact is not
|
||||
* found.
|
||||
*/
|
||||
public MavenArtifact searchSha1(String sha1) throws IOException {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class NuspecParseException extends Exception {
|
||||
* Note that the detail message associated with <code>cause</code> is <em>not</em>
|
||||
* automatically incorporated in this exception's detail message.
|
||||
*
|
||||
* @param message the detail message (whcih is saved for later retrieval by the
|
||||
* @param message the detail message (which is saved for later retrieval by the
|
||||
* {@link java.lang.Throwable#getMessage()} method.
|
||||
* @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method).
|
||||
* (A <code>null</code> value is permitted, and indicates that the cause is nonexistent or unknown).
|
||||
|
||||
@@ -168,7 +168,7 @@ public final class ConnectionFactory {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, "An error occured closing the connection", ex);
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, "An error occurred closing the connection", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,10 +184,10 @@ public final class ConnectionFactory {
|
||||
try {
|
||||
DriverManager.deregisterDriver(driver);
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, "An error occured unloading the databse driver", ex);
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, "An error occurred unloading the database driver", ex);
|
||||
} catch (Throwable unexpected) {
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE,
|
||||
"An unexpected throwable occured unloading the databse driver", unexpected);
|
||||
"An unexpected throwable occurred unloading the database driver", unexpected);
|
||||
}
|
||||
driver = null;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class DatabaseProperties {
|
||||
final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
final String formatted = format.format(date);
|
||||
map.put(key, formatted);
|
||||
} catch (Throwable ex) { //deliberatly being broad in this catch clause
|
||||
} catch (Throwable ex) { //deliberately being broad in this catch clause
|
||||
Logger.getLogger(DatabaseProperties.class.getName()).log(Level.FINE, "Unable to parse timestamp from DB", ex);
|
||||
map.put(key, entry.getValue());
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public final class DriverLoader {
|
||||
/**
|
||||
* Loads the specified class by registering the supplied paths to the class loader and then registers the driver
|
||||
* with the driver manager. The pathToDriver argument is added to the class loader so that an external driver can be
|
||||
* loaded. Note, the pathTodriver can contain a semi-colon separated list of paths so any dependencies can be added
|
||||
* loaded. Note, the pathToDriver can contain a semi-colon separated list of paths so any dependencies can be added
|
||||
* as needed. If a path in the pathToDriver argument is a directory all files in the directory are added to the
|
||||
* class path.
|
||||
*
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MavenNamespaceFilter extends XMLFilterImpl {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicatees the start of the document.
|
||||
* Indicates the start of the document.
|
||||
*
|
||||
* @param uri the uri
|
||||
* @param localName the localName
|
||||
|
||||
@@ -47,10 +47,10 @@ public class DependencyVersion implements Iterable, Comparable<DependencyVersion
|
||||
|
||||
/**
|
||||
* Constructor for a DependencyVersion that will parse a version string.
|
||||
* <b>Note</b>, this should only be used when the version passed in is already known to be a well formated version
|
||||
* <b>Note</b>, this should only be used when the version passed in is already known to be a well formatted version
|
||||
* number. Otherwise, DependencyVersionUtil.parseVersion() should be used instead.
|
||||
*
|
||||
* @param version the well formated version number to parse
|
||||
* @param version the well formatted version number to parse
|
||||
*/
|
||||
public DependencyVersion(String version) {
|
||||
parseVersion(version);
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class URLConnectionFactory {
|
||||
try {
|
||||
if (proxyUrl != null) {
|
||||
final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
|
||||
final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
|
||||
final SocketAddress address = new InetSocketAddress(proxyUrl, proxyPort);
|
||||
|
||||
final String username = Settings.getString(Settings.KEYS.PROXY_USERNAME);
|
||||
final String password = Settings.getString(Settings.KEYS.PROXY_PASSWORD);
|
||||
@@ -72,7 +72,7 @@ public final class URLConnectionFactory {
|
||||
Authenticator.setDefault(auth);
|
||||
}
|
||||
|
||||
proxy = new Proxy(Proxy.Type.HTTP, addr);
|
||||
proxy = new Proxy(Proxy.Type.HTTP, address);
|
||||
conn = (HttpURLConnection) url.openConnection(proxy);
|
||||
} else {
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class VulnerabilitySuppressionAnalyzerTest extends AbstractDatabaseTestCa
|
||||
@Test
|
||||
public void testGetAnalysisPhase() {
|
||||
VulnerabilitySuppressionAnalyzer instance = new VulnerabilitySuppressionAnalyzer();
|
||||
AnalysisPhase expResult = AnalysisPhase.POST_FINDING_ANALYSIS;;
|
||||
AnalysisPhase expResult = AnalysisPhase.POST_FINDING_ANALYSIS;
|
||||
AnalysisPhase result = instance.getAnalysisPhase();
|
||||
assertEquals(expResult, result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user