mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-22 09:09:31 +01:00
coverity suggested corrections
This commit is contained in:
@@ -357,10 +357,12 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
*/
|
*/
|
||||||
private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
|
private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
|
||||||
if (archive != null && destination != null) {
|
if (archive != null && destination != null) {
|
||||||
final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
|
String archiveExt = FileUtils.getFileExtension(archive.getName());
|
||||||
if (archiveExt == null) {
|
if (archiveExt == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
archiveExt = archiveExt.toLowerCase();
|
||||||
|
|
||||||
FileInputStream fis;
|
FileInputStream fis;
|
||||||
try {
|
try {
|
||||||
fis = new FileInputStream(archive);
|
fis = new FileInputStream(archive);
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class SwiftPackageManagerAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
//SPM is currently under development for SWIFT 3. Its current metadata includes package name and dependencies.
|
//SPM is currently under development for SWIFT 3. Its current metadata includes package name and dependencies.
|
||||||
//Future interesting metadata: version, license, homepage, author, summary, etc.
|
//Future interesting metadata: version, license, homepage, author, summary, etc.
|
||||||
final String name = addStringEvidence(product, packageDescription, "name", "name", Confidence.HIGHEST);
|
final String name = addStringEvidence(product, packageDescription, "name", "name", Confidence.HIGHEST);
|
||||||
if (!name.isEmpty()) {
|
if (name != null && !name.isEmpty()) {
|
||||||
vendor.addEvidence(SPM_FILE_NAME, "name_project", name, Confidence.HIGHEST);
|
vendor.addEvidence(SPM_FILE_NAME, "name_project", name, Confidence.HIGHEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ public final class PomUtils {
|
|||||||
try {
|
try {
|
||||||
final PomParser parser = new PomParser();
|
final PomParser parser = new PomParser();
|
||||||
model = parser.parse(jar.getInputStream(entry));
|
model = parser.parse(jar.getInputStream(entry));
|
||||||
LOGGER.debug("Read POM {}", path);
|
if (model == null) {
|
||||||
|
throw new AnalysisException(String.format("Unable to parse pom '%s/%s'", jar.getName(), path));
|
||||||
|
}
|
||||||
} catch (SecurityException ex) {
|
} catch (SecurityException ex) {
|
||||||
LOGGER.warn("Unable to parse pom '{}' in jar '{}'; invalid signature", path, jar.getName());
|
LOGGER.warn("Unable to parse pom '{}' in jar '{}'; invalid signature", path, jar.getName());
|
||||||
LOGGER.debug("", ex);
|
LOGGER.debug("", ex);
|
||||||
|
|||||||
Reference in New Issue
Block a user