Skip to content

Commit

Permalink
do not add erroneous data
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed May 18, 2018
1 parent b550dbe commit 507d23f
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ public static boolean setPomEvidence(Dependency dependency, Model pom, List<Clas

//Description
final String description = pom.getDescription();
if (description != null && !description.isEmpty() && !description.startsWith("POM was created by")) {
if (description != null && !description.isEmpty()
&& !description.startsWith("POM was created by")
&& !description.startsWith("Sonatype helps open source projects")) {
foundSomething = true;
final String trimmedDescription = addDescription(dependency, description, "pom", "description");
addMatchingValues(classes, trimmedDescription, dependency, EvidenceType.VENDOR);
Expand Down Expand Up @@ -742,9 +744,11 @@ protected boolean parseManifest(Dependency dependency, List<ClassNameInformation
dependency.addEvidence(EvidenceType.VENDOR, source, key, value, Confidence.MEDIUM);
addMatchingValues(classInformation, value, dependency, EvidenceType.VENDOR);
} else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
foundSomething = true;
addDescription(dependency, value, "manifest", key);
addMatchingValues(classInformation, value, dependency, EvidenceType.PRODUCT);
if (!value.startsWith("Sonatype helps open source projects")) {
foundSomething = true;
addDescription(dependency, value, "manifest", key);
addMatchingValues(classInformation, value, dependency, EvidenceType.PRODUCT);
}
} else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
foundSomething = true;
dependency.addEvidence(EvidenceType.PRODUCT, source, key, value, Confidence.MEDIUM);
Expand Down Expand Up @@ -804,7 +808,9 @@ protected boolean parseManifest(Dependency dependency, List<ClassNameInformation
} else if (key.contains("license")) {
addLicense(dependency, value);
} else if (key.contains("description")) {
addDescription(dependency, value, "manifest", key);
if (!value.startsWith("Sonatype helps open source projects")) {
addDescription(dependency, value, "manifest", key);
}
} else {
dependency.addEvidence(EvidenceType.PRODUCT, source, key, value, Confidence.LOW);
dependency.addEvidence(EvidenceType.VENDOR, source, key, value, Confidence.LOW);
Expand Down

0 comments on commit 507d23f

Please sign in to comment.