mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
minor codacy suggested changes
This commit is contained in:
@@ -37,6 +37,16 @@ import org.owasp.dependencycheck.utils.Settings;
|
||||
*/
|
||||
public class FileNameAnalyzer extends AbstractAnalyzer {
|
||||
|
||||
/**
|
||||
* Python init files
|
||||
*/
|
||||
//CSOFF: WhitespaceAfter
|
||||
private static final NameFileFilter IGNORED_FILES = new NameFileFilter(new String[]{
|
||||
"__init__.py",
|
||||
"__init__.pyc",
|
||||
"__init__.pyo",});
|
||||
//CSON: WhitespaceAfter
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
@@ -78,16 +88,6 @@ public class FileNameAnalyzer extends AbstractAnalyzer {
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
/**
|
||||
* Python init files
|
||||
*/
|
||||
//CSOFF: WhitespaceAfter
|
||||
private static final NameFileFilter IGNORED_FILES = new NameFileFilter(new String[]{
|
||||
"__init__.py",
|
||||
"__init__.pyc",
|
||||
"__init__.pyo",});
|
||||
//CSON: WhitespaceAfter
|
||||
|
||||
/**
|
||||
* Collects information about the file name.
|
||||
*
|
||||
|
||||
@@ -73,6 +73,7 @@ public class NuspecAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
*/
|
||||
@Override
|
||||
public void initializeFileTypeAnalyzer() throws InitializationException {
|
||||
//nothing to initialize
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -802,10 +802,8 @@ public final class CveDB implements AutoCloseable {
|
||||
try {
|
||||
final PreparedStatement cs = getPreparedStatement(COUNT_CPE);
|
||||
rs = cs.executeQuery();
|
||||
if (rs.next()) {
|
||||
if (rs.getInt(1) > 0) {
|
||||
return true;
|
||||
}
|
||||
if (rs.next() && rs.getInt(1) > 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
String dd;
|
||||
@@ -911,10 +909,9 @@ public final class CveDB implements AutoCloseable {
|
||||
}
|
||||
//this can't dereference a null 'identifiedVersion' because if it was null we would have exited
|
||||
//in the above loop or just after loop (if matchesAnyPrevious return null).
|
||||
if (entry.getValue() && identifiedVersion != null && identifiedVersion.compareTo(v) <= 0) {
|
||||
if (!(isVersionTwoADifferentProduct && !identifiedVersion.getVersionParts().get(0).equals(v.getVersionParts().get(0)))) {
|
||||
return entry;
|
||||
}
|
||||
if (entry.getValue() && identifiedVersion != null && identifiedVersion.compareTo(v) <= 0
|
||||
&& !(isVersionTwoADifferentProduct && !identifiedVersion.getVersionParts().get(0).equals(v.getVersionParts().get(0)))) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ public class UrlStringUtilsTest {
|
||||
@Test
|
||||
public void testExtractImportantUrlData() throws Exception {
|
||||
String text = "http://github.com/jeremylong/DependencyCheck/index.html";
|
||||
List<String> expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "index");;
|
||||
List<String> expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "index");
|
||||
List<String> result = UrlStringUtils.extractImportantUrlData(text);
|
||||
assertEquals(expResult, result);
|
||||
|
||||
text = "http://github.com/jeremylong/DependencyCheck/.gitignore";
|
||||
expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "gitignore");;
|
||||
expResult = Arrays.asList("github", "jeremylong", "DependencyCheck", "gitignore");
|
||||
result = UrlStringUtils.extractImportantUrlData(text);
|
||||
assertEquals(expResult, result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user