-
-
File: 232,
- Errors: 6,
+ File: 198,
+ Errors: 28,
Warnings: 0,
Infos: 0
@@ -83,7 +83,7 @@ under the License.
0
- 0
+ 1
@@ -113,6 +113,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/xml/pom/License.java
+
+
+ 0
+
+
+ 0
+
+
+ 4
+
@@ -155,20 +169,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Dependency.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -183,20 +183,6 @@ under the License.
1
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/IssueManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -295,20 +281,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Parent.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -337,20 +309,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/RepositoryPolicy.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -407,34 +365,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Exclusion.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Build.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -449,20 +379,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Relocation.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -480,7 +396,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Developer.java
+ org/owasp/dependencycheck/xml/pom/PomParser.java
0
@@ -489,7 +405,7 @@ under the License.
0
- 0
+ 4
@@ -508,7 +424,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Notifier.java
+ org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
0
@@ -533,20 +449,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -603,6 +505,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/xml/pom/PomParseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 1
+
@@ -645,20 +561,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/CiManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -785,20 +687,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Reporting.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -911,20 +799,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Prerequisites.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -995,20 +869,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/PluginManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1107,20 +967,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/PomUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1163,6 +1009,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/xml/pom/PomUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 1
+
@@ -1233,34 +1093,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Profile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationFile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1275,34 +1107,6 @@ under the License.
0
-
-
-
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_de.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Organization.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1317,6 +1121,20 @@ under the License.
0
+
+
+
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_de.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1446,7 +1264,7 @@ under the License.
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_da.properties
+ org/owasp/dependencycheck/exception/NoDataException.java
0
@@ -1460,7 +1278,7 @@ under the License.
- org/owasp/dependencycheck/exception/NoDataException.java
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_da.properties
0
@@ -1502,7 +1320,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/DistributionManagement.java
+ org/owasp/dependencycheck/xml/pom/PomHandler.java
0
@@ -1511,7 +1329,7 @@ under the License.
0
- 0
+ 2
@@ -1555,34 +1373,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/MailingList.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1667,20 +1457,6 @@ under the License.
0
-
-
-
- dependency-check-maven/target/classes/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1712,7 +1488,7 @@ under the License.
- dependency-check-maven/target/generated-classes/cobertura/mojo.properties
+ dependency-check-maven/target/classes/log.properties
0
@@ -1737,6 +1513,20 @@ under the License.
0
+
+
+
+ dependency-check-maven/target/generated-classes/cobertura/mojo.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1749,21 +1539,7 @@ under the License.
0
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Plugin.java
-
-
- 0
-
-
- 0
-
-
- 0
+ 8
@@ -1779,34 +1555,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/BuildBase.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/PluginExecution.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1936,7 +1684,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationProperty.java
+ org/owasp/dependencycheck/xml/pom/Model.java
0
@@ -1975,20 +1723,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Model.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2059,20 +1793,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Site.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2087,20 +1807,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2115,20 +1821,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ReportSet.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2185,20 +1877,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ObjectFactory.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2241,20 +1919,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Repository.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2325,20 +1989,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/DeploymentRepository.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2370,7 +2020,7 @@ under the License.
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_tr.properties
+ org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.java
0
@@ -2384,7 +2034,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.java
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_tr.properties
0
@@ -2437,20 +2087,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Contributor.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2507,20 +2143,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Scm.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2535,20 +2157,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationOS.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2605,6 +2213,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/xml/pom/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2706,7 +2328,7 @@ under the License.
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_fr.properties
+ org/owasp/dependencycheck/suppression/SuppressionRule.java
0
@@ -2720,7 +2342,7 @@ under the License.
- org/owasp/dependencycheck/suppression/SuppressionRule.java
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_fr.properties
0
@@ -2773,20 +2395,6 @@ under the License.
0
-
-
-
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_cs.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2804,21 +2412,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/DependencyManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ReportPlugin.java
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_cs.properties
0
@@ -2871,20 +2465,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Extension.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2955,20 +2535,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/License.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -3025,20 +2591,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/MavenNamespaceFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -3079,7 +2631,7 @@ under the License.
0
- 1
+ 2
@@ -3221,20 +2773,6 @@ under the License.
0
-
-
-
- dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_no.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -3252,21 +2790,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Resource.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Activation.java
+ dependency-check-maven/target/maven-plugin-plugin-sources/org.apache.maven.plugins/maven-site-plugin/3.4/sources/site-plugin_no.properties
0
diff --git a/dependency-check-core/cobertura/frame-packages.html b/dependency-check-core/cobertura/frame-packages.html
index 7b1496335..4b41888c1 100644
--- a/dependency-check-core/cobertura/frame-packages.html
+++ b/dependency-check-core/cobertura/frame-packages.html
@@ -64,12 +64,6 @@
org.owasp.dependencycheck.exception
-org.owasp.dependencycheck.jaxb.pom
-
-
-org.owasp.dependencycheck.jaxb.pom.generated
-
-
org.owasp.dependencycheck.reporting
@@ -78,6 +72,9 @@
org.owasp.dependencycheck.utils
+
+org.owasp.dependencycheck.xml.pom
+
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
index 7ee707e77..457bf785b 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
@@ -42,7 +42,7 @@ org.owasp.dependencycheck.analyzer
CPEAnalyzer (73%)
-CentralAnalyzer (26%)
+CentralAnalyzer (25%)
CpeSuppressionAnalyzer (90%)
@@ -63,13 +63,13 @@ org.owasp.dependencycheck.analyzer
HintAnalyzer (78%)
-JarAnalyzer (59%)
+JarAnalyzer (63%)
JavaScriptAnalyzer (29%)
-NexusAnalyzer (20%)
+NexusAnalyzer (18%)
NuspecAnalyzer (22%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.dependency.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.dependency.html
index 8e93bc145..8a33cb245 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.dependency.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.dependency.html
@@ -21,7 +21,7 @@ org.owasp.dependencycheck.dependency
Dependency (58%)
-Evidence (60%)
+Evidence (65%)
EvidenceCollection (73%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
index 847d73701..a5ca6471d 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
@@ -33,7 +33,7 @@ org.owasp.dependencycheck.utils
Filter (92%)
-NonClosingStream (100%)
+NonClosingStream (0%)
Pair (42%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.xml.pom.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.xml.pom.html
new file mode 100644
index 000000000..f3be1c877
--- /dev/null
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.xml.pom.html
@@ -0,0 +1,38 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.xml.pom
+
+
+Classes
+
+
+
diff --git a/dependency-check-core/cobertura/frame-sourcefiles.html b/dependency-check-core/cobertura/frame-sourcefiles.html
index 4fec32827..2add37856 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles.html
@@ -27,18 +27,6 @@ All Packages
AbstractTokenizingFilter (100%)
-Activation (6%)
-
-
-ActivationFile (0%)
-
-
-ActivationOS (0%)
-
-
-ActivationProperty (14%)
-
-
AlphaNumericTokenizer (60%)
@@ -63,36 +51,24 @@ All Packages
AssemblyAnalyzer (67%)
-Build (4%)
-
-
-BuildBase (7%)
-
-
CPEAnalyzer (73%)
CachedWebDataSource (N/A)
-CentralAnalyzer (26%)
+CentralAnalyzer (25%)
CentralSearch (83%)
-CiManagement (0%)
-
-
Confidence (100%)
ConnectionFactory (42%)
-Contributor (0%)
-
-
CorruptDatabaseException (0%)
@@ -126,18 +102,12 @@ All Packages
Dependency (58%)
-Dependency (9%)
-
-
DependencyBundlingAnalyzer (41%)
DependencyCheckScanAgent (0%)
-DependencyManagement (0%)
-
-
DependencySimilarity (0%)
@@ -147,15 +117,6 @@ All Packages
DependencyVersionUtil (88%)
-DeploymentRepository (0%)
-
-
-Developer (0%)
-
-
-DistributionManagement (0%)
-
-
DownloadTask (52%)
@@ -177,18 +138,12 @@ All Packages
EscapeTool (0%)
-Evidence (60%)
+Evidence (65%)
EvidenceCollection (73%)
-Exclusion (14%)
-
-
-Extension (0%)
-
-
ExtractionUtil (0%)
@@ -225,34 +180,25 @@ All Packages
InvalidDataException (0%)
-IssueManagement (0%)
-
-
-JarAnalyzer (59%)
+JarAnalyzer (63%)
JavaScriptAnalyzer (29%)
-License (0%)
+License (0%)
LuceneUtils (88%)
-MailingList (0%)
-
-
MavenArtifact (52%)
-MavenNamespaceFilter (15%)
+Model (87%)
-Model (8%)
-
-
-NexusAnalyzer (20%)
+NexusAnalyzer (18%)
NexusSearch (0%)
@@ -261,10 +207,7 @@ All Packages
NoDataException (0%)
-NonClosingStream (100%)
-
-
-Notifier (0%)
+NonClosingStream (0%)
NugetPackage (58%)
@@ -294,81 +237,39 @@ All Packages
NvdCveUpdater (0%)
-ObjectFactory (0%)
-
-
-Organization (0%)
-
-
Pair (42%)
-Parent (30%)
+PomHandler (77%)
-Plugin (8%)
+PomParseException (0%)
-PluginExecution (16%)
+PomParser (50%)
-PluginManagement (0%)
-
-
-PomUtils (15%)
-
-
-Prerequisites (0%)
+PomUtils (14%)
ProcessTask (0%)
-Profile (4%)
-
-
PropertyType (70%)
Reference (38%)
-Relocation (0%)
-
-
ReportGenerator (0%)
-ReportPlugin (10%)
-
-
-ReportSet (0%)
-
-
-Reporting (20%)
-
-
-Repository (0%)
-
-
-RepositoryPolicy (0%)
-
-
-Resource (0%)
-
-
ScanAgentException (0%)
-Scm (7%)
-
-
SearchFieldAnalyzer (100%)
-Site (0%)
-
-
StandardUpdate (0%)
@@ -422,9 +323,6 @@ All Packages
XPathNuspecParser (94%)
-
-package-info (N/A)
-
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
index f5812a606..d37783c65 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
index bebf6edc2..d043cf23d 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
index 3ed602ef7..03e4cae13 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
@@ -16,7 +16,7 @@
@@ -49,7 +49,7 @@ packageTable.sort(0);
CPEAnalyzer$IdentifierConfidence 4.592592592592593; 4.593
CPEAnalyzer$IdentifierMatch 4.592592592592593; 4.593
- CentralAnalyzer 3.625; 3.625
+ CentralAnalyzer 3.625; 3.625
CpeSuppressionAnalyzer 2.3333333333333335; 2.333
@@ -63,12 +63,12 @@ packageTable.sort(0);
HintAnalyzer 4.666666666666667; 4.667
- JarAnalyzer 7.393939393939394; 7.394
- JarAnalyzer$ClassNameInformation 7.393939393939394; 7.394
+ JarAnalyzer 7.15625; 7.156
+ JarAnalyzer$ClassNameInformation 7.15625; 7.156
JavaScriptAnalyzer 2.0; 2
- NexusAnalyzer 3.375; 3.375
+ NexusAnalyzer 3.375; 3.375
NuspecAnalyzer 2.6666666666666665; 2.667
@@ -83,6 +83,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
index 3499e0888..cfbb53dd7 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
@@ -37,6 +37,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
index fbee826c0..53ecf148f 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
index 3e399d830..553e38350 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
index 245eaa4f7..8f965959b 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
@@ -51,6 +51,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
index 49d45bad5..5de31451f 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
index 250310a96..e3efbaed6 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
index ff9f59652..982ef79e2 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
@@ -52,6 +52,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
index 447f76890..393c899cb 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
index 2dac6ef53..8f39fd7f9 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
@@ -52,6 +52,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
index 1ee0ba837..67549c4aa 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
index 9cf42440c..5b4f72dd0 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
@@ -41,6 +41,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
index 82d08a178..a71494aa3 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
index e9b4eed26..e19e89027 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
index 05290bef0..0924f6063 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
@@ -17,27 +17,26 @@
Package # Classes Line Coverage Branch Coverage Complexity
org.owasp.dependencycheck 1 3.25; 3.25
- org.owasp.dependencycheck.agent 1 1.8571428571428572; 1.857
- org.owasp.dependencycheck.analyzer 25 5.037837837837838; 5.038
+ org.owasp.dependencycheck.agent 1 1.8472222222222223; 1.847
+ org.owasp.dependencycheck.analyzer 25 4.983695652173913; 4.984
org.owasp.dependencycheck.analyzer.exception 2 1.0; 1
org.owasp.dependencycheck.data.central 1 9.0; 9
org.owasp.dependencycheck.data.cpe 4 2.4516129032258065; 2.452
org.owasp.dependencycheck.data.cwe 2 2.8; 2.8
org.owasp.dependencycheck.data.lucene 8 2.6956521739130435; 2.696
- org.owasp.dependencycheck.data.nexus 2 2.388888888888889; 2.389
+ org.owasp.dependencycheck.data.nexus 2 2.388888888888889; 2.389
org.owasp.dependencycheck.data.nuget 4 2.238095238095238; 2.238
org.owasp.dependencycheck.data.nvdcve 9 3.9508196721311477; 3.951
org.owasp.dependencycheck.data.update 7 2.925; 2.925
org.owasp.dependencycheck.data.update.exception 2 1.0; 1
org.owasp.dependencycheck.data.update.task 2 3.5555555555555554; 3.556
org.owasp.dependencycheck.data.update.xml 4 2.914285714285714; 2.914
- org.owasp.dependencycheck.dependency 14 2.497297297297297; 2.497
+ org.owasp.dependencycheck.dependency 14 2.489247311827957; 2.489
org.owasp.dependencycheck.exception 2 1.0; 1
- org.owasp.dependencycheck.jaxb.pom 2 8.25; 8.25
- org.owasp.dependencycheck.jaxb.pom.generated 87 1.0907407407407408; 1.091
org.owasp.dependencycheck.reporting 4 4.25; 4.25
org.owasp.dependencycheck.suppression 6 3.0727272727272728; 3.073
- org.owasp.dependencycheck.utils 11 3.5555555555555554; 3.556
+ org.owasp.dependencycheck.utils 11 3.5555555555555554; 3.556
+ org.owasp.dependencycheck.xml.pom 6 3.125; 3.125
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
index 90ffb22b6..8c4725c1e 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
@@ -42,6 +42,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
index 120429604..ba5e6b8b8 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
@@ -47,6 +47,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
index fe5f05479..76bf22eee 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html
new file mode 100644
index 000000000..c7cad2ae7
--- /dev/null
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.xml.pom.html
@@ -0,0 +1,52 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/frame-summary.html b/dependency-check-core/cobertura/frame-summary.html
index 253a971be..6d69a5aef 100644
--- a/dependency-check-core/cobertura/frame-summary.html
+++ b/dependency-check-core/cobertura/frame-summary.html
@@ -16,29 +16,28 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
index 45e999962..41d0808e9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
@@ -110,801 +110,799 @@
46
47
-
+
48
-
+
49
-
- 50
+ 50
+
51
-
- 52
- 53
+ 52
public class Engine {
+ 53
+
54
-
+
55
-
- 56
- 57
+ 56
- 58 1 private List<Dependency> dependencies = new ArrayList<Dependency>();
+ 57 1 private List<Dependency> dependencies = new ArrayList<Dependency>();
+ 58
+
59
-
+
60
-
- 61
- 62 1 private EnumMap<AnalysisPhase, List<Analyzer>> analyzers = new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+ 61 1 private EnumMap<AnalysisPhase, List<Analyzer>> analyzers = new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+ 62
+
63
-
+
64
-
- 65
- 66
+ 65
- 67 1 private Set<FileTypeAnalyzer> fileTypeAnalyzers = new HashSet<FileTypeAnalyzer>();
+ 66 1 private Set<FileTypeAnalyzer> fileTypeAnalyzers = new HashSet<FileTypeAnalyzer>();
+ 67
+
68
-
+
69
-
- 70
- 71
+ 70
- 72 1 private ClassLoader serviceClassLoader = Thread.currentThread().getContextClassLoader();
+ 71 1 private ClassLoader serviceClassLoader = Thread.currentThread().getContextClassLoader();
+ 72
+
73
-
- 74
- 75
+ 74
- 76 1 private static final Logger LOGGER = Logger.getLogger(Engine.class .getName());
+ 75 1 private static final Logger LOGGER = Logger.getLogger(Engine.class .getName());
+ 76
+
77
-
+
78
-
+
79
-
+
80
-
+
81
-
- 82
- 83 1 public Engine() throws DatabaseException {
- 84 1 initializeEngine();
- 85 1 }
+ 82 1 public Engine() throws DatabaseException {
+ 83 1 initializeEngine();
+ 84 1 }
+ 85
+
86
-
+
87
-
- 88
+ 88
+
89
-
- 90
+ 90
+
91
-
- 92
- 93 0 public Engine(ClassLoader serviceClassLoader) throws DatabaseException {
- 94 0 this .serviceClassLoader = serviceClassLoader;
- 95 0 initializeEngine();
- 96 0 }
+ 92 0 public Engine(ClassLoader serviceClassLoader) throws DatabaseException {
+ 93 0 this .serviceClassLoader = serviceClassLoader;
+ 94 0 initializeEngine();
+ 95 0 }
+ 96
+
97
-
+
98
-
- 99
+ 99
+
100
-
- 101
+ 101
+
102
-
- 103
protected final void initializeEngine() throws DatabaseException {
- 104 1 ConnectionFactory.initialize();
- 105 1 loadAnalyzers();
- 106 1 }
+ 103 1 ConnectionFactory.initialize();
+ 104 1 loadAnalyzers();
+ 105 1 }
+ 106
+
107
-
+
108
-
- 109
+ 109
+
110
-
- 111
public void cleanup() {
- 112 0 ConnectionFactory.cleanup();
- 113 0 }
+ 111 0 ConnectionFactory.cleanup();
+ 112 0 }
+ 113
+
114
-
+
115
-
- 116
+ 116
+
117
-
- 118
private void loadAnalyzers() {
- 119 1 if (!analyzers.isEmpty()) {
- 120 0 return ;
- 121
+ 118 1 if (!analyzers.isEmpty()) {
+ 119 0 return ;
+ 120
+ }
+ 121 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 122 9 analyzers.put(phase, new ArrayList<Analyzer>());
+ 123
}
- 122 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 123 9 analyzers.put(phase, new ArrayList<Analyzer>());
124
- }
- 125
- 126 1 final AnalyzerService service = new AnalyzerService(serviceClassLoader);
- 127 1 final Iterator<Analyzer> iterator = service.getAnalyzers();
- 128 15 while (iterator.hasNext()) {
- 129 14 final Analyzer a = iterator.next();
- 130 14 analyzers.get(a.getAnalysisPhase()).add(a);
- 131 14 if (a instanceof FileTypeAnalyzer) {
- 132 6 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
- 133
+ 125 1 final AnalyzerService service = new AnalyzerService(serviceClassLoader);
+ 126 1 final Iterator<Analyzer> iterator = service.getAnalyzers();
+ 127 15 while (iterator.hasNext()) {
+ 128 14 final Analyzer a = iterator.next();
+ 129 14 analyzers.get(a.getAnalysisPhase()).add(a);
+ 130 14 if (a instanceof FileTypeAnalyzer) {
+ 131 6 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
+ 132
}
- 134 14 }
- 135 1 }
+ 133 14 }
+ 134 1 }
+ 135
+
136
-
+
137
-
- 138
+ 138
+
139
-
- 140
- 141
+ 140
+ 141
+
142
-
- 143
public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
- 144 0 return analyzers.get(phase);
+ 143 0 return analyzers.get(phase);
+ 144
+ }
145
- }
+
146
-
+
147
-
- 148
+ 148
+
149
-
- 150
+ 150
+
151
-
- 152
public List<Dependency> getDependencies() {
- 153 10 return dependencies;
+ 152 10 return dependencies;
+ 153
+ }
154
- }
+
155
-
+
156
-
- 157
+ 157
+
158
-
- 159
+ 159
+
160
-
- 161
public void setDependencies(List<Dependency> dependencies) {
- 162 0 this .dependencies = dependencies;
- 163 0 }
+ 161 0 this .dependencies = dependencies;
+ 162 0 }
+ 163
+
164
-
+
165
-
+
166
-
+
167
-
+
168
-
- 169
+ 169
+
170
-
+
171
-
+
172
-
+
173
-
- 174
public List<Dependency> scan(String[] paths) {
- 175 0 final List<Dependency> deps = new ArrayList<Dependency>();
- 176 0 for (String path : paths) {
- 177 0 final File file = new File(path);
- 178 0 final List<Dependency> d = scan(file);
- 179 0 if (d != null ) {
- 180 0 deps.addAll(d);
+ 174 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 175 0 for (String path : paths) {
+ 176 0 final File file = new File(path);
+ 177 0 final List<Dependency> d = scan(file);
+ 178 0 if (d != null ) {
+ 179 0 deps.addAll(d);
+ 180
+ }
181
- }
- 182
}
- 183 0 return deps;
+ 182 0 return deps;
+ 183
+ }
184
- }
+
185
-
+
186
-
+
187
-
+
188
-
+
189
-
- 190
+ 190
+
191
-
+
192
-
- 193
public List<Dependency> scan(String path) {
- 194 0 final File file = new File(path);
- 195 0 return scan(file);
+ 193 0 final File file = new File(path);
+ 194 0 return scan(file);
+ 195
+ }
196
- }
+
197
-
+
198
-
+
199
-
- 200
-
- 201
-
- 202
-
- 203
-
- 204
-
- 205
-
- 206
-
- 207
- public List<Dependency> scan(File[] files) {
- 208 0 final List<Dependency> deps = new ArrayList<Dependency>();
- 209 0 for (File file : files) {
- 210 0 final List<Dependency> d = scan(file);
- 211 0 if (d != null ) {
- 212 0 deps.addAll(d);
- 213
- }
- 214
- }
- 215 0 return deps;
- 216
- }
- 217
-
- 218
-
- 219
-
- 220
-
- 221
-
- 222
-
- 223
-
- 224
-
- 225
-
- 226
-
- 227
- public List<Dependency> scan(Set<File> files) {
- 228 0 final List<Dependency> deps = new ArrayList<Dependency>();
- 229 0 for (File file : files) {
- 230 0 final List<Dependency> d = scan(file);
- 231 0 if (d != null ) {
- 232 0 deps.addAll(d);
- 233
- }
- 234 0 }
- 235 0 return deps;
- 236
- }
- 237
-
- 238
-
- 239
-
- 240
-
- 241
-
- 242
-
- 243
-
- 244
-
- 245
-
- 246
-
- 247
- public List<Dependency> scan(List<File> files) {
- 248 0 final List<Dependency> deps = new ArrayList<Dependency>();
- 249 0 for (File file : files) {
- 250 0 final List<Dependency> d = scan(file);
- 251 0 if (d != null ) {
- 252 0 deps.addAll(d);
- 253
- }
- 254 0 }
- 255 0 return deps;
- 256
- }
- 257
-
- 258
-
- 259
-
- 260
- 261
+ 200
- 262
-
- 263
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+ public List<Dependency> scan(File[] files) {
+ 207 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 208 0 for (File file : files) {
+ 209 0 final List<Dependency> d = scan(file);
+ 210 0 if (d != null ) {
+ 211 0 deps.addAll(d);
+ 212
+ }
+ 213
+ }
+ 214 0 return deps;
+ 215
+ }
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+ 223
+
+ 224
+
+ 225
+
+ 226
+ public List<Dependency> scan(Set<File> files) {
+ 227 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 228 0 for (File file : files) {
+ 229 0 final List<Dependency> d = scan(file);
+ 230 0 if (d != null ) {
+ 231 0 deps.addAll(d);
+ 232
+ }
+ 233 0 }
+ 234 0 return deps;
+ 235
+ }
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+ public List<Dependency> scan(List<File> files) {
+ 247 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 248 0 for (File file : files) {
+ 249 0 final List<Dependency> d = scan(file);
+ 250 0 if (d != null ) {
+ 251 0 deps.addAll(d);
+ 252
+ }
+ 253 0 }
+ 254 0 return deps;
+ 255
+ }
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
264
-
- 265
+ 265
+
266
-
+
267
-
- 268
public List<Dependency> scan(File file) {
- 269 4 if (file.exists()) {
- 270 4 if (file.isDirectory()) {
- 271 2 return scanDirectory(file);
- 272
+ 268 4 if (file.exists()) {
+ 269 4 if (file.isDirectory()) {
+ 270 2 return scanDirectory(file);
+ 271
} else {
- 273 2 final Dependency d = scanFile(file);
- 274 2 if (d != null ) {
- 275 2 final List<Dependency> deps = new ArrayList<Dependency>();
- 276 2 deps.add(d);
- 277 2 return deps;
+ 272 2 final Dependency d = scanFile(file);
+ 273 2 if (d != null ) {
+ 274 2 final List<Dependency> deps = new ArrayList<Dependency>();
+ 275 2 deps.add(d);
+ 276 2 return deps;
+ 277
+ }
278
- }
+ }
279
- }
- 280
}
- 281 0 return null ;
+ 280 0 return null ;
+ 281
+ }
282
- }
+
283
-
+
284
-
- 285
+ 285
+
286
-
- 287
- 288
+ 287
+ 288
+
289
-
- 290
protected List<Dependency> scanDirectory(File dir) {
- 291 38 final File[] files = dir.listFiles();
- 292 38 final List<Dependency> deps = new ArrayList<Dependency>();
- 293 38 if (files != null ) {
- 294 74 for (File f : files) {
- 295 36 if (f.isDirectory()) {
- 296 36 final List<Dependency> d = scanDirectory(f);
- 297 36 if (d != null ) {
- 298 36 deps.addAll(d);
- 299
+ 290 38 final File[] files = dir.listFiles();
+ 291 38 final List<Dependency> deps = new ArrayList<Dependency>();
+ 292 38 if (files != null ) {
+ 293 74 for (File f : files) {
+ 294 36 if (f.isDirectory()) {
+ 295 36 final List<Dependency> d = scanDirectory(f);
+ 296 36 if (d != null ) {
+ 297 36 deps.addAll(d);
+ 298
}
- 300 36 } else {
- 301 0 final Dependency d = scanFile(f);
- 302 0 deps.add(d);
- 303
+ 299 36 } else {
+ 300 0 final Dependency d = scanFile(f);
+ 301 0 deps.add(d);
+ 302
}
+ 303
+ }
304
- }
- 305
}
- 306 38 return deps;
+ 305 38 return deps;
+ 306
+ }
307
- }
+
308
-
+
309
-
- 310
+ 310
+
311
-
- 312
- 313
+ 312
+ 313
+
314
-
- 315
protected Dependency scanFile(File file) {
- 316 2 if (!file.isFile()) {
- 317 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
- 318 0 LOGGER.log(Level.FINE, msg);
- 319 0 return null ;
- 320
+ 315 2 if (!file.isFile()) {
+ 316 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+ 317 0 LOGGER.log(Level.FINE, msg);
+ 318 0 return null ;
+ 319
}
- 321 2 final String fileName = file.getName();
- 322 2 final String extension = FileUtils.getFileExtension(fileName);
- 323 2 Dependency dependency = null ;
- 324 2 if (extension != null ) {
- 325 2 if (supportsExtension(extension)) {
- 326 2 dependency = new Dependency(file);
- 327 2 dependencies.add(dependency);
+ 320 2 final String fileName = file.getName();
+ 321 2 final String extension = FileUtils.getFileExtension(fileName);
+ 322 2 Dependency dependency = null ;
+ 323 2 if (extension != null ) {
+ 324 2 if (supportsExtension(extension)) {
+ 325 2 dependency = new Dependency(file);
+ 326 2 dependencies.add(dependency);
+ 327
+ }
328
- }
- 329
} else {
- 330 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." , file.toString());
- 331 0 LOGGER.log(Level.FINE, msg);
- 332
+ 329 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." , file.toString());
+ 330 0 LOGGER.log(Level.FINE, msg);
+ 331
}
- 333 2 return dependency;
+ 332 2 return dependency;
+ 333
+ }
334
- }
+
335
-
+
336
-
- 337
+ 337
+
338
-
- 339
public void analyzeDependencies() {
- 340 1 boolean autoUpdate = true ;
- 341
+ 339 1 boolean autoUpdate = true ;
+ 340
try {
- 342 1 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
- 343 0 } catch (InvalidSettingException ex) {
- 344 0 LOGGER.log(Level.FINE, "Invalid setting for auto-update; using true." );
- 345 1 }
- 346 1 if (autoUpdate) {
- 347 0 doUpdates();
+ 341 1 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+ 342 0 } catch (InvalidSettingException ex) {
+ 343 0 LOGGER.log(Level.FINE, "Invalid setting for auto-update; using true." );
+ 344 1 }
+ 345 1 if (autoUpdate) {
+ 346 0 doUpdates();
+ 347
+ }
348
- }
+
349
-
- 350
- 351
+ 350
try {
- 352 1 ensureDataExists();
- 353 0 } catch (NoDataException ex) {
- 354 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 355 0 LOGGER.log(Level.SEVERE, msg);
- 356 0 LOGGER.log(Level.FINE, null , ex);
- 357 0 return ;
- 358 0 } catch (DatabaseException ex) {
- 359 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 360 0 LOGGER.log(Level.SEVERE, msg);
- 361 0 LOGGER.log(Level.FINE, null , ex);
- 362 0 return ;
- 363
+ 351 1 ensureDataExists();
+ 352 0 } catch (NoDataException ex) {
+ 353 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 354 0 LOGGER.log(Level.SEVERE, msg);
+ 355 0 LOGGER.log(Level.FINE, null , ex);
+ 356 0 return ;
+ 357 0 } catch (DatabaseException ex) {
+ 358 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 359 0 LOGGER.log(Level.SEVERE, msg);
+ 360 0 LOGGER.log(Level.FINE, null , ex);
+ 361 0 return ;
+ 362
- 364 1 }
- 365
+ 363 1 }
+ 364
- 366 1 final String logHeader = String.format("%n"
+ 365 1 final String logHeader = String.format("%n"
+ 366
+ + "----------------------------------------------------%n"
367
- + "----------------------------------------------------%n"
- 368
+ "BEGIN ANALYSIS%n"
- 369
+ 368
+ "----------------------------------------------------" );
- 370 1 LOGGER.log(Level.FINE, logHeader);
- 371 1 LOGGER.log(Level.INFO, "Analysis Starting" );
+ 369 1 LOGGER.log(Level.FINE, logHeader);
+ 370 1 LOGGER.log(Level.INFO, "Analysis Starting" );
+ 371
+
372
-
- 373
- 374 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 375 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 376
+ 373 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 374 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 375
+
+ 376 9 for (Analyzer a : analyzerList) {
+ 377 14 a = initializeAnalyzer(a);
+ 378
- 377 9 for (Analyzer a : analyzerList) {
- 378 14 a = initializeAnalyzer(a);
379
-
- 380
- 381
+ 380
- 382
+ 381
- 383
+ 382
- 384 14 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
- 385 14 LOGGER.log(Level.FINE, msg);
- 386 14 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 387 14 dependencySet.addAll(dependencies);
- 388 14 for (Dependency d : dependencySet) {
- 389 28 boolean shouldAnalyze = true ;
- 390 28 if (a instanceof FileTypeAnalyzer) {
- 391 12 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
- 392 12 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
- 393
+ 383 14 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+ 384 14 LOGGER.log(Level.FINE, msg);
+ 385 14 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 386 14 dependencySet.addAll(dependencies);
+ 387 14 for (Dependency d : dependencySet) {
+ 388 28 boolean shouldAnalyze = true ;
+ 389 28 if (a instanceof FileTypeAnalyzer) {
+ 390 12 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
+ 391 12 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
+ 392
}
- 394 28 if (shouldAnalyze) {
- 395 20 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
- 396 20 LOGGER.log(Level.FINE, msgFile);
- 397
+ 393 28 if (shouldAnalyze) {
+ 394 20 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+ 395 20 LOGGER.log(Level.FINE, msgFile);
+ 396
try {
- 398 20 a.analyze(d, this );
- 399 0 } catch (AnalysisException ex) {
- 400 0 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
- 401 0 LOGGER.log(Level.WARNING, exMsg);
- 402 0 LOGGER.log(Level.FINE, "" , ex);
- 403 0 } catch (Throwable ex) {
- 404 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
- 405
+ 397 20 a.analyze(d, this );
+ 398 0 } catch (AnalysisException ex) {
+ 399 0 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
+ 400 0 LOGGER.log(Level.WARNING, exMsg);
+ 401 0 LOGGER.log(Level.FINE, "" , ex);
+ 402 0 } catch (Throwable ex) {
+ 403 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
+ 404
- 406 0 LOGGER.log(Level.WARNING, axMsg);
- 407 0 LOGGER.log(Level.FINE, "" , ex);
- 408 20 }
- 409
+ 405 0 LOGGER.log(Level.WARNING, axMsg);
+ 406 0 LOGGER.log(Level.FINE, "" , ex);
+ 407 20 }
+ 408
}
- 410 28 }
- 411 14 }
- 412
+ 409 28 }
+ 410 14 }
+ 411
}
- 413 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 414 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 415
+ 412 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 413 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 414
- 416 9 for (Analyzer a : analyzerList) {
- 417 14 closeAnalyzer(a);
- 418 14 }
+ 415 9 for (Analyzer a : analyzerList) {
+ 416 14 closeAnalyzer(a);
+ 417 14 }
+ 418
+ }
419
- }
- 420
- 421 1 final String logFooter = String.format("%n"
- 422
+ 420 1 final String logFooter = String.format("%n"
+ 421
+ "----------------------------------------------------%n"
- 423
+ 422
+ "END ANALYSIS%n"
- 424
+ 423
+ "----------------------------------------------------" );
- 425 1 LOGGER.log(Level.FINE, logFooter);
- 426 1 LOGGER.log(Level.INFO, "Analysis Complete" );
- 427 1 }
+ 424 1 LOGGER.log(Level.FINE, logFooter);
+ 425 1 LOGGER.log(Level.INFO, "Analysis Complete" );
+ 426 1 }
+ 427
+
428
-
+
429
-
- 430
+ 430
+
431
-
- 432
- 433
+ 432
+ 433
+
434
-
- 435
protected Analyzer initializeAnalyzer(Analyzer analyzer) {
- 436
+ 435
try {
- 437 14 final String msg = String.format("Initializing %s" , analyzer.getName());
- 438 14 LOGGER.log(Level.FINE, msg);
- 439 14 analyzer.initialize();
- 440 0 } catch (Throwable ex) {
- 441 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
- 442 0 LOGGER.log(Level.SEVERE, msg);
- 443 0 LOGGER.log(Level.FINE, null , ex);
- 444
+ 436 14 final String msg = String.format("Initializing %s" , analyzer.getName());
+ 437 14 LOGGER.log(Level.FINE, msg);
+ 438 14 analyzer.initialize();
+ 439 0 } catch (Throwable ex) {
+ 440 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
+ 441 0 LOGGER.log(Level.SEVERE, msg);
+ 442 0 LOGGER.log(Level.FINE, null , ex);
+ 443
try {
- 445 0 analyzer.close();
- 446 0 } catch (Throwable ex1) {
- 447 0 LOGGER.log(Level.FINEST, null , ex1);
- 448 0 }
- 449 14 }
- 450 14 return analyzer;
+ 444 0 analyzer.close();
+ 445 0 } catch (Throwable ex1) {
+ 446 0 LOGGER.log(Level.FINEST, null , ex1);
+ 447 0 }
+ 448 14 }
+ 449 14 return analyzer;
+ 450
+ }
451
- }
+
452
-
+
453
-
- 454
+ 454
+
455
-
- 456
+ 456
+
457
-
- 458
protected void closeAnalyzer(Analyzer analyzer) {
- 459 14 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
- 460 14 LOGGER.log(Level.FINE, msg);
- 461
+ 458 14 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
+ 459 14 LOGGER.log(Level.FINE, msg);
+ 460
try {
- 462 14 analyzer.close();
- 463 0 } catch (Throwable ex) {
- 464 0 LOGGER.log(Level.FINEST, null , ex);
- 465 14 }
- 466 14 }
+ 461 14 analyzer.close();
+ 462 0 } catch (Throwable ex) {
+ 463 0 LOGGER.log(Level.FINEST, null , ex);
+ 464 14 }
+ 465 14 }
+ 466
+
467
-
+
468
-
- 469
+ 469
+
470
-
- 471
- private void doUpdates() {
- 472 0 LOGGER.info("Checking for updates" );
- 473 0 final UpdateService service = new UpdateService(serviceClassLoader);
- 474 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
- 475 0 while (iterator.hasNext()) {
- 476 0 final CachedWebDataSource source = iterator.next();
- 477
+ public void doUpdates() {
+ 471 0 LOGGER.info("Checking for updates" );
+ 472 0 final UpdateService service = new UpdateService(serviceClassLoader);
+ 473 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+ 474 0 while (iterator.hasNext()) {
+ 475 0 final CachedWebDataSource source = iterator.next();
+ 476
try {
- 478 0 source.update();
- 479 0 } catch (UpdateException ex) {
- 480 0 LOGGER.log(Level.WARNING,
- 481
+ 477 0 source.update();
+ 478 0 } catch (UpdateException ex) {
+ 479 0 LOGGER.log(Level.WARNING,
+ 480
"Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
- 482 0 LOGGER.log(Level.FINE, String.format("Unable to update details for %s" , source.getClass().getName()), ex);
- 483 0 }
- 484 0 }
- 485 0 LOGGER.info("Check for updates complete" );
- 486 0 }
+ 481 0 LOGGER.log(Level.FINE, String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+ 482 0 }
+ 483 0 }
+ 484 0 LOGGER.info("Check for updates complete" );
+ 485 0 }
+ 486
+
487
-
+
488
-
- 489
+ 489
+
490
-
- 491
+ 491
+
492
-
- 493
public List<Analyzer> getAnalyzers() {
- 494 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
- 495 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 496 0 final List<Analyzer> analyzerList = analyzers.get(phase);
- 497 0 ret.addAll(analyzerList);
- 498
+ 493 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
+ 494 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 495 0 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 496 0 ret.addAll(analyzerList);
+ 497
}
- 499 0 return ret;
+ 498 0 return ret;
+ 499
+ }
500
- }
+
501
-
+
502
-
- 503
+ 503
+
504
-
- 505
- 506
+ 505
+ 506
+
507
-
- 508
public boolean supportsExtension(String ext) {
- 509 851 if (ext == null ) {
- 510 3 return false ;
- 511
+ 508 851 if (ext == null ) {
+ 509 3 return false ;
+ 510
}
- 512 848 boolean scan = false ;
- 513 848 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
- 514
+ 511 848 boolean scan = false ;
+ 512 848 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
+ 513
- 515
+ 514
- 516 5088 scan |= a.supportsExtension(ext);
- 517 5088 }
- 518 848 return scan;
+ 515 5088 scan |= a.supportsExtension(ext);
+ 516 5088 }
+ 517 848 return scan;
+ 518
+ }
519
- }
+
520
-
+
521
-
- 522
+ 522
+
523
-
- 524
+ 524
+
525
-
- 526
public Set<FileTypeAnalyzer> getFileTypeAnalyzers() {
- 527 0 return this .fileTypeAnalyzers;
- 528
+ 526 0 return this .fileTypeAnalyzers;
+ 527
}
- 529
+ 528
- 530
+ 529
- 531
+ 530
- 532
+ 531
- 533
+ 532
- 534
+ 533
- 535
+ 534
- 536
+ 535
private void ensureDataExists() throws NoDataException, DatabaseException {
- 537 1 final CveDB cve = new CveDB();
- 538
+ 536 1 final CveDB cve = new CveDB();
+ 537
try {
- 539 1 cve.open();
- 540 1 if (!cve.dataExists()) {
- 541 0 throw new NoDataException("No documents exist" );
- 542
+ 538 1 cve.open();
+ 539 1 if (!cve.dataExists()) {
+ 540 0 throw new NoDataException("No documents exist" );
+ 541
}
- 543 0 } catch (DatabaseException ex) {
- 544 0 throw new NoDataException(ex.getMessage(), ex);
- 545
+ 542 0 } catch (DatabaseException ex) {
+ 543 0 throw new NoDataException(ex.getMessage(), ex);
+ 544
} finally {
- 546 1 cve.close();
- 547 1 }
- 548 1 }
- 549
+ 545 1 cve.close();
+ 546 1 }
+ 547 1 }
+ 548
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
index c0c9d67c1..24def3549 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
@@ -12,7 +12,7 @@
@@ -417,70 +417,69 @@
212
213
-
+
214
-
- 215
- 216 0 private ReportGenerator.Format reportFormat = ReportGenerator.Format.HTML;
+ 215 0 private boolean generateReport = true ;
+ 216
+
217
-
+
218
-
+
219
-
+
220
-
+
221
-
+
222
-
- 223
- public ReportGenerator.Format getReportFormat() {
- 224 0 return reportFormat;
- 225
+ public boolean isGenerateReport() {
+ 223 0 return generateReport;
+ 224
}
+ 225
+
226
-
+
227
-
+
228
-
- 229
+ 229
+
230
-
- 231
- 232
- public void setReportFormat(ReportGenerator.Format reportFormat) {
- 233 0 this .reportFormat = reportFormat;
- 234 0 }
- 235
+ 231
+ public void setGenerateReport(boolean generateReport) {
+ 232 0 this .generateReport = generateReport;
+ 233 0 }
+ 234
- 236
+ 235
+ 236
+
237
-
+
238
- 239
- private String proxyServer;
+ 239 0 private ReportGenerator.Format reportFormat = ReportGenerator.Format.HTML;
240
241
242
-
+
243
244
-
+
245
246
- public String getProxyServer() {
- 247 0 return proxyServer;
+ public ReportGenerator.Format getReportFormat() {
+ 247 0 return reportFormat;
248
}
249
@@ -488,128 +487,128 @@
250
251
-
+
252
253
-
+
254
255
- public void setProxyServer(String proxyServer) {
- 256 0 this .proxyServer = proxyServer;
+ public void setReportFormat(ReportGenerator.Format reportFormat) {
+ 256 0 this .reportFormat = reportFormat;
257 0 }
258
259
260
-
+
261
-
+
262
-
+ private String proxyServer;
263
-
- 264
-
- 265
- @Deprecated
- 266
- public String getProxyUrl() {
- 267 0 return proxyServer;
- 268
- }
- 269
- 270
+ 264
- 271
-
- 272
+ 265
+
+ 266
- 273
-
- 274
-
- 275
-
- 276
+ 267
+
+ 268
+ 269
+ public String getProxyServer() {
+ 270 0 return proxyServer;
+ 271
+ }
+ 272
+
+ 273
+
+ 274
+
+ 275
+
+ 276
+
277
- @Deprecated
+
278
- public void setProxyUrl(String proxyUrl) {
- 279 0 this .proxyServer = proxyUrl;
+ public void setProxyServer(String proxyServer) {
+ 279 0 this .proxyServer = proxyServer;
280 0 }
281
282
283
-
+
284
-
+
285
- private String proxyPort;
+
286
-
+
287
-
+
288
-
+ @Deprecated
289
-
- 290
-
+ public String getProxyUrl() {
+ 290 0 return proxyServer;
291
-
- 292
- public String getProxyPort() {
- 293 0 return proxyPort;
- 294
}
- 295
+ 292
- 296
+ 293
- 297
-
- 298
+ 294
+
+ 295
+ 296
+
+ 297
+
+ 298
+
299
-
- 300
+ 300
+ @Deprecated
301
- public void setProxyPort(String proxyPort) {
- 302 0 this .proxyPort = proxyPort;
+ public void setProxyUrl(String proxyUrl) {
+ 302 0 this .proxyServer = proxyUrl;
303 0 }
304
305
306
-
+
307
308
- private String proxyUsername;
+ private String proxyPort;
309
310
311
-
+
312
313
-
+
314
315
- public String getProxyUsername() {
- 316 0 return proxyUsername;
+ public String getProxyPort() {
+ 316 0 return proxyPort;
317
}
318
@@ -617,42 +616,42 @@
319
320
-
+
321
322
-
+
323
324
- public void setProxyUsername(String proxyUsername) {
- 325 0 this .proxyUsername = proxyUsername;
+ public void setProxyPort(String proxyPort) {
+ 325 0 this .proxyPort = proxyPort;
326 0 }
327
328
329
-
+
330
331
- private String proxyPassword;
+ private String proxyUsername;
332
333
334
-
+
335
336
-
+
337
338
- public String getProxyPassword() {
- 339 0 return proxyPassword;
+ public String getProxyUsername() {
+ 339 0 return proxyUsername;
340
}
341
@@ -660,42 +659,42 @@
342
343
-
+
344
345
-
+
346
347
- public void setProxyPassword(String proxyPassword) {
- 348 0 this .proxyPassword = proxyPassword;
+ public void setProxyUsername(String proxyUsername) {
+ 348 0 this .proxyUsername = proxyUsername;
349 0 }
350
351
352
-
+
353
354
- private String connectionTimeout;
+ private String proxyPassword;
355
356
357
-
+
358
359
-
+
360
361
- public String getConnectionTimeout() {
- 362 0 return connectionTimeout;
+ public String getProxyPassword() {
+ 362 0 return proxyPassword;
363
}
364
@@ -703,41 +702,42 @@
365
366
-
+
367
368
-
+
369
370
- public void setConnectionTimeout(String connectionTimeout) {
- 371 0 this .connectionTimeout = connectionTimeout;
+ public void setProxyPassword(String proxyPassword) {
+ 371 0 this .proxyPassword = proxyPassword;
372 0 }
373
374
375
-
+
376
- 377 0 private String logFile = null ;
+ 377
+ private String connectionTimeout;
378
379
380
-
+
381
382
-
+
383
384
- public String getLogFile() {
- 385 0 return logFile;
+ public String getConnectionTimeout() {
+ 385 0 return connectionTimeout;
386
}
387
@@ -745,42 +745,41 @@
388
389
-
+
390
391
-
+
392
393
- public void setLogFile(String logFile) {
- 394 0 this .logFile = logFile;
+ public void setConnectionTimeout(String connectionTimeout) {
+ 394 0 this .connectionTimeout = connectionTimeout;
395 0 }
396
397
398
-
+
399
- 400
- private String suppressionFile;
+ 400 0 private String logFile = null ;
401
402
403
-
+
404
405
-
+
406
407
- public String getSuppressionFile() {
- 408 0 return suppressionFile;
+ public String getLogFile() {
+ 408 0 return logFile;
409
}
410
@@ -788,41 +787,42 @@
411
412
-
+
413
414
-
+
415
416
- public void setSuppressionFile(String suppressionFile) {
- 417 0 this .suppressionFile = suppressionFile;
+ public void setLogFile(String logFile) {
+ 417 0 this .logFile = logFile;
418 0 }
419
420
421
-
+
422
- 423 0 private boolean showSummary = true ;
+ 423
+ private String suppressionFile;
424
425
426
-
+
427
428
-
+
429
430
- public boolean isShowSummary() {
- 431 0 return showSummary;
+ public String getSuppressionFile() {
+ 431 0 return suppressionFile;
432
}
433
@@ -830,41 +830,41 @@
434
435
-
+
436
437
-
+
438
439
- public void setShowSummary(boolean showSummary) {
- 440 0 this .showSummary = showSummary;
+ public void setSuppressionFile(String suppressionFile) {
+ 440 0 this .suppressionFile = suppressionFile;
441 0 }
442
443
444
-
+
445
- 446 0 private boolean centralAnalyzerEnabled = true ;
+ 446 0 private boolean showSummary = true ;
447
448
449
-
+
450
451
-
+
452
453
- public boolean isCentralAnalyzerEnabled() {
- 454 0 return centralAnalyzerEnabled;
+ public boolean isShowSummary() {
+ 454 0 return showSummary;
455
}
456
@@ -872,42 +872,41 @@
457
458
-
+
459
460
-
+
461
462
- public void setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled) {
- 463 0 this .centralAnalyzerEnabled = centralAnalyzerEnabled;
+ public void setShowSummary(boolean showSummary) {
+ 463 0 this .showSummary = showSummary;
464 0 }
465
466
467
-
+
468
- 469
- private String centralUrl;
+ 469 0 private boolean centralAnalyzerEnabled = true ;
470
471
472
-
+
473
474
-
+
475
476
- public String getCentralUrl() {
- 477 0 return centralUrl;
+ public boolean isCentralAnalyzerEnabled() {
+ 477 0 return centralAnalyzerEnabled;
478
}
479
@@ -915,41 +914,42 @@
480
481
-
+
482
483
-
+
484
485
- public void setCentralUrl(String centralUrl) {
- 486 0 this .centralUrl = centralUrl;
+ public void setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled) {
+ 486 0 this .centralAnalyzerEnabled = centralAnalyzerEnabled;
487 0 }
488
489
490
-
+
491
- 492 0 private boolean nexusAnalyzerEnabled = true ;
+ 492
+ private String centralUrl;
493
494
495
-
+
496
497
-
+
498
499
- public boolean isNexusAnalyzerEnabled() {
- 500 0 return nexusAnalyzerEnabled;
+ public String getCentralUrl() {
+ 500 0 return centralUrl;
501
}
502
@@ -957,42 +957,41 @@
503
504
-
+
505
506
-
+
507
508
- public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled) {
- 509 0 this .nexusAnalyzerEnabled = nexusAnalyzerEnabled;
+ public void setCentralUrl(String centralUrl) {
+ 509 0 this .centralUrl = centralUrl;
510 0 }
511
512
513
-
+
514
- 515
- private String nexusUrl;
+ 515 0 private boolean nexusAnalyzerEnabled = true ;
516
517
518
-
+
519
520
-
+
521
522
- public String getNexusUrl() {
- 523 0 return nexusUrl;
+ public boolean isNexusAnalyzerEnabled() {
+ 523 0 return nexusAnalyzerEnabled;
524
}
525
@@ -1000,41 +999,42 @@
526
527
-
+
528
529
-
+
530
531
- public void setNexusUrl(String nexusUrl) {
- 532 0 this .nexusUrl = nexusUrl;
+ public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled) {
+ 532 0 this .nexusAnalyzerEnabled = nexusAnalyzerEnabled;
533 0 }
534
535
536
-
+
537
- 538 0 private boolean nexusUsesProxy = true ;
+ 538
+ private String nexusUrl;
539
540
541
-
+
542
543
-
+
544
545
- public boolean isNexusUsesProxy() {
- 546 0 return nexusUsesProxy;
+ public String getNexusUrl() {
+ 546 0 return nexusUrl;
547
}
548
@@ -1042,42 +1042,41 @@
549
550
-
+
551
552
-
+
553
554
- public void setNexusUsesProxy(boolean nexusUsesProxy) {
- 555 0 this .nexusUsesProxy = nexusUsesProxy;
+ public void setNexusUrl(String nexusUrl) {
+ 555 0 this .nexusUrl = nexusUrl;
556 0 }
557
558
559
-
+
560
- 561
- private String databaseDriverName;
+ 561 0 private boolean nexusUsesProxy = true ;
562
563
564
-
+
565
566
-
+
567
568
- public String getDatabaseDriverName() {
- 569 0 return databaseDriverName;
+ public boolean isNexusUsesProxy() {
+ 569 0 return nexusUsesProxy;
570
}
571
@@ -1085,42 +1084,42 @@
572
573
-
+
574
575
-
+
576
577
- public void setDatabaseDriverName(String databaseDriverName) {
- 578 0 this .databaseDriverName = databaseDriverName;
+ public void setNexusUsesProxy(boolean nexusUsesProxy) {
+ 578 0 this .nexusUsesProxy = nexusUsesProxy;
579 0 }
580
581
582
-
+
583
584
- private String databaseDriverPath;
+ private String databaseDriverName;
585
586
587
-
+
588
589
-
+
590
591
- public String getDatabaseDriverPath() {
- 592 0 return databaseDriverPath;
+ public String getDatabaseDriverName() {
+ 592 0 return databaseDriverName;
593
}
594
@@ -1128,42 +1127,42 @@
595
596
-
+
597
598
-
+
599
600
- public void setDatabaseDriverPath(String databaseDriverPath) {
- 601 0 this .databaseDriverPath = databaseDriverPath;
+ public void setDatabaseDriverName(String databaseDriverName) {
+ 601 0 this .databaseDriverName = databaseDriverName;
602 0 }
603
604
605
-
+
606
607
- private String connectionString;
+ private String databaseDriverPath;
608
609
610
-
+
611
612
-
+
613
614
- public String getConnectionString() {
- 615 0 return connectionString;
+ public String getDatabaseDriverPath() {
+ 615 0 return databaseDriverPath;
616
}
617
@@ -1171,42 +1170,42 @@
618
619
-
+
620
621
-
+
622
623
- public void setConnectionString(String connectionString) {
- 624 0 this .connectionString = connectionString;
+ public void setDatabaseDriverPath(String databaseDriverPath) {
+ 624 0 this .databaseDriverPath = databaseDriverPath;
625 0 }
626
627
628
-
+
629
630
- private String databaseUser;
+ private String connectionString;
631
632
633
-
+
634
635
-
+
636
637
- public String getDatabaseUser() {
- 638 0 return databaseUser;
+ public String getConnectionString() {
+ 638 0 return connectionString;
639
}
640
@@ -1214,42 +1213,42 @@
641
642
-
+
643
644
-
+
645
646
- public void setDatabaseUser(String databaseUser) {
- 647 0 this .databaseUser = databaseUser;
+ public void setConnectionString(String connectionString) {
+ 647 0 this .connectionString = connectionString;
648 0 }
649
650
651
-
+
652
653
- private String databasePassword;
+ private String databaseUser;
654
655
656
-
+
657
658
-
+
659
660
- public String getDatabasePassword() {
- 661 0 return databasePassword;
+ public String getDatabaseUser() {
+ 661 0 return databaseUser;
662
}
663
@@ -1257,87 +1256,87 @@
664
665
-
+
666
667
-
+
668
669
- public void setDatabasePassword(String databasePassword) {
- 670 0 this .databasePassword = databasePassword;
+ public void setDatabaseUser(String databaseUser) {
+ 670 0 this .databaseUser = databaseUser;
671 0 }
672
673
674
-
+
675
-
+
676
-
+ private String databasePassword;
677
- private String zipExtensions;
+
678
-
+
679
-
+
680
-
+
681
-
+
682
-
+
683
-
- 684
- public String getZipExtensions() {
- 685 0 return zipExtensions;
- 686
+ public String getDatabasePassword() {
+ 684 0 return databasePassword;
+ 685
}
+ 686
+
687
-
+
688
-
+
689
-
- 690
+ 690
+
691
-
- 692
- 693
- public void setZipExtensions(String zipExtensions) {
- 694 0 this .zipExtensions = zipExtensions;
- 695 0 }
- 696
+ 692
+ public void setDatabasePassword(String databasePassword) {
+ 693 0 this .databasePassword = databasePassword;
+ 694 0 }
+ 695
- 697
+ 696
+ 697
+
698
-
+
699
700
- private String cveUrl12Modified;
+ private String zipExtensions;
701
702
703
-
+
704
705
-
+
706
707
- public String getCveUrl12Modified() {
- 708 0 return cveUrl12Modified;
+ public String getZipExtensions() {
+ 708 0 return zipExtensions;
709
}
710
@@ -1345,42 +1344,42 @@
711
712
-
+
713
714
-
+
715
716
- public void setCveUrl12Modified(String cveUrl12Modified) {
- 717 0 this .cveUrl12Modified = cveUrl12Modified;
+ public void setZipExtensions(String zipExtensions) {
+ 717 0 this .zipExtensions = zipExtensions;
718 0 }
719
720
721
-
+
722
723
- private String cveUrl20Modified;
+ private String cveUrl12Modified;
724
725
726
-
+
727
728
-
+
729
730
- public String getCveUrl20Modified() {
- 731 0 return cveUrl20Modified;
+ public String getCveUrl12Modified() {
+ 731 0 return cveUrl12Modified;
732
}
733
@@ -1388,42 +1387,42 @@
734
735
-
+
736
737
-
+
738
739
- public void setCveUrl20Modified(String cveUrl20Modified) {
- 740 0 this .cveUrl20Modified = cveUrl20Modified;
+ public void setCveUrl12Modified(String cveUrl12Modified) {
+ 740 0 this .cveUrl12Modified = cveUrl12Modified;
741 0 }
742
743
744
-
+
745
746
- private String cveUrl12Base;
+ private String cveUrl20Modified;
747
748
749
-
+
750
751
-
+
752
753
- public String getCveUrl12Base() {
- 754 0 return cveUrl12Base;
+ public String getCveUrl20Modified() {
+ 754 0 return cveUrl20Modified;
755
}
756
@@ -1431,42 +1430,42 @@
757
758
-
+
759
760
-
+
761
762
- public void setCveUrl12Base(String cveUrl12Base) {
- 763 0 this .cveUrl12Base = cveUrl12Base;
+ public void setCveUrl20Modified(String cveUrl20Modified) {
+ 763 0 this .cveUrl20Modified = cveUrl20Modified;
764 0 }
765
766
767
-
+
768
769
- private String cveUrl20Base;
+ private String cveUrl12Base;
770
771
772
-
+
773
774
-
+
775
776
- public String getCveUrl20Base() {
- 777 0 return cveUrl20Base;
+ public String getCveUrl12Base() {
+ 777 0 return cveUrl12Base;
778
}
779
@@ -1474,42 +1473,42 @@
780
781
-
+
782
783
-
+
784
785
- public void setCveUrl20Base(String cveUrl20Base) {
- 786 0 this .cveUrl20Base = cveUrl20Base;
+ public void setCveUrl12Base(String cveUrl12Base) {
+ 786 0 this .cveUrl12Base = cveUrl12Base;
787 0 }
788
789
790
-
+
791
792
- private String pathToMono;
+ private String cveUrl20Base;
793
794
795
-
+
796
797
-
+
798
799
- public String getPathToMono() {
- 800 0 return pathToMono;
+ public String getCveUrl20Base() {
+ 800 0 return cveUrl20Base;
801
}
802
@@ -1517,356 +1516,404 @@
803
804
-
+
805
806
-
+
807
808
- public void setPathToMono(String pathToMono) {
- 809 0 this .pathToMono = pathToMono;
+ public void setCveUrl20Base(String cveUrl20Base) {
+ 809 0 this .cveUrl20Base = cveUrl20Base;
810 0 }
811
812
813
-
+
814
-
+
815
-
+ private String pathToMono;
816
-
+
817
-
+
818
-
+
819
- private Engine executeDependencyCheck() throws DatabaseException {
- 820 0 populateSettings();
- 821 0 Engine engine = null ;
- 822 0 engine = new Engine();
- 823 0 engine.setDependencies(this .dependencies);
- 824 0 engine.analyzeDependencies();
- 825 0 return engine;
- 826
- }
- 827
-
- 828
-
- 829
-
- 830
- 831
-
- 832
-
- 833
+ 820
+
+ 821
- 834
- private void generateExternalReports(Engine engine, File outDirectory) {
- 835 0 DatabaseProperties prop = null ;
- 836 0 CveDB cve = null ;
- 837
- try {
- 838 0 cve = new CveDB();
- 839 0 cve.open();
- 840 0 prop = cve.getDatabaseProperties();
- 841 0 } catch (DatabaseException ex) {
- 842 0 LOGGER.log(Level.FINE, "Unable to retrieve DB Properties" , ex);
- 843
- } finally {
- 844 0 if (cve != null ) {
- 845 0 cve.close();
- 846
- }
- 847
- }
- 848 0 final ReportGenerator r = new ReportGenerator(this .applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
- 849
- try {
- 850 0 r.generateReports(outDirectory.getCanonicalPath(), this .reportFormat.name());
- 851 0 } catch (IOException ex) {
- 852 0 LOGGER.log(Level.SEVERE,
- 853
- "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
- 854 0 LOGGER.log(Level.FINE, null , ex);
- 855 0 } catch (Throwable ex) {
- 856 0 LOGGER.log(Level.SEVERE,
- 857
- "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
- 858 0 LOGGER.log(Level.FINE, null , ex);
- 859 0 }
- 860 0 }
- 861
+ 822
+ public String getPathToMono() {
+ 823 0 return pathToMono;
+ 824
+ }
+ 825
- 862
+ 826
- 863
-
- 864
-
- 865
+ 827
+
+ 828
+
+ 829
+
+ 830
+ 831
+ public void setPathToMono(String pathToMono) {
+ 832 0 this .pathToMono = pathToMono;
+ 833 0 }
+ 834
+
+ 835
+
+ 836
+
+ 837
+
+ 838
+
+ 839
+
+ 840
+
+ 841
+
+ 842
+ private Engine executeDependencyCheck() throws DatabaseException {
+ 843 0 populateSettings();
+ 844 0 Engine engine = null ;
+ 845 0 engine = new Engine();
+ 846 0 engine.setDependencies(this .dependencies);
+ 847 0 engine.analyzeDependencies();
+ 848 0 return engine;
+ 849
+ }
+ 850
+
+ 851
+
+ 852
+
+ 853
+
+ 854
+
+ 855
+
+ 856
+
+ 857
+ private void generateExternalReports(Engine engine, File outDirectory) {
+ 858 0 DatabaseProperties prop = null ;
+ 859 0 CveDB cve = null ;
+ 860
+ try {
+ 861 0 cve = new CveDB();
+ 862 0 cve.open();
+ 863 0 prop = cve.getDatabaseProperties();
+ 864 0 } catch (DatabaseException ex) {
+ 865 0 LOGGER.log(Level.FINE, "Unable to retrieve DB Properties" , ex);
866
- private void populateSettings() {
- 867 0 Settings.initialize();
- 868 0 if (dataDirectory != null ) {
- 869 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
+ } finally {
+ 867 0 if (cve != null ) {
+ 868 0 cve.close();
+ 869
+ }
870
- } else {
- 871 0 final File jarPath = new File(DependencyCheckScanAgent.class .getProtectionDomain().getCodeSource().getLocation().getPath());
- 872 0 final File base = jarPath.getParentFile();
- 873 0 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
- 874 0 final File dataDir = new File(base, sub);
- 875 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
+ }
+ 871 0 final ReportGenerator r = new ReportGenerator(this .applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
+ 872
+ try {
+ 873 0 r.generateReports(outDirectory.getCanonicalPath(), this .reportFormat.name());
+ 874 0 } catch (IOException ex) {
+ 875 0 LOGGER.log(Level.SEVERE,
876
- }
- 877
+ "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
+ 877 0 LOGGER.log(Level.FINE, null , ex);
+ 878 0 } catch (Throwable ex) {
+ 879 0 LOGGER.log(Level.SEVERE,
+ 880
+ "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
+ 881 0 LOGGER.log(Level.FINE, null , ex);
+ 882 0 }
+ 883 0 }
+ 884
- 878 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
- 879
-
- 880 0 if (proxyServer != null && !proxyServer.isEmpty()) {
- 881 0 Settings.setString(Settings.KEYS.PROXY_SERVER, proxyServer);
- 882
- }
- 883 0 if (proxyPort != null && !proxyPort.isEmpty()) {
- 884 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
885
- }
- 886 0 if (proxyUsername != null && !proxyUsername.isEmpty()) {
- 887 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUsername);
+
+ 886
+
+ 887
+
888
+
+ 889
+ private void populateSettings() {
+ 890 0 Settings.initialize();
+ 891 0 if (dataDirectory != null ) {
+ 892 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
+ 893
+ } else {
+ 894 0 final File jarPath = new File(DependencyCheckScanAgent.class .getProtectionDomain().getCodeSource().getLocation().getPath());
+ 895 0 final File base = jarPath.getParentFile();
+ 896 0 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
+ 897 0 final File dataDir = new File(base, sub);
+ 898 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
+ 899
}
- 889 0 if (proxyPassword != null && !proxyPassword.isEmpty()) {
- 890 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
- 891
- }
- 892 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
- 893 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
- 894
- }
- 895 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
- 896 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
- 897
- }
- 898 0 Settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled);
- 899 0 if (centralUrl != null && !centralUrl.isEmpty()) {
- 900 0 Settings.setString(Settings.KEYS.ANALYZER_CENTRAL_URL, centralUrl);
- 901
- }
- 902 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
- 903 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
- 904 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+ 900
+
+ 901 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+ 902
+
+ 903 0 if (proxyServer != null && !proxyServer.isEmpty()) {
+ 904 0 Settings.setString(Settings.KEYS.PROXY_SERVER, proxyServer);
905
}
- 906 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
- 907 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
- 908 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
- 909
+ 906 0 if (proxyPort != null && !proxyPort.isEmpty()) {
+ 907 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
+ 908
}
- 910 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
- 911 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
- 912
+ 909 0 if (proxyUsername != null && !proxyUsername.isEmpty()) {
+ 910 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUsername);
+ 911
}
- 913 0 if (connectionString != null && !connectionString.isEmpty()) {
- 914 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
- 915
+ 912 0 if (proxyPassword != null && !proxyPassword.isEmpty()) {
+ 913 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
+ 914
}
- 916 0 if (databaseUser != null && !databaseUser.isEmpty()) {
- 917 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
- 918
+ 915 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
+ 916 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+ 917
}
- 919 0 if (databasePassword != null && !databasePassword.isEmpty()) {
- 920 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
- 921
+ 918 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
+ 919 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
+ 920
}
- 922 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
- 923 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
+ 921 0 Settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled);
+ 922 0 if (centralUrl != null && !centralUrl.isEmpty()) {
+ 923 0 Settings.setString(Settings.KEYS.ANALYZER_CENTRAL_URL, centralUrl);
924
}
- 925 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
- 926 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
- 927
+ 925 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
+ 926 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
+ 927 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+ 928
}
- 928 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
- 929 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
- 930
+ 929 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
+ 930 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
+ 931 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
+ 932
}
- 931 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
- 932 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
- 933
+ 933 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
+ 934 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
+ 935
}
- 934 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
- 935 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
- 936
+ 936 0 if (connectionString != null && !connectionString.isEmpty()) {
+ 937 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
+ 938
}
- 937 0 if (pathToMono != null && !pathToMono.isEmpty()) {
- 938 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
- 939
- }
- 940 0 }
+ 939 0 if (databaseUser != null && !databaseUser.isEmpty()) {
+ 940 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
941
-
- 942
-
- 943
-
+ }
+ 942 0 if (databasePassword != null && !databasePassword.isEmpty()) {
+ 943 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
944
-
- 945
-
- 946
-
+ }
+ 945 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
+ 946 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
947
-
- 948
- public void execute() throws ScanAgentException {
- 949 0 Engine engine = null ;
+ }
+ 948 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
+ 949 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
950
- try {
- 951 0 engine = executeDependencyCheck();
- 952 0 generateExternalReports(engine, new File(this .reportOutputDirectory));
- 953 0 if (this .showSummary) {
- 954 0 showSummary(engine.getDependencies());
- 955
- }
- 956 0 if (this .failBuildOnCVSS <= 10) {
- 957 0 checkForFailure(engine.getDependencies());
- 958
- }
- 959 0 } catch (DatabaseException ex) {
- 960 0 LOGGER.log(Level.SEVERE,
- 961
- "Unable to connect to the dependency-check database; analysis has stopped" );
- 962 0 LOGGER.log(Level.FINE, "" , ex);
- 963
- } finally {
- 964 0 Settings.cleanup(true );
- 965 0 if (engine != null ) {
- 966 0 engine.cleanup();
+ }
+ 951 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
+ 952 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
+ 953
+ }
+ 954 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
+ 955 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
+ 956
+ }
+ 957 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
+ 958 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
+ 959
+ }
+ 960 0 if (pathToMono != null && !pathToMono.isEmpty()) {
+ 961 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
+ 962
+ }
+ 963 0 }
+ 964
+
+ 965
+
+ 966
+
967
- }
+
968
- }
- 969 0 }
- 970
-
- 971
-
- 972
-
- 973
-
- 974
-
- 975
-
- 976
- 977
+ 969
- 978
+ 970
- 979
- private void checkForFailure(List<Dependency> dependencies) throws ScanAgentException {
- 980 0 final StringBuilder ids = new StringBuilder();
- 981 0 for (Dependency d : dependencies) {
- 982 0 boolean addName = true ;
- 983 0 for (Vulnerability v : d.getVulnerabilities()) {
- 984 0 if (v.getCvssScore() >= failBuildOnCVSS) {
- 985 0 if (addName) {
- 986 0 addName = false ;
- 987 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
- 988 0 ids.append(v.getName());
- 989
- } else {
- 990 0 ids.append(", " ).append(v.getName());
- 991
- }
- 992
- }
- 993 0 }
- 994 0 }
- 995 0 if (ids.length() > 0) {
- 996 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
- 997
- + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
- 998
- + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
- 999
-
- 1000 0 throw new ScanAgentException(msg);
- 1001
- }
- 1002 0 }
- 1003
-
- 1004
-
- 1005
-
- 1006
-
- 1007
-
- 1008
-
- 1009
- private void showSummary(List<Dependency> dependencies) {
- 1010 0 final StringBuilder summary = new StringBuilder();
- 1011 0 for (Dependency d : dependencies) {
- 1012 0 boolean firstEntry = true ;
- 1013 0 final StringBuilder ids = new StringBuilder();
- 1014 0 for (Vulnerability v : d.getVulnerabilities()) {
- 1015 0 if (firstEntry) {
- 1016 0 firstEntry = false ;
- 1017
- } else {
- 1018 0 ids.append(", " );
- 1019
- }
- 1020 0 ids.append(v.getName());
- 1021 0 }
- 1022 0 if (ids.length() > 0) {
- 1023 0 summary.append(d.getFileName()).append(" (" );
- 1024 0 firstEntry = true ;
- 1025 0 for (Identifier id : d.getIdentifiers()) {
- 1026 0 if (firstEntry) {
- 1027 0 firstEntry = false ;
- 1028
- } else {
- 1029 0 summary.append(", " );
- 1030
- }
- 1031 0 summary.append(id.getValue());
- 1032 0 }
- 1033 0 summary.append(") : " ).append(ids).append(NEW_LINE);
- 1034
+ 971
+ public Engine execute() throws ScanAgentException {
+ 972 0 Engine engine = null ;
+ 973
+ try {
+ 974 0 engine = executeDependencyCheck();
+ 975 0 if (this .generateReport) {
+ 976 0 generateExternalReports(engine, new File(this .reportOutputDirectory));
+ 977
}
- 1035 0 }
- 1036 0 if (summary.length() > 0) {
- 1037 0 final String msg = String.format("%n%n"
- 1038
- + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
- 1039
- + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
- 1040 0 LOGGER.log(Level.WARNING, msg);
- 1041
+ 978 0 if (this .showSummary) {
+ 979 0 showSummary(engine.getDependencies());
+ 980
+ }
+ 981 0 if (this .failBuildOnCVSS <= 10) {
+ 982 0 checkForFailure(engine.getDependencies());
+ 983
+ }
+ 984 0 } catch (DatabaseException ex) {
+ 985 0 LOGGER.log(Level.SEVERE,
+ 986
+ "Unable to connect to the dependency-check database; analysis has stopped" );
+ 987 0 LOGGER.log(Level.FINE, "" , ex);
+ 988
+ } finally {
+ 989 0 Settings.cleanup(true );
+ 990 0 if (engine != null ) {
+ 991 0 engine.cleanup();
+ 992
+ }
+ 993
}
- 1042 0 }
- 1043
+ 994 0 return engine;
+ 995
+ }
+ 996
- 1044
+ 997
+
+ 998
+
+ 999
+
+ 1000
+
+ 1001
+
+ 1002
+
+ 1003
+
+ 1004
+
+ 1005
+ private void checkForFailure(List<Dependency> dependencies) throws ScanAgentException {
+ 1006 0 final StringBuilder ids = new StringBuilder();
+ 1007 0 for (Dependency d : dependencies) {
+ 1008 0 boolean addName = true ;
+ 1009 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 1010 0 if (v.getCvssScore() >= failBuildOnCVSS) {
+ 1011 0 if (addName) {
+ 1012 0 addName = false ;
+ 1013 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
+ 1014 0 ids.append(v.getName());
+ 1015
+ } else {
+ 1016 0 ids.append(", " ).append(v.getName());
+ 1017
+ }
+ 1018
+ }
+ 1019 0 }
+ 1020 0 }
+ 1021 0 if (ids.length() > 0) {
+ 1022 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
+ 1023
+ + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
+ 1024
+ + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
+ 1025
+
+ 1026 0 throw new ScanAgentException(msg);
+ 1027
+ }
+ 1028 0 }
+ 1029
+
+ 1030
+
+ 1031
+
+ 1032
+
+ 1033
+
+ 1034
+
+ 1035
+ private void showSummary(List<Dependency> dependencies) {
+ 1036 0 final StringBuilder summary = new StringBuilder();
+ 1037 0 for (Dependency d : dependencies) {
+ 1038 0 boolean firstEntry = true ;
+ 1039 0 final StringBuilder ids = new StringBuilder();
+ 1040 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 1041 0 if (firstEntry) {
+ 1042 0 firstEntry = false ;
+ 1043
+ } else {
+ 1044 0 ids.append(", " );
+ 1045
+ }
+ 1046 0 ids.append(v.getName());
+ 1047 0 }
+ 1048 0 if (ids.length() > 0) {
+ 1049 0 summary.append(d.getFileName()).append(" (" );
+ 1050 0 firstEntry = true ;
+ 1051 0 for (Identifier id : d.getIdentifiers()) {
+ 1052 0 if (firstEntry) {
+ 1053 0 firstEntry = false ;
+ 1054
+ } else {
+ 1055 0 summary.append(", " );
+ 1056
+ }
+ 1057 0 summary.append(id.getValue());
+ 1058 0 }
+ 1059 0 summary.append(") : " ).append(ids).append(NEW_LINE);
+ 1060
+ }
+ 1061 0 }
+ 1062 0 if (summary.length() > 0) {
+ 1063 0 final String msg = String.format("%n%n"
+ 1064
+ + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
+ 1065
+ + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
+ 1066 0 LOGGER.log(Level.WARNING, msg);
+ 1067
+ }
+ 1068 0 }
+ 1069
+
+ 1070
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
index 727375ce9..803aed169 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
@@ -60,7 +60,7 @@
21
22
-
+
23
24 62 public abstract class AbstractAnalyzer implements Analyzer {
@@ -106,6 +106,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
index c22a5a380..2f7e1a478 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
@@ -84,7 +84,7 @@
33
34
-
+
35
36
@@ -450,6 +450,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
index ff85fd6a2..00a803ce2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
@@ -98,7 +98,7 @@
40
41
-
+
42
43 8 public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
@@ -314,6 +314,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
index 155e986d1..9ae6a47a3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25 14 public enum AnalysisPhase {
@@ -135,6 +135,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
index 6c38de2e3..8b46fdc06 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
@@ -72,7 +72,7 @@
27
28
-
+
29
30
@@ -161,6 +161,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
index 83d26268f..575f0b6b3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
@@ -70,7 +70,7 @@
26
27
-
+
28
29
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
index 0ddd2496c..71abcf3c4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
@@ -130,7 +130,7 @@
56
57
-
+
58
59 2 public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer {
@@ -803,6 +803,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
index e38382ef1..bd34a5b7e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
@@ -544,6 +544,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
index 7ea1b3398..37589715c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
@@ -132,7 +132,7 @@
56
57
-
+
58
59 2 public class CPEAnalyzer implements Analyzer {
@@ -366,15 +366,15 @@
}
191 6 boolean identifierAdded = false ;
192 6 for (IndexEntry e : entries) {
- 193 43 LOGGER.fine(String.format("Verifying entry: %s" , e.toString()));
- 194 43 if (verifyEntry(e, dependency)) {
+ 193 47 LOGGER.fine(String.format("Verifying entry: %s" , e.toString()));
+ 194 47 if (verifyEntry(e, dependency)) {
195 2 final String vendor = e.getVendor();
196 2 final String product = e.getProduct();
197 2 LOGGER.fine(String.format("identified vendor/product: %s/%s" , vendor, product));
198 2 identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence);
199
}
- 200 43 }
+ 200 47 }
201 6 if (identifierAdded) {
202 1 break ;
203
@@ -412,26 +412,26 @@
220 11 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
221 11 sb.append(' ' ).append(txt).append(' ' );
222 11 for (Evidence e : ec.iterator(confidenceFilter)) {
- 223 40 String value = e.getValue();
+ 223 42 String value = e.getValue();
224
225
226
- 227 40 if (value.startsWith("http://" )) {
+ 227 42 if (value.startsWith("http://" )) {
228 2 value = value.substring(7).replaceAll("\\." , " " );
229
}
- 230 40 if (value.startsWith("https://" )) {
+ 230 42 if (value.startsWith("https://" )) {
231 0 value = value.substring(8).replaceAll("\\." , " " );
232
}
- 233 40 if (sb.indexOf(" " + value + " " ) < 0) {
- 234 35 sb.append(value).append(' ' );
+ 233 42 if (sb.indexOf(" " + value + " " ) < 0) {
+ 234 37 sb.append(value).append(' ' );
235
}
- 236 40 }
+ 236 42 }
237 11 return sb.toString().trim();
238
}
@@ -486,13 +486,13 @@
265 6 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
266 156 for (ScoreDoc d : docs.scoreDocs) {
267 150 if (d.score >= 0.08) {
- 268 43 final Document doc = cpe.getDocument(d.doc);
- 269 43 final IndexEntry entry = new IndexEntry();
- 270 43 entry.setVendor(doc.get(Fields.VENDOR));
- 271 43 entry.setProduct(doc.get(Fields.PRODUCT));
- 272 43 entry.setSearchScore(d.score);
- 273 43 if (!ret.contains(entry)) {
- 274 43 ret.add(entry);
+ 268 47 final Document doc = cpe.getDocument(d.doc);
+ 269 47 final IndexEntry entry = new IndexEntry();
+ 270 47 entry.setVendor(doc.get(Fields.VENDOR));
+ 271 47 entry.setProduct(doc.get(Fields.PRODUCT));
+ 272 47 entry.setSearchScore(d.score);
+ 273 47 if (!ret.contains(entry)) {
+ 274 47 ret.add(entry);
275
}
276
@@ -606,12 +606,12 @@
343
} else {
344 12 final StringTokenizer tokens = new StringTokenizer(cleanText);
- 345 111 while (tokens.hasMoreElements()) {
- 346 99 final String word = tokens.nextToken();
- 347 99 String temp = null ;
- 348 99 for (String weighted : weightedText) {
- 349 221 final String weightedStr = cleanseText(weighted);
- 350 221 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
+ 345 159 while (tokens.hasMoreElements()) {
+ 346 147 final String word = tokens.nextToken();
+ 347 147 String temp = null ;
+ 348 147 for (String weighted : weightedText) {
+ 349 341 final String weightedStr = cleanseText(weighted);
+ 350 341 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
351 22 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
352 22 if (!word.equalsIgnoreCase(weightedStr)) {
353 0 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
@@ -619,13 +619,13 @@
}
355
}
- 356 221 }
- 357 99 if (temp == null ) {
- 358 77 temp = LuceneUtils.escapeLuceneQuery(word);
+ 356 341 }
+ 357 147 if (temp == null ) {
+ 358 125 temp = LuceneUtils.escapeLuceneQuery(word);
359
}
- 360 99 sb.append(" " ).append(temp);
- 361 99 }
+ 360 147 sb.append(" " ).append(temp);
+ 361 147 }
362
}
363 12 sb.append(" ) " );
@@ -648,7 +648,7 @@
373
private String cleanseText(String text) {
- 374 233 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
+ 374 353 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
375
}
376
@@ -669,15 +669,15 @@
384
private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
- 385 221 if (l == null || r == null ) {
+ 385 341 if (l == null || r == null ) {
386 0 return false ;
387
}
388
- 389 221 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 390 221 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 391 221 return left.equalsIgnoreCase(right);
+ 389 341 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 390 341 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 391 341 return left.equalsIgnoreCase(right);
392
}
393
@@ -700,10 +700,10 @@
402
private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
- 403 43 boolean isValid = false ;
+ 403 47 boolean isValid = false ;
404
- 405 43 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
+ 405 47 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
406
&& collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
407
@@ -711,7 +711,7 @@
408 2 isValid = true ;
409
}
- 410 43 return isValid;
+ 410 47 return isValid;
411
}
412
@@ -756,14 +756,14 @@
432
- 433 45 if (text == null ) {
+ 433 49 if (text == null ) {
434 0 return false ;
435
}
- 436 45 final String[] words = text.split("[\\s_-]" );
- 437 45 final List<String> list = new ArrayList<String>();
- 438 45 String tempWord = null ;
- 439 167 for (String word : words) {
+ 436 49 final String[] words = text.split("[\\s_-]" );
+ 437 49 final List<String> list = new ArrayList<String>();
+ 438 49 String tempWord = null ;
+ 439 187 for (String word : words) {
440
441
@@ -772,28 +772,28 @@
443
- 444 122 if (tempWord != null ) {
- 445 2 list.add(tempWord + word);
- 446 2 tempWord = null ;
- 447 120 } else if (word.length() <= 2) {
- 448 2 tempWord = word;
+ 444 138 if (tempWord != null ) {
+ 445 6 list.add(tempWord + word);
+ 446 6 tempWord = null ;
+ 447 132 } else if (word.length() <= 2) {
+ 448 6 tempWord = word;
449
} else {
- 450 118 list.add(word);
+ 450 126 list.add(word);
451
}
452
}
- 453 45 if (tempWord != null && !list.isEmpty()) {
+ 453 49 if (tempWord != null && !list.isEmpty()) {
454 0 final String tmp = list.get(list.size() - 1) + tempWord;
455 0 list.add(tmp);
456
}
- 457 45 boolean contains = true ;
- 458 45 for (String word : list) {
- 459 120 contains &= ec.containsUsedString(word);
- 460 120 }
- 461 45 return contains;
+ 457 49 boolean contains = true ;
+ 458 49 for (String word : list) {
+ 459 132 contains &= ec.containsUsedString(word);
+ 460 132 }
+ 461 49 return contains;
462
}
463
@@ -1286,6 +1286,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
index 195702b54..f14e365c7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
@@ -12,7 +12,7 @@
@@ -88,7 +88,7 @@
35
import org.owasp.dependencycheck.dependency.Evidence;
36
- import org.owasp.dependencycheck.jaxb.pom.PomUtils;
+ import org.owasp.dependencycheck.xml.pom.PomUtils;
37
import org.owasp.dependencycheck.utils.DownloadFailedException;
38
@@ -171,271 +171,264 @@
79
80
-
+
81
- 82 2 private PomUtils pomUtil = new PomUtils();
+ 82 2 private final boolean enabled = checkEnabled();
83
-
+
84
-
+
85
-
- 86 2 private final boolean enabled = checkEnabled();
- 87
-
- 88
-
- 89
- 90
+ 86
- 91
+ 87
- 92
+ 88
- 93
+ 89
@Override
- 94
+ 90
public boolean isEnabled() {
- 95 0 return enabled;
- 96
+ 91 0 return enabled;
+ 92
}
- 97
+ 93
- 98
+ 94
- 99
+ 95
- 100
+ 96
- 101
+ 97
- 102
+ 98
- 103
+ 99
private boolean checkEnabled() {
- 104 2 boolean retval = false ;
+ 100 2 boolean retval = false ;
+ 101
+
+ 102
+ try {
+ 103 2 if (Settings.getBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED)) {
+ 104 1 if (!Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)
105
-
- 106
- try {
- 107 2 if (Settings.getBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED)) {
- 108 1 if (!Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)
- 109
|| NexusAnalyzer.DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL))) {
- 110 1 LOGGER.fine("Enabling the Central analyzer" );
- 111 1 retval = true ;
- 112
+ 106 1 LOGGER.fine("Enabling the Central analyzer" );
+ 107 1 retval = true ;
+ 108
} else {
- 113 0 LOGGER.info("Nexus analyzer is enabled, disabling the Central Analyzer" );
- 114
+ 109 0 LOGGER.info("Nexus analyzer is enabled, disabling the Central Analyzer" );
+ 110
}
- 115
+ 111
} else {
- 116 1 LOGGER.info("Central analyzer disabled" );
- 117
+ 112 1 LOGGER.info("Central analyzer disabled" );
+ 113
}
- 118 0 } catch (InvalidSettingException ise) {
- 119 0 LOGGER.warning("Invalid setting. Disabling the Central analyzer" );
- 120 2 }
- 121 2 return retval;
- 122
+ 114 0 } catch (InvalidSettingException ise) {
+ 115 0 LOGGER.warning("Invalid setting. Disabling the Central analyzer" );
+ 116 2 }
+ 117 2 return retval;
+ 118
}
- 123
+ 119
- 124
+ 120
- 125
+ 121
- 126
+ 122
- 127
+ 123
- 128
+ 124
- 129
+ 125
@Override
- 130
+ 126
public void initializeFileTypeAnalyzer() throws Exception {
- 131 0 LOGGER.fine("Initializing Central analyzer" );
- 132 0 LOGGER.fine(String.format("Central analyzer enabled: %s" , isEnabled()));
- 133 0 if (isEnabled()) {
- 134 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_CENTRAL_URL);
- 135 0 LOGGER.fine(String.format("Central Analyzer URL: %s" , searchUrl));
- 136 0 searcher = new CentralSearch(new URL(searchUrl));
+ 127 0 LOGGER.fine("Initializing Central analyzer" );
+ 128 0 LOGGER.fine(String.format("Central analyzer enabled: %s" , isEnabled()));
+ 129 0 if (isEnabled()) {
+ 130 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_CENTRAL_URL);
+ 131 0 LOGGER.fine(String.format("Central Analyzer URL: %s" , searchUrl));
+ 132 0 searcher = new CentralSearch(new URL(searchUrl));
+ 133
+ }
+ 134 0 }
+ 135
+
+ 136
+
137
- }
- 138 0 }
- 139
-
- 140
-
- 141
- 142
+ 138
- 143
+ 139
- 144
+ 140
- 145
+ 141
@Override
- 146
+ 142
public String getName() {
- 147 4 return ANALYZER_NAME;
- 148
+ 143 4 return ANALYZER_NAME;
+ 144
}
- 149
+ 145
- 150
+ 146
- 151
+ 147
- 152
+ 148
- 153
+ 149
- 154
+ 150
- 155
+ 151
@Override
- 156
+ 152
protected String getAnalyzerEnabledSettingKey() {
- 157 2 return Settings.KEYS.ANALYZER_CENTRAL_ENABLED;
- 158
+ 153 2 return Settings.KEYS.ANALYZER_CENTRAL_ENABLED;
+ 154
}
- 159
+ 155
- 160
+ 156
- 161
+ 157
- 162
+ 158
- 163
+ 159
- 164
+ 160
- 165
+ 161
@Override
- 166
+ 162
public AnalysisPhase getAnalysisPhase() {
- 167 1 return ANALYSIS_PHASE;
- 168
+ 163 1 return ANALYSIS_PHASE;
+ 164
}
- 169
+ 165
- 170
+ 166
- 171
+ 167
- 172
+ 168
- 173
+ 169
- 174
+ 170
- 175
+ 171
@Override
- 176
+ 172
public Set<String> getSupportedExtensions() {
- 177 0 return SUPPORTED_EXTENSIONS;
- 178
+ 173 0 return SUPPORTED_EXTENSIONS;
+ 174
}
- 179
+ 175
- 180
+ 176
- 181
+ 177
- 182
+ 178
- 183
+ 179
- 184
+ 180
- 185
+ 181
- 186
+ 182
- 187
+ 183
@Override
- 188
+ 184
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 189 0 if (errorFlag || !isEnabled()) {
- 190 0 return ;
- 191
+ 185 0 if (errorFlag || !isEnabled()) {
+ 186 0 return ;
+ 187
}
- 192
+ 188
- 193
+ 189
try {
- 194 0 final List<MavenArtifact> mas = searcher.searchSha1(dependency.getSha1sum());
- 195 0 final Confidence confidence = mas.size() > 1 ? Confidence.HIGH : Confidence.HIGHEST;
- 196 0 for (MavenArtifact ma : mas) {
- 197 0 LOGGER.fine(String.format("Central analyzer found artifact (%s) for dependency (%s)" , ma.toString(), dependency.getFileName()));
- 198 0 dependency.addAsEvidence("central" , ma, confidence);
- 199 0 boolean pomAnalyzed = false ;
- 200 0 for (Evidence e : dependency.getVendorEvidence()) {
- 201 0 if ("pom" .equals(e.getSource())) {
- 202 0 pomAnalyzed = true ;
- 203 0 break ;
+ 190 0 final List<MavenArtifact> mas = searcher.searchSha1(dependency.getSha1sum());
+ 191 0 final Confidence confidence = mas.size() > 1 ? Confidence.HIGH : Confidence.HIGHEST;
+ 192 0 for (MavenArtifact ma : mas) {
+ 193 0 LOGGER.fine(String.format("Central analyzer found artifact (%s) for dependency (%s)" , ma.toString(), dependency.getFileName()));
+ 194 0 dependency.addAsEvidence("central" , ma, confidence);
+ 195 0 boolean pomAnalyzed = false ;
+ 196 0 for (Evidence e : dependency.getVendorEvidence()) {
+ 197 0 if ("pom" .equals(e.getSource())) {
+ 198 0 pomAnalyzed = true ;
+ 199 0 break ;
+ 200
+ }
+ 201 0 }
+ 202 0 if (!pomAnalyzed && ma.getPomUrl() != null ) {
+ 203 0 File pomFile = null ;
204
- }
- 205 0 }
- 206 0 if (!pomAnalyzed && ma.getPomUrl() != null ) {
- 207 0 File pomFile = null ;
- 208
try {
- 209 0 final File baseDir = Settings.getTempDirectory();
- 210 0 pomFile = File.createTempFile("pom" , ".xml" , baseDir);
- 211 0 if (!pomFile.delete()) {
- 212 0 final String msg = String.format("Unable to fetch pom.xml for %s from Central; "
- 213
+ 205 0 final File baseDir = Settings.getTempDirectory();
+ 206 0 pomFile = File.createTempFile("pom" , ".xml" , baseDir);
+ 207 0 if (!pomFile.delete()) {
+ 208 0 final String msg = String.format("Unable to fetch pom.xml for %s from Central; "
+ 209
+ "this could result in undetected CPE/CVEs." , dependency.getFileName());
- 214 0 LOGGER.warning(msg);
- 215 0 LOGGER.fine("Unable to delete temp file" );
+ 210 0 LOGGER.warning(msg);
+ 211 0 LOGGER.fine("Unable to delete temp file" );
+ 212
+ }
+ 213 0 LOGGER.fine(String.format("Downloading %s" , ma.getPomUrl()));
+ 214 0 Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile);
+ 215 0 PomUtils.analyzePOM(dependency, pomFile);
216
- }
- 217 0 LOGGER.fine(String.format("Downloading %s" , ma.getPomUrl()));
- 218 0 Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile);
- 219 0 pomUtil.analyzePOM(dependency, pomFile);
- 220
- 221 0 } catch (DownloadFailedException ex) {
- 222 0 final String msg = String.format("Unable to download pom.xml for %s from Central; "
- 223
+ 217 0 } catch (DownloadFailedException ex) {
+ 218 0 final String msg = String.format("Unable to download pom.xml for %s from Central; "
+ 219
+ "this could result in undetected CPE/CVEs." , dependency.getFileName());
- 224 0 LOGGER.warning(msg);
- 225
+ 220 0 LOGGER.warning(msg);
+ 221
} finally {
- 226 0 if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) {
- 227 0 pomFile.deleteOnExit();
- 228
+ 222 0 if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) {
+ 223 0 pomFile.deleteOnExit();
+ 224
}
- 229
+ 225
}
- 230
+ 226
}
- 231
+ 227
- 232 0 }
- 233 0 } catch (IllegalArgumentException iae) {
- 234 0 LOGGER.info(String.format("invalid sha1-hash on %s" , dependency.getFileName()));
- 235 0 } catch (FileNotFoundException fnfe) {
- 236 0 LOGGER.fine(String.format("Artifact not found in repository: '%s" , dependency.getFileName()));
- 237 0 } catch (IOException ioe) {
- 238 0 LOGGER.log(Level.FINE, "Could not connect to Central search" , ioe);
- 239 0 errorFlag = true ;
- 240 0 }
- 241 0 }
- 242
+ 228 0 }
+ 229 0 } catch (IllegalArgumentException iae) {
+ 230 0 LOGGER.info(String.format("invalid sha1-hash on %s" , dependency.getFileName()));
+ 231 0 } catch (FileNotFoundException fnfe) {
+ 232 0 LOGGER.fine(String.format("Artifact not found in repository: '%s" , dependency.getFileName()));
+ 233 0 } catch (IOException ioe) {
+ 234 0 LOGGER.log(Level.FINE, "Could not connect to Central search" , ioe);
+ 235 0 errorFlag = true ;
+ 236 0 }
+ 237 0 }
+ 238
- 243
+ 239
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
index 04ef95b4c..173e956f0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31 2 public class CpeSuppressionAnalyzer extends AbstractSuppressionAnalyzer {
@@ -159,6 +159,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
index 671523be4..4fd98ef38 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
@@ -106,7 +106,7 @@
44
45
-
+
46
47 6 public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Analyzer {
@@ -716,6 +716,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
index 8728397ac..34865c449 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
@@ -98,7 +98,7 @@
40
41
-
+
42
43 5 public class FalsePositiveAnalyzer extends AbstractAnalyzer {
@@ -779,6 +779,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
index b1b406b14..8f20ca98b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
@@ -80,7 +80,7 @@
31
32
-
+
33
34 7 public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
@@ -228,6 +228,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
index 286a2aabd..1d02d8a4f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -97,6 +97,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
index 09d576f2f..e68be751d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
@@ -80,7 +80,7 @@
31
32
-
+
33
34 5 public class HintAnalyzer extends AbstractAnalyzer implements Analyzer {
@@ -237,9 +237,9 @@
119 2 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
120 2 final List<Evidence> newEntries = new ArrayList<Evidence>();
- 121 27 while (itr.hasNext()) {
- 122 25 final Evidence e = itr.next();
- 123 25 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
+ 121 28 while (itr.hasNext()) {
+ 122 26 final Evidence e = itr.next();
+ 123 26 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
124 0 final Evidence newEvidence = new Evidence(e.getSource() + " (hint)" , e.getName(), "oracle" , e.getConfidence());
125 0 newEntries.add(newEvidence);
126 0 } else if ("oracle" .equalsIgnoreCase(e.getValue(false ))) {
@@ -247,7 +247,7 @@
128 0 newEntries.add(newEvidence);
129
}
- 130 25 }
+ 130 26 }
131 2 for (Evidence e : newEntries) {
132 0 dependency.getVendorEvidence().addEvidence(e);
133 0 }
@@ -258,6 +258,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
index 3595b7f40..19e6a5a27 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
@@ -12,8 +12,8 @@
@@ -129,19 +129,19 @@
55
import org.owasp.dependencycheck.dependency.EvidenceCollection;
56
- import org.owasp.dependencycheck.jaxb.pom.PomUtils;
+ import org.owasp.dependencycheck.xml.pom.License;
57
- import org.owasp.dependencycheck.jaxb.pom.generated.License;
+ import org.owasp.dependencycheck.xml.pom.PomUtils;
58
- import org.owasp.dependencycheck.jaxb.pom.generated.Model;
+ import org.owasp.dependencycheck.xml.pom.Model;
59
- import org.owasp.dependencycheck.jaxb.pom.generated.Organization;
- 60
import org.owasp.dependencycheck.utils.FileUtils;
- 61
+ 60
import org.owasp.dependencycheck.utils.NonClosingStream;
- 62
+ 61
import org.owasp.dependencycheck.utils.Settings;
+ 62
+ import org.owasp.dependencycheck.xml.pom.PomParser;
63
import org.xml.sax.InputSource;
64
@@ -153,7 +153,7 @@
67
68
-
+
69
70
@@ -315,1761 +315,1674 @@
151
152
-
+
153
-
+
154
-
- 155 7 private PomUtils pomUtils = null ;
- 156
-
- 157
-
- 158
-
- 159
- 160
+ 155
- 161 7 public JarAnalyzer() {
- 162 7 pomUtils = new PomUtils();
- 163 7 }
- 164
+ 156 7 public JarAnalyzer() {
+ 157 7 }
+ 158
- 165
+ 159
- 166
+ 160
- 167
+ 161
- 168
+ 162
- 169
+ 163
private static final String ANALYZER_NAME = "Jar Analyzer" ;
- 170
+ 164
- 171
+ 165
- 172
+ 166
- 173 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
- 174
+ 167 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 168
- 175
+ 169
- 176
+ 170
- 177 1 private static final Set<String> EXTENSIONS = newHashSet("jar" , "war" );
- 178
+ 171 1 private static final Set<String> EXTENSIONS = newHashSet("jar" , "war" );
+ 172
- 179
+ 173
- 180
+ 174
- 181
+ 175
- 182
+ 176
- 183
+ 177
- 184
+ 178
@Override
- 185
+ 179
public Set<String> getSupportedExtensions() {
- 186 852 return EXTENSIONS;
- 187
+ 180 852 return EXTENSIONS;
+ 181
}
- 188
+ 182
- 189
+ 183
- 190
+ 184
- 191
+ 185
- 192
+ 186
- 193
+ 187
- 194
+ 188
@Override
- 195
+ 189
public String getName() {
- 196 5 return ANALYZER_NAME;
- 197
+ 190 5 return ANALYZER_NAME;
+ 191
}
- 198
+ 192
- 199
+ 193
- 200
+ 194
- 201
+ 195
- 202
+ 196
- 203
+ 197
- 204
+ 198
public AnalysisPhase getAnalysisPhase() {
- 205 1 return ANALYSIS_PHASE;
- 206
+ 199 1 return ANALYSIS_PHASE;
+ 200
}
- 207
+ 201
- 208
+ 202
- 209
+ 203
- 210
+ 204
- 211
+ 205
- 212
+ 206
- 213
+ 207
- 214
+ 208
@Override
- 215
+ 209
protected String getAnalyzerEnabledSettingKey() {
- 216 7 return Settings.KEYS.ANALYZER_JAR_ENABLED;
- 217
+ 210 7 return Settings.KEYS.ANALYZER_JAR_ENABLED;
+ 211
}
- 218
+ 212
- 219
+ 213
- 220
+ 214
- 221
+ 215
- 222
+ 216
- 223
+ 217
- 224
+ 218
- 225
+ 219
- 226
+ 220
- 227
+ 221
@Override
- 228
+ 222
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 229
+ 223
try {
- 230 5 final List<ClassNameInformation> classNames = collectClassNames(dependency);
- 231 5 final String fileName = dependency.getFileName().toLowerCase();
- 232 5 if (classNames.isEmpty()
- 233
+ 224 5 final List<ClassNameInformation> classNames = collectClassNames(dependency);
+ 225 5 final String fileName = dependency.getFileName().toLowerCase();
+ 226 5 if (classNames.isEmpty()
+ 227
&& (fileName.endsWith("-sources.jar" )
- 234
+ 228
|| fileName.endsWith("-javadoc.jar" )
- 235
+ 229
|| fileName.endsWith("-src.jar" )
- 236
+ 230
|| fileName.endsWith("-doc.jar" ))) {
- 237 0 engine.getDependencies().remove(dependency);
- 238
+ 231 0 engine.getDependencies().remove(dependency);
+ 232
}
- 239 5 final boolean hasManifest = parseManifest(dependency, classNames);
- 240 5 final boolean hasPOM = analyzePOM(dependency, classNames, engine);
- 241 5 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
- 242 5 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
- 243 0 } catch (IOException ex) {
- 244 0 throw new AnalysisException("Exception occurred reading the JAR file." , ex);
- 245 5 }
- 246 5 }
- 247
+ 233 5 final boolean hasManifest = parseManifest(dependency, classNames);
+ 234 5 final boolean hasPOM = analyzePOM(dependency, classNames, engine);
+ 235 5 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
+ 236 5 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
+ 237 0 } catch (IOException ex) {
+ 238 0 throw new AnalysisException("Exception occurred reading the JAR file." , ex);
+ 239 5 }
+ 240 5 }
+ 241
- 248
+ 242
- 249
+ 243
- 250
+ 244
- 251
+ 245
- 252
+ 246
- 253
+ 247
- 254
+ 248
- 255
+ 249
- 256
+ 250
- 257
+ 251
- 258
+ 252
protected boolean analyzePOM(Dependency dependency, List<ClassNameInformation> classes, Engine engine) throws AnalysisException {
- 259 5 boolean foundSomething = false ;
- 260
+ 253 5 boolean foundSomething = false ;
+ 254
final JarFile jar;
- 261
+ 255
try {
- 262 5 jar = new JarFile(dependency.getActualFilePath());
- 263 0 } catch (IOException ex) {
- 264 0 final String msg = String.format("Unable to read JarFile '%s'." , dependency.getActualFilePath());
- 265
+ 256 5 jar = new JarFile(dependency.getActualFilePath());
+ 257 0 } catch (IOException ex) {
+ 258 0 final String msg = String.format("Unable to read JarFile '%s'." , dependency.getActualFilePath());
+ 259
- 266 0 LOGGER.log(Level.WARNING, msg);
- 267 0 LOGGER.log(Level.FINE, "" , ex);
- 268 0 return false ;
- 269 5 }
- 270
+ 260 0 LOGGER.log(Level.WARNING, msg);
+ 261 0 LOGGER.log(Level.FINE, "" , ex);
+ 262 0 return false ;
+ 263 5 }
+ 264
List<String> pomEntries;
- 271
+ 265
try {
- 272 5 pomEntries = retrievePomListing(jar);
- 273 0 } catch (IOException ex) {
- 274 0 final String msg = String.format("Unable to read Jar file entries in '%s'." , dependency.getActualFilePath());
- 275
+ 266 5 pomEntries = retrievePomListing(jar);
+ 267 0 } catch (IOException ex) {
+ 268 0 final String msg = String.format("Unable to read Jar file entries in '%s'." , dependency.getActualFilePath());
+ 269
- 276 0 LOGGER.log(Level.WARNING, msg);
- 277 0 LOGGER.log(Level.FINE, msg, ex);
- 278 0 return false ;
- 279 5 }
- 280 5 File externalPom = null ;
- 281 5 if (pomEntries.isEmpty()) {
- 282 4 String pomPath = dependency.getActualFilePath();
- 283 4 pomPath = pomPath.substring(0, pomPath.lastIndexOf('.' )) + ".pom" ;
- 284 4 externalPom = new File(pomPath);
- 285 4 if (externalPom.isFile()) {
- 286 0 pomEntries.add(pomPath);
- 287
+ 270 0 LOGGER.log(Level.WARNING, msg);
+ 271 0 LOGGER.log(Level.FINE, msg, ex);
+ 272 0 return false ;
+ 273 5 }
+ 274 5 File externalPom = null ;
+ 275 5 if (pomEntries.isEmpty()) {
+ 276 4 String pomPath = dependency.getActualFilePath();
+ 277 4 pomPath = pomPath.substring(0, pomPath.lastIndexOf('.' )) + ".pom" ;
+ 278 4 externalPom = new File(pomPath);
+ 279 4 if (externalPom.isFile()) {
+ 280 0 pomEntries.add(pomPath);
+ 281
} else {
- 288 4 return false ;
- 289
+ 282 4 return false ;
+ 283
}
- 290
+ 284
}
- 291 1 for (String path : pomEntries) {
- 292 1 Properties pomProperties = null ;
- 293
+ 285 1 for (String path : pomEntries) {
+ 286 1 LOGGER.fine(String.format("Reading pom entry: %s" , path));
+ 287 1 Properties pomProperties = null ;
+ 288
try {
- 294 1 if (externalPom == null ) {
- 295 1 pomProperties = retrievePomProperties(path, jar);
+ 289 1 if (externalPom == null ) {
+ 290 1 pomProperties = retrievePomProperties(path, jar);
+ 291
+ }
+ 292 0 } catch (IOException ex) {
+ 293 0 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
+ 294 1 }
+ 295 1 Model pom = null ;
296
- }
- 297 0 } catch (IOException ex) {
- 298 0 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
- 299 1 }
- 300 1 Model pom = null ;
- 301
try {
- 302 1 if (pomEntries.size() > 1) {
- 303
+ 297 1 if (pomEntries.size() > 1) {
+ 298
- 304 0 final Dependency newDependency = new Dependency();
- 305 0 pom = extractPom(path, jar, newDependency);
- 306
+ 299 0 final Dependency newDependency = new Dependency();
+ 300 0 pom = extractPom(path, jar, newDependency);
+ 301
- 307 0 final String displayPath = String.format("%s%s%s" ,
- 308
+ 302 0 final String displayPath = String.format("%s%s%s" ,
+ 303
dependency.getFilePath(),
- 309
+ 304
File.separator,
- 310
+ 305
path);
- 311 0 final String displayName = String.format("%s%s%s" ,
- 312
+ 306 0 final String displayName = String.format("%s%s%s" ,
+ 307
dependency.getFileName(),
- 313
+ 308
File.separator,
- 314
+ 309
path);
- 315
+ 310
- 316 0 newDependency.setFileName(displayName);
- 317 0 newDependency.setFilePath(displayPath);
- 318 0 setPomEvidence(newDependency, pom, pomProperties, null );
- 319 0 engine.getDependencies().add(newDependency);
- 320 0 Collections.sort(engine.getDependencies());
- 321 0 } else {
- 322 1 if (externalPom == null ) {
- 323 1 pom = retrievePom(path, jar);
- 324
+ 311 0 newDependency.setFileName(displayName);
+ 312 0 newDependency.setFilePath(displayPath);
+ 313 0 setPomEvidence(newDependency, pom, pomProperties, null );
+ 314 0 engine.getDependencies().add(newDependency);
+ 315 0 Collections.sort(engine.getDependencies());
+ 316 0 } else {
+ 317 1 if (externalPom == null ) {
+ 318 1 pom = PomUtils.readPom(path, jar);
+ 319
} else {
- 325 0 pom = pomUtils.readPom(externalPom);
- 326
+ 320 0 pom = PomUtils.readPom(externalPom);
+ 321
}
- 327 1 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
- 328
+ 322 1 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
+ 323
}
- 329 0 } catch (AnalysisException ex) {
- 330 0 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
- 331 0 LOGGER.log(Level.WARNING, msg);
- 332 0 LOGGER.log(Level.FINE, "" , ex);
- 333 1 }
- 334 1 }
- 335 1 return foundSomething;
- 336
+ 324 0 } catch (AnalysisException ex) {
+ 325 0 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
+ 326 0 LOGGER.log(Level.WARNING, msg);
+ 327 0 LOGGER.log(Level.FINE, "" , ex);
+ 328 1 }
+ 329 1 }
+ 330 1 return foundSomething;
+ 331
}
- 337
+ 332
- 338
+ 333
- 339
+ 334
- 340
+ 335
- 341
+ 336
- 342
+ 337
- 343
+ 338
- 344
+ 339
- 345
+ 340
- 346
+ 341
private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
- 347 1 Properties pomProperties = null ;
- 348 1 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
- 349 1 final ZipEntry propEntry = jar.getEntry(propPath);
- 350 1 if (propEntry != null ) {
- 351 0 Reader reader = null ;
+ 342 1 Properties pomProperties = null ;
+ 343 1 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
+ 344 1 final ZipEntry propEntry = jar.getEntry(propPath);
+ 345 1 if (propEntry != null ) {
+ 346 0 Reader reader = null ;
+ 347
+ try {
+ 348 0 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
+ 349 0 pomProperties = new Properties();
+ 350 0 pomProperties.load(reader);
+ 351 0 LOGGER.fine(String.format("Read pom.properties: %s" , propPath));
352
- try {
- 353 0 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
- 354 0 pomProperties = new Properties();
- 355 0 pomProperties.load(reader);
- 356
} finally {
- 357 0 if (reader != null ) {
- 358
+ 353 0 if (reader != null ) {
+ 354
try {
- 359 0 reader.close();
- 360 0 } catch (IOException ex) {
- 361 0 LOGGER.log(Level.FINEST, "close error" , ex);
- 362 0 }
- 363
+ 355 0 reader.close();
+ 356 0 } catch (IOException ex) {
+ 357 0 LOGGER.log(Level.FINEST, "close error" , ex);
+ 358 0 }
+ 359
}
+ 360
+ }
+ 361
+ }
+ 362 1 return pomProperties;
+ 363
+ }
364
- }
+
365
- }
- 366 1 return pomProperties;
- 367
- }
- 368
-
- 369
- 370
+ 366
- 371
+ 367
- 372
+ 368
- 373
+ 369
- 374
+ 370
- 375
+ 371
- 376
+ 372
private List<String> retrievePomListing(final JarFile jar) throws IOException {
- 377 5 final List<String> pomEntries = new ArrayList<String>();
- 378 5 final Enumeration<JarEntry> entries = jar.entries();
- 379 1848 while (entries.hasMoreElements()) {
- 380 1843 final JarEntry entry = entries.nextElement();
- 381 1843 final String entryName = (new File(entry.getName())).getName().toLowerCase();
- 382 1843 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
- 383 1 pomEntries.add(entry.getName());
+ 373 5 final List<String> pomEntries = new ArrayList<String>();
+ 374 5 final Enumeration<JarEntry> entries = jar.entries();
+ 375 1848 while (entries.hasMoreElements()) {
+ 376 1843 final JarEntry entry = entries.nextElement();
+ 377 1843 final String entryName = (new File(entry.getName())).getName().toLowerCase();
+ 378 1843 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
+ 379 1 LOGGER.fine(String.format("POM Entry found: %s" , entry.getName()));
+ 380 1 pomEntries.add(entry.getName());
+ 381
+ }
+ 382 1843 }
+ 383 5 return pomEntries;
384
- }
- 385 1843 }
- 386 5 return pomEntries;
+ }
+ 385
+
+ 386
+
387
- }
+
388
-
+
389
-
+
390
-
+
391
-
- 392
-
- 393
-
- 394
- 395
+ 392
+ 393
+
+ 394
+
+ 395
+
396
-
- 397
-
- 398
-
- 399
private Model extractPom(String path, JarFile jar, Dependency dependency) throws AnalysisException {
- 400 0 InputStream input = null ;
- 401 0 FileOutputStream fos = null ;
- 402 0 BufferedOutputStream bos = null ;
- 403 0 final File tmpDir = getNextTempDirectory();
- 404 0 final File file = new File(tmpDir, "pom.xml" );
- 405
+ 397 0 InputStream input = null ;
+ 398 0 FileOutputStream fos = null ;
+ 399 0 BufferedOutputStream bos = null ;
+ 400 0 final File tmpDir = getNextTempDirectory();
+ 401 0 final File file = new File(tmpDir, "pom.xml" );
+ 402
try {
- 406 0 final ZipEntry entry = jar.getEntry(path);
- 407 0 input = jar.getInputStream(entry);
- 408 0 fos = new FileOutputStream(file);
- 409 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
- 410
+ 403 0 final ZipEntry entry = jar.getEntry(path);
+ 404 0 input = jar.getInputStream(entry);
+ 405 0 fos = new FileOutputStream(file);
+ 406 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 407
int count;
- 411 0 final byte [] data = new byte [BUFFER_SIZE];
- 412 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
- 413 0 bos.write(data, 0, count);
- 414
+ 408 0 final byte [] data = new byte [BUFFER_SIZE];
+ 409 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+ 410 0 bos.write(data, 0, count);
+ 411
}
- 415 0 bos.flush();
- 416 0 dependency.setActualFilePath(file.getAbsolutePath());
- 417 0 } catch (IOException ex) {
- 418 0 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
- 419 0 LOGGER.warning(msg);
- 420 0 LOGGER.log(Level.SEVERE, "" , ex);
- 421
+ 412 0 bos.flush();
+ 413 0 dependency.setActualFilePath(file.getAbsolutePath());
+ 414 0 } catch (IOException ex) {
+ 415 0 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
+ 416 0 LOGGER.warning(msg);
+ 417 0 LOGGER.log(Level.SEVERE, "" , ex);
+ 418
} finally {
- 422 0 closeStream(bos);
- 423 0 closeStream(fos);
- 424 0 closeStream(input);
- 425 0 }
- 426 0 Model model = null ;
- 427 0 FileInputStream fis = null ;
+ 419 0 closeStream(bos);
+ 420 0 closeStream(fos);
+ 421 0 closeStream(input);
+ 422 0 }
+ 423 0 Model model = PomUtils.readPom(file);
+ 424 0 return model;
+ 425
+ }
+ 426
+
+ 427
+
428
- try {
- 429 0 fis = new FileInputStream(file);
- 430 0 final InputStreamReader reader = new InputStreamReader(fis, "UTF-8" );
- 431 0 final InputSource xml = new InputSource(reader);
- 432 0 final SAXSource source = new SAXSource(xml);
- 433 0 model = pomUtils.readPom(source);
- 434 0 } catch (FileNotFoundException ex) {
- 435 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (File Not Found)" , path, jar.getName());
- 436 0 LOGGER.log(Level.WARNING, msg);
- 437 0 LOGGER.log(Level.FINE, "" , ex);
- 438 0 throw new AnalysisException(ex);
- 439 0 } catch (UnsupportedEncodingException ex) {
- 440 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
- 441 0 LOGGER.log(Level.WARNING, msg);
- 442 0 LOGGER.log(Level.FINE, "" , ex);
- 443 0 throw new AnalysisException(ex);
- 444 0 } catch (AnalysisException ex) {
- 445 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'" , path, jar.getName());
- 446 0 LOGGER.log(Level.WARNING, msg);
- 447 0 LOGGER.log(Level.FINE, "" , ex);
- 448 0 throw ex;
- 449
- } finally {
- 450 0 closeStream(fis);
- 451 0 }
- 452 0 return model;
- 453
- }
- 454
-
- 455
-
- 456
- 457
+ 429
- 458
+ 430
- 459
+ 431
- 460
+ 432
private void closeStream(InputStream stream) {
- 461 0 if (stream != null ) {
- 462
+ 433 0 if (stream != null ) {
+ 434
try {
- 463 0 stream.close();
- 464 0 } catch (IOException ex) {
- 465 0 LOGGER.log(Level.FINEST, null , ex);
- 466 0 }
- 467
+ 435 0 stream.close();
+ 436 0 } catch (IOException ex) {
+ 437 0 LOGGER.log(Level.FINEST, null , ex);
+ 438 0 }
+ 439
}
- 468 0 }
- 469
+ 440 0 }
+ 441
- 470
+ 442
- 471
+ 443
- 472
+ 444
- 473
+ 445
- 474
+ 446
- 475
+ 447
private void closeStream(OutputStream stream) {
- 476 0 if (stream != null ) {
- 477
+ 448 0 if (stream != null ) {
+ 449
try {
- 478 0 stream.close();
- 479 0 } catch (IOException ex) {
- 480 0 LOGGER.log(Level.FINEST, null , ex);
- 481 0 }
- 482
+ 450 0 stream.close();
+ 451 0 } catch (IOException ex) {
+ 452 0 LOGGER.log(Level.FINEST, null , ex);
+ 453 0 }
+ 454
}
- 483 0 }
- 484
+ 455 0 }
+ 456
- 485
+ 457
- 486
-
- 487
-
- 488
-
- 489
-
- 490
-
- 491
-
- 492
-
- 493
-
- 494
- private Model retrievePom(String path, JarFile jar) throws AnalysisException {
- 495 1 final ZipEntry entry = jar.getEntry(path);
- 496 1 Model model = null ;
- 497 1 if (entry != null ) {
- 498
- try {
- 499 1 final NonClosingStream stream = new NonClosingStream(jar.getInputStream(entry));
- 500 1 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
- 501 1 final InputSource xml = new InputSource(reader);
- 502 1 final SAXSource source = new SAXSource(xml);
- 503 1 model = pomUtils.readPom(source);
- 504 0 } catch (SecurityException ex) {
- 505 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
- 506 0 LOGGER.log(Level.WARNING, msg);
- 507 0 LOGGER.log(Level.FINE, null , ex);
- 508 0 throw new AnalysisException(ex);
- 509 0 } catch (IOException ex) {
- 510 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
- 511 0 LOGGER.log(Level.WARNING, msg);
- 512 0 LOGGER.log(Level.FINE, "" , ex);
- 513 0 throw new AnalysisException(ex);
- 514 0 } catch (Throwable ex) {
- 515 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
- 516 0 LOGGER.log(Level.WARNING, msg);
- 517 0 LOGGER.log(Level.FINE, "" , ex);
- 518 0 throw new AnalysisException(ex);
- 519 1 }
- 520
- }
- 521 1 return model;
- 522
- }
- 523
-
- 524
-
- 525
+ 458
- 526
+ 459
- 527
+ 460
- 528
+ 461
- 529
+ 462
- 530
+ 463
- 531
+ 464
- 532
+ 465
- 533
+ 466
- 534
+ 467
private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, List<ClassNameInformation> classes) {
- 535 1 boolean foundSomething = false ;
- 536 1 boolean addAsIdentifier = true ;
- 537 1 if (pom == null ) {
- 538 0 return foundSomething;
- 539
+ 468 1 boolean foundSomething = false ;
+ 469 1 boolean addAsIdentifier = true ;
+ 470 1 if (pom == null ) {
+ 471 0 return foundSomething;
+ 472
}
- 540 1 String groupid = interpolateString(pom.getGroupId(), pomProperties);
- 541 1 String parentGroupId = null ;
- 542
+ 473 1 String groupid = interpolateString(pom.getGroupId(), pomProperties);
+ 474 1 String parentGroupId = null ;
+ 475
- 543 1 if (pom.getParent() != null ) {
- 544 1 parentGroupId = interpolateString(pom.getParent().getGroupId(), pomProperties);
- 545 1 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
- 546 0 groupid = parentGroupId;
- 547
+ 476 1 if (pom.getParentGroupId() != null ) {
+ 477 1 parentGroupId = interpolateString(pom.getParentGroupId(), pomProperties);
+ 478 1 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
+ 479 0 groupid = parentGroupId;
+ 480
}
- 548
+ 481
}
- 549 1 final String originalGroupID = groupid;
- 550
+ 482 1 final String originalGroupID = groupid;
+ 483
- 551 1 if (groupid != null && !groupid.isEmpty()) {
- 552 1 foundSomething = true ;
- 553 1 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
- 554 1 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
- 555 1 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
- 556 1 addMatchingValues(classes, groupid, dependency.getProductEvidence());
- 557 1 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
- 558 0 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
- 559 0 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
- 560 0 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
- 561 0 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
- 562
+ 484 1 if (groupid != null && !groupid.isEmpty()) {
+ 485 1 foundSomething = true ;
+ 486 1 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
+ 487 1 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 488 1 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
+ 489 1 addMatchingValues(classes, groupid, dependency.getProductEvidence());
+ 490 1 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
+ 491 0 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
+ 492 0 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
+ 493 0 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
+ 494 0 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
+ 495
}
- 563
+ 496
} else {
- 564 0 addAsIdentifier = false ;
- 565
+ 497 0 addAsIdentifier = false ;
+ 498
}
- 566
+ 499
- 567 1 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
- 568 1 String parentArtifactId = null ;
- 569
+ 500 1 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
+ 501 1 String parentArtifactId = null ;
+ 502
- 570 1 if (pom.getParent() != null ) {
- 571 1 parentArtifactId = interpolateString(pom.getParent().getArtifactId(), pomProperties);
- 572 1 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
- 573 0 artifactid = parentArtifactId;
- 574
+ 503 1 if (pom.getParentArtifactId() != null ) {
+ 504 1 parentArtifactId = interpolateString(pom.getParentArtifactId(), pomProperties);
+ 505 1 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
+ 506 0 artifactid = parentArtifactId;
+ 507
}
- 575
+ 508
}
- 576 1 final String originalArtifactID = artifactid;
- 577 1 if (artifactid != null && !artifactid.isEmpty()) {
- 578 1 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
- 579 0 artifactid = artifactid.substring(4);
- 580
+ 509 1 final String originalArtifactID = artifactid;
+ 510 1 if (artifactid != null && !artifactid.isEmpty()) {
+ 511 1 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+ 512 0 artifactid = artifactid.substring(4);
+ 513
}
- 581 1 foundSomething = true ;
- 582 1 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
- 583 1 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
- 584 1 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
- 585 1 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
- 586 1 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
- 587 1 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
- 588 1 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
- 589 1 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
- 590 1 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
- 591
+ 514 1 foundSomething = true ;
+ 515 1 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
+ 516 1 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+ 517 1 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
+ 518 1 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
+ 519 1 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
+ 520 1 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
+ 521 1 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
+ 522 1 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
+ 523 1 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
+ 524
}
- 592
+ 525
} else {
- 593 0 addAsIdentifier = false ;
- 594
+ 526 0 addAsIdentifier = false ;
+ 527
}
- 595
+ 528
- 596 1 String version = interpolateString(pom.getVersion(), pomProperties);
- 597 1 String parentVersion = null ;
- 598
+ 529 1 String version = interpolateString(pom.getVersion(), pomProperties);
+ 530 1 String parentVersion = null ;
+ 531
- 599 1 if (pom.getParent() != null ) {
- 600 1 parentVersion = interpolateString(pom.getParent().getVersion(), pomProperties);
- 601 1 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
- 602 1 version = parentVersion;
- 603
+ 532 1 if (pom.getParentVersion() != null ) {
+ 533 1 parentVersion = interpolateString(pom.getParentVersion(), pomProperties);
+ 534 1 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
+ 535 1 version = parentVersion;
+ 536
}
- 604
+ 537
}
- 605
+ 538
- 606 1 if (version != null && !version.isEmpty()) {
- 607 1 foundSomething = true ;
- 608 1 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
- 609 1 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
- 610 0 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
- 611
+ 539 1 if (version != null && !version.isEmpty()) {
+ 540 1 foundSomething = true ;
+ 541 1 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+ 542 1 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
+ 543 0 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
+ 544
}
- 612
+ 545
} else {
- 613 0 addAsIdentifier = false ;
- 614
+ 546 0 addAsIdentifier = false ;
+ 547
}
- 615
+ 548
- 616 1 if (addAsIdentifier) {
- 617 1 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
- 618
+ 549 1 if (addAsIdentifier) {
+ 550 1 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
+ 551
}
- 619
+ 552
- 620
+ 553
- 621 1 final Organization org = pom.getOrganization();
- 622 1 if (org != null && org.getName() != null ) {
- 623 0 foundSomething = true ;
- 624 0 final String orgName = interpolateString(org.getName(), pomProperties);
- 625 0 if (orgName != null && !orgName.isEmpty()) {
- 626 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
- 627 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
- 628
+ 554 1 final String org = pom.getOrganization();
+ 555 1 if (org != null ) {
+ 556 0 foundSomething = true ;
+ 557 0 final String orgName = interpolateString(org, pomProperties);
+ 558 0 if (orgName != null && !orgName.isEmpty()) {
+ 559 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+ 560 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
+ 561
}
- 629
+ 562
}
- 630
+ 563
- 631 1 final String pomName = interpolateString(pom.getName(), pomProperties);
- 632 1 if (pomName != null && !pomName.isEmpty()) {
- 633 1 foundSomething = true ;
- 634 1 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 635 1 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 636 1 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
- 637 1 addMatchingValues(classes, pomName, dependency.getProductEvidence());
- 638
+ 564 1 final String pomName = interpolateString(pom.getName(), pomProperties);
+ 565 1 if (pomName != null && !pomName.isEmpty()) {
+ 566 1 foundSomething = true ;
+ 567 1 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 568 1 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 569 1 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
+ 570 1 addMatchingValues(classes, pomName, dependency.getProductEvidence());
+ 571
}
- 639
+ 572
- 640
+ 573
- 641 1 if (pom.getDescription() != null ) {
- 642 0 foundSomething = true ;
- 643 0 final String description = interpolateString(pom.getDescription(), pomProperties);
- 644 0 if (description != null && !description.isEmpty()) {
- 645 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
- 646 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
- 647 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
- 648
+ 574 1 if (pom.getDescription() != null ) {
+ 575 0 foundSomething = true ;
+ 576 0 final String description = interpolateString(pom.getDescription(), pomProperties);
+ 577 0 if (description != null && !description.isEmpty()) {
+ 578 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
+ 579 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
+ 580 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
+ 581
}
- 649
+ 582
}
- 650 1 extractLicense(pom, pomProperties, dependency);
- 651 1 return foundSomething;
- 652
+ 583 1 extractLicense(pom, pomProperties, dependency);
+ 584 1 return foundSomething;
+ 585
}
- 653
+ 586
- 654
+ 587
- 655
+ 588
- 656
+ 589
- 657
+ 590
- 658
+ 591
- 659
+ 592
- 660
+ 593
- 661
+ 594
- 662
+ 595
protected void analyzePackageNames(List<ClassNameInformation> classNames,
- 663
+ 596
Dependency dependency, boolean addPackagesAsEvidence) {
- 664 5 final Map<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
- 665 5 final Map<String, Integer> productIdentifiers = new HashMap<String, Integer>();
- 666 5 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+ 597 5 final Map<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
+ 598 5 final Map<String, Integer> productIdentifiers = new HashMap<String, Integer>();
+ 599 5 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+ 600
+
+ 601 5 final int classCount = classNames.size();
+ 602 5 final EvidenceCollection vendor = dependency.getVendorEvidence();
+ 603 5 final EvidenceCollection product = dependency.getProductEvidence();
+ 604
+
+ 605 5 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
+ 606 48 final float ratio = entry.getValue() / (float ) classCount;
+ 607 48 if (ratio > 0.5) {
+ 608
+
+ 609 10 vendor.addWeighting(entry.getKey());
+ 610 10 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 611 8 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+ 612
+ }
+ 613
+ }
+ 614 48 }
+ 615 5 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
+ 616 985 final float ratio = entry.getValue() / (float ) classCount;
+ 617 985 if (ratio > 0.5) {
+ 618 5 product.addWeighting(entry.getKey());
+ 619 5 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 620 4 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+ 621
+ }
+ 622
+ }
+ 623 985 }
+ 624 5 }
+ 625
+
+ 626
+
+ 627
+
+ 628
+
+ 629
+
+ 630
+
+ 631
+
+ 632
+
+ 633
+
+ 634
+
+ 635
+
+ 636
+
+ 637
+
+ 638
+
+ 639
+
+ 640
+ protected boolean parseManifest(Dependency dependency, List<ClassNameInformation> classInformation) throws IOException {
+ 641 5 boolean foundSomething = false ;
+ 642 5 JarFile jar = null ;
+ 643
+ try {
+ 644 5 jar = new JarFile(dependency.getActualFilePath());
+ 645
+
+ 646 5 final Manifest manifest = jar.getManifest();
+ 647
+
+ 648 5 if (manifest == null ) {
+ 649
+
+ 650 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
+ 651
+ && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
+ 652
+ && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
+ 653
+ && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
+ 654 0 LOGGER.log(Level.FINE,
+ 655
+ String.format("Jar file '%s' does not contain a manifest." ,
+ 656
+ dependency.getFileName()));
+ 657
+ }
+ 658 0 return false ;
+ 659
+ }
+ 660 5 final Attributes atts = manifest.getMainAttributes();
+ 661
+
+ 662 5 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
+ 663 5 final EvidenceCollection productEvidence = dependency.getProductEvidence();
+ 664 5 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
+ 665
+
+ 666 5 final String source = "Manifest" ;
667
- 668 5 final int classCount = classNames.size();
- 669 5 final EvidenceCollection vendor = dependency.getVendorEvidence();
- 670 5 final EvidenceCollection product = dependency.getProductEvidence();
- 671
-
- 672 5 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
- 673 48 final float ratio = entry.getValue() / (float ) classCount;
- 674 48 if (ratio > 0.5) {
- 675
-
- 676 10 vendor.addWeighting(entry.getKey());
- 677 10 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 678 8 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
- 679
+ 668 5 for (Entry<Object, Object> entry : atts.entrySet()) {
+ 669 65 String key = entry.getKey().toString();
+ 670 65 String value = atts.getValue(key);
+ 671 65 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
+ 672 0 value = Jsoup.parse(value).text();
+ 673
}
- 680
- }
- 681 48 }
- 682 5 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
- 683 985 final float ratio = entry.getValue() / (float ) classCount;
- 684 985 if (ratio > 0.5) {
- 685 5 product.addWeighting(entry.getKey());
- 686 5 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 687 4 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
- 688
- }
- 689
- }
- 690 985 }
- 691 5 }
- 692
-
- 693
-
+ 674 65 if (IGNORE_VALUES.contains(value)) {
+ 675 0 continue ;
+ 676 65 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
+ 677 1 foundSomething = true ;
+ 678 1 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 679 1 addMatchingValues(classInformation, value, productEvidence);
+ 680 64 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
+ 681 2 foundSomething = true ;
+ 682 2 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 683 62 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+ 684 1 foundSomething = true ;
+ 685 1 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 686 1 addMatchingValues(classInformation, value, vendorEvidence);
+ 687 61 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
+ 688 0 foundSomething = true ;
+ 689 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 690 0 addMatchingValues(classInformation, value, vendorEvidence);
+ 691 61 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
+ 692 2 foundSomething = true ;
+ 693 2 addDescription(dependency, value, "manifest" , key);
694
-
- 695
-
- 696
-
- 697
-
- 698
-
- 699
-
- 700
-
- 701
-
- 702
-
- 703
-
- 704
-
- 705
-
- 706
-
- 707
- protected boolean parseManifest(Dependency dependency, List<ClassNameInformation> classInformation) throws IOException {
- 708 5 boolean foundSomething = false ;
- 709 5 JarFile jar = null ;
- 710
- try {
- 711 5 jar = new JarFile(dependency.getActualFilePath());
- 712
-
- 713 5 final Manifest manifest = jar.getManifest();
- 714
-
- 715 5 if (manifest == null ) {
- 716
-
- 717 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
- 718
- && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
- 719
- && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
- 720
- && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
- 721 0 LOGGER.log(Level.FINE,
- 722
- String.format("Jar file '%s' does not contain a manifest." ,
- 723
- dependency.getFileName()));
- 724
- }
- 725 0 return false ;
- 726
- }
- 727 5 final Attributes atts = manifest.getMainAttributes();
- 728
-
- 729 5 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
- 730 5 final EvidenceCollection productEvidence = dependency.getProductEvidence();
- 731 5 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
- 732
-
- 733 5 final String source = "Manifest" ;
- 734
-
- 735 5 for (Entry<Object, Object> entry : atts.entrySet()) {
- 736 65 String key = entry.getKey().toString();
- 737 65 String value = atts.getValue(key);
- 738 65 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
- 739 0 value = Jsoup.parse(value).text();
- 740
- }
- 741 65 if (IGNORE_VALUES.contains(value)) {
- 742 0 continue ;
- 743 65 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
- 744 1 foundSomething = true ;
- 745 1 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 746 1 addMatchingValues(classInformation, value, productEvidence);
- 747 64 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
- 748 2 foundSomething = true ;
- 749 2 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 750 62 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
- 751 1 foundSomething = true ;
- 752 1 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 753 1 addMatchingValues(classInformation, value, vendorEvidence);
- 754 61 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
- 755 0 foundSomething = true ;
- 756 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 757 0 addMatchingValues(classInformation, value, vendorEvidence);
- 758 61 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
- 759 2 foundSomething = true ;
- 760 2 addDescription(dependency, value, "manifest" , key);
- 761
- 762 2 addMatchingValues(classInformation, value, productEvidence);
- 763 59 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
- 764 3 foundSomething = true ;
- 765 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 766 3 addMatchingValues(classInformation, value, productEvidence);
- 767 56 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
- 768 3 foundSomething = true ;
- 769 3 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 770 3 addMatchingValues(classInformation, value, vendorEvidence);
- 771 53 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
- 772 3 foundSomething = true ;
- 773 3 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 774 50 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
- 775 2 continue ;
- 776
+ 695 2 addMatchingValues(classInformation, value, productEvidence);
+ 696 59 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
+ 697 3 foundSomething = true ;
+ 698 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 699 3 addMatchingValues(classInformation, value, productEvidence);
+ 700 56 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
+ 701 3 foundSomething = true ;
+ 702 3 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 703 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 704 53 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
+ 705 3 foundSomething = true ;
+ 706 3 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 707 50 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
+ 708 2 continue ;
+ 709
- 777
+ 710
- 778
+ 711
- 779
+ 712
- 780
+ 713
- 781
+ 714
- 782
+ 715
- 783
+ 716
- 784
+ 717
} else {
- 785 48 key = key.toLowerCase();
- 786
+ 718 48 key = key.toLowerCase();
+ 719
- 787 48 if (!IGNORE_KEYS.contains(key)
- 788
+ 720 48 if (!IGNORE_KEYS.contains(key)
+ 721
&& !key.endsWith("jdk" )
- 789
+ 722
&& !key.contains("lastmodified" )
- 790
+ 723
&& !key.endsWith("package" )
- 791
+ 724
&& !key.endsWith("classpath" )
- 792
+ 725
&& !key.endsWith("class-path" )
- 793
+ 726
&& !key.endsWith("-scm" )
- 794
+ 727
&& !key.startsWith("scm-" )
- 795
+ 728
&& !value.trim().startsWith("scm:" )
- 796
+ 729
&& !isImportPackage(key, value)
- 797
+ 730
&& !isPackage(key, value)) {
- 798
+ 731
- 799 14 foundSomething = true ;
- 800 14 if (key.contains("version" )) {
- 801 1 if (key.contains("specification" )) {
- 802 1 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
- 803
+ 732 14 foundSomething = true ;
+ 733 14 if (key.contains("version" )) {
+ 734 1 if (key.contains("specification" )) {
+ 735 1 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 736
} else {
- 804 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 805
+ 737 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 738
}
- 806 13 } else if ("build-id" .equals(key)) {
- 807 0 int pos = value.indexOf('(' );
- 808 0 if (pos >= 0) {
- 809 0 value = value.substring(0, pos - 1);
- 810
+ 739 13 } else if ("build-id" .equals(key)) {
+ 740 0 int pos = value.indexOf('(' );
+ 741 0 if (pos >= 0) {
+ 742 0 value = value.substring(0, pos - 1);
+ 743
}
- 811 0 pos = value.indexOf('[' );
- 812 0 if (pos >= 0) {
- 813 0 value = value.substring(0, pos - 1);
- 814
+ 744 0 pos = value.indexOf('[' );
+ 745 0 if (pos >= 0) {
+ 746 0 value = value.substring(0, pos - 1);
+ 747
}
- 815 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 816 0 } else if (key.contains("title" )) {
- 817 1 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 818 1 addMatchingValues(classInformation, value, productEvidence);
- 819 12 } else if (key.contains("vendor" )) {
- 820 0 if (key.contains("specification" )) {
- 821 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 822
+ 748 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 749 0 } else if (key.contains("title" )) {
+ 750 1 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 751 1 addMatchingValues(classInformation, value, productEvidence);
+ 752 12 } else if (key.contains("vendor" )) {
+ 753 0 if (key.contains("specification" )) {
+ 754 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 755
} else {
- 823 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 824 0 addMatchingValues(classInformation, value, vendorEvidence);
- 825
+ 756 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 757 0 addMatchingValues(classInformation, value, vendorEvidence);
+ 758
}
- 826 12 } else if (key.contains("name" )) {
- 827 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 828 3 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 829 3 addMatchingValues(classInformation, value, vendorEvidence);
- 830 3 addMatchingValues(classInformation, value, productEvidence);
- 831 9 } else if (key.contains("license" )) {
- 832 2 addLicense(dependency, value);
- 833
+ 759 12 } else if (key.contains("name" )) {
+ 760 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 761 3 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 762 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 763 3 addMatchingValues(classInformation, value, productEvidence);
+ 764 9 } else if (key.contains("license" )) {
+ 765 2 addLicense(dependency, value);
+ 766
} else {
- 834 7 if (key.contains("description" )) {
- 835 0 addDescription(dependency, value, "manifest" , key);
- 836
+ 767 7 if (key.contains("description" )) {
+ 768 0 addDescription(dependency, value, "manifest" , key);
+ 769
} else {
- 837 7 productEvidence.addEvidence(source, key, value, Confidence.LOW);
- 838 7 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 839 7 addMatchingValues(classInformation, value, vendorEvidence);
- 840 7 addMatchingValues(classInformation, value, productEvidence);
- 841 7 if (value.matches(".*\\d.*" )) {
- 842 3 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
- 843 15 while (tokenizer.hasMoreElements()) {
- 844 12 final String s = tokenizer.nextToken();
- 845 12 if (s.matches("^[0-9.]+$" )) {
- 846 1 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
- 847
+ 770 7 productEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 771 7 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 772 7 addMatchingValues(classInformation, value, vendorEvidence);
+ 773 7 addMatchingValues(classInformation, value, productEvidence);
+ 774 7 if (value.matches(".*\\d.*" )) {
+ 775 3 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
+ 776 15 while (tokenizer.hasMoreElements()) {
+ 777 12 final String s = tokenizer.nextToken();
+ 778 12 if (s.matches("^[0-9.]+$" )) {
+ 779 1 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
+ 780
}
- 848 12 }
- 849
+ 781 12 }
+ 782
}
- 850
+ 783
}
- 851
+ 784
}
- 852
+ 785
}
- 853
+ 786
}
- 854 63 }
- 855
+ 787 63 }
+ 788
} finally {
- 856 5 if (jar != null ) {
- 857 5 jar.close();
- 858
+ 789 5 if (jar != null ) {
+ 790 5 jar.close();
+ 791
}
- 859
+ 792
}
- 860 5 return foundSomething;
- 861
+ 793 5 return foundSomething;
+ 794
}
- 862
+ 795
- 863
+ 796
- 864
+ 797
- 865
+ 798
- 866
+ 799
- 867
+ 800
- 868
+ 801
- 869
+ 802
- 870
+ 803
- 871
+ 804
- 872
+ 805
+ 806
+
+ 807
+ public static String addDescription(Dependency dependency, String description, String source, String key) {
+ 808 2 if (dependency.getDescription() == null ) {
+ 809 2 dependency.setDescription(description);
+ 810
+ }
+ 811
+ String desc;
+ 812 2 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
+ 813 0 desc = Jsoup.parse(description).text();
+ 814
+ } else {
+ 815 2 desc = description;
+ 816
+ }
+ 817 2 dependency.setDescription(desc);
+ 818 2 if (desc.length() > 100) {
+ 819 0 desc = desc.replaceAll("\\s\\s+" , " " );
+ 820 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
+ 821 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
+ 822 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
+ 823 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
+ 824 0 int pos = -1;
+ 825 0 pos = Math.max(pos, posSuchAs);
+ 826 0 if (pos >= 0 && posLike >= 0) {
+ 827 0 pos = Math.min(pos, posLike);
+ 828
+ } else {
+ 829 0 pos = Math.max(pos, posLike);
+ 830
+ }
+ 831 0 if (pos >= 0 && posWillUse >= 0) {
+ 832 0 pos = Math.min(pos, posWillUse);
+ 833
+ } else {
+ 834 0 pos = Math.max(pos, posWillUse);
+ 835
+ }
+ 836 0 if (pos >= 0 && posUses >= 0) {
+ 837 0 pos = Math.min(pos, posUses);
+ 838
+ } else {
+ 839 0 pos = Math.max(pos, posUses);
+ 840
+ }
+ 841
+
+ 842 0 if (pos > 0) {
+ 843 0 final StringBuilder sb = new StringBuilder(pos + 3);
+ 844 0 sb.append(desc.substring(0, pos));
+ 845 0 sb.append("..." );
+ 846 0 desc = sb.toString();
+ 847
+ }
+ 848 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 849 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 850 0 } else {
+ 851 2 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 852 2 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 853
+ }
+ 854 2 return desc;
+ 855
+ }
+ 856
+
+ 857
+
+ 858
+
+ 859
+
+ 860
+
+ 861
+
+ 862
+
+ 863
+ private void addLicense(Dependency d, String license) {
+ 864 2 if (d.getLicense() == null ) {
+ 865 2 d.setLicense(license);
+ 866 0 } else if (!d.getLicense().contains(license)) {
+ 867 0 d.setLicense(d.getLicense() + NEWLINE + license);
+ 868
+ }
+ 869 2 }
+ 870
+
+ 871
+
+ 872
+
873
- 874
- public static String addDescription(Dependency dependency, String description, String source, String key) {
- 875 2 if (dependency.getDescription() == null ) {
- 876 2 dependency.setDescription(description);
+ 874 7 private File tempFileLocation = null ;
+ 875
+
+ 876
+
877
- }
- 878
- String desc;
- 879 2 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
- 880 0 desc = Jsoup.parse(description).text();
- 881
- } else {
- 882 2 desc = description;
- 883
- }
- 884 2 dependency.setDescription(desc);
- 885 2 if (desc.length() > 100) {
- 886 0 desc = desc.replaceAll("\\s\\s+" , " " );
- 887 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
- 888 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
- 889 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
- 890 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
- 891 0 int pos = -1;
- 892 0 pos = Math.max(pos, posSuchAs);
- 893 0 if (pos >= 0 && posLike >= 0) {
- 894 0 pos = Math.min(pos, posLike);
- 895
- } else {
- 896 0 pos = Math.max(pos, posLike);
- 897
- }
- 898 0 if (pos >= 0 && posWillUse >= 0) {
- 899 0 pos = Math.min(pos, posWillUse);
- 900
- } else {
- 901 0 pos = Math.max(pos, posWillUse);
- 902
- }
- 903 0 if (pos >= 0 && posUses >= 0) {
- 904 0 pos = Math.min(pos, posUses);
- 905
- } else {
- 906 0 pos = Math.max(pos, posUses);
- 907
- }
- 908
-
- 909 0 if (pos > 0) {
- 910 0 final StringBuilder sb = new StringBuilder(pos + 3);
- 911 0 sb.append(desc.substring(0, pos));
- 912 0 sb.append("..." );
- 913 0 desc = sb.toString();
- 914
- }
- 915 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 916 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 917 0 } else {
- 918 2 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
- 919 2 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
- 920
- }
- 921 2 return desc;
- 922
- }
- 923
-
- 924
-
- 925
-
- 926
-
- 927
-
- 928
-
- 929
-
- 930
- private void addLicense(Dependency d, String license) {
- 931 2 if (d.getLicense() == null ) {
- 932 2 d.setLicense(license);
- 933 0 } else if (!d.getLicense().contains(license)) {
- 934 0 d.setLicense(d.getLicense() + NEWLINE + license);
- 935
- }
- 936 2 }
- 937
-
- 938
-
- 939
-
- 940
-
- 941 7 private File tempFileLocation = null ;
- 942
-
- 943
-
- 944
- 945
+ 878
- 946
+ 879
- 947
+ 880
- 948
+ 881
@Override
- 949
+ 882
public void initializeFileTypeAnalyzer() throws Exception {
- 950 1 final File baseDir = Settings.getTempDirectory();
- 951 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
- 952 1 if (!tempFileLocation.delete()) {
- 953 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
- 954 0 throw new AnalysisException(msg);
- 955
+ 883 1 final File baseDir = Settings.getTempDirectory();
+ 884 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+ 885 1 if (!tempFileLocation.delete()) {
+ 886 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+ 887 0 throw new AnalysisException(msg);
+ 888
}
- 956 1 if (!tempFileLocation.mkdirs()) {
- 957 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
- 958 0 throw new AnalysisException(msg);
- 959
+ 889 1 if (!tempFileLocation.mkdirs()) {
+ 890 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+ 891 0 throw new AnalysisException(msg);
+ 892
}
- 960 1 }
- 961
+ 893 1 }
+ 894
- 962
+ 895
- 963
+ 896
- 964
+ 897
- 965
+ 898
@Override
- 966
+ 899
public void close() {
- 967 1 if (tempFileLocation != null && tempFileLocation.exists()) {
- 968 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
- 969 1 final boolean success = FileUtils.delete(tempFileLocation);
- 970 1 if (!success) {
- 971 0 LOGGER.log(Level.WARNING,
- 972
+ 900 1 if (tempFileLocation != null && tempFileLocation.exists()) {
+ 901 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
+ 902 1 final boolean success = FileUtils.delete(tempFileLocation);
+ 903 1 if (!success) {
+ 904 0 LOGGER.log(Level.WARNING,
+ 905
"Failed to delete some temporary files, see the log for more details" );
- 973
+ 906
}
- 974
+ 907
}
- 975 1 }
- 976
+ 908 1 }
+ 909
- 977
+ 910
- 978
+ 911
- 979
+ 912
- 980
+ 913
- 981
+ 914
- 982
+ 915
- 983
+ 916
- 984
+ 917
- 985
+ 918
- 986
+ 919
- 987
+ 920
- 988
+ 921
- 989
+ 922
- 990
+ 923
- 991
+ 924
- 992
+ 925
- 993
+ 926
- 994
+ 927
- 995
+ 928
- 996
+ 929
- 997
+ 930
- 998
+ 931
- 999
+ 932
- 1000
+ 933
- 1001
+ 934
- 1002
+ 935
- 1003
+ 936
public static String interpolateString(String text, Properties properties) {
- 1004 14 final Properties props = properties;
- 1005 14 if (text == null ) {
- 1006 1 return text;
- 1007
+ 937 14 final Properties props = properties;
+ 938 14 if (text == null ) {
+ 939 1 return text;
+ 940
}
- 1008 13 if (props == null ) {
- 1009 6 return text;
- 1010
+ 941 13 if (props == null ) {
+ 942 6 return text;
+ 943
}
- 1011
+ 944
- 1012 7 final int pos = text.indexOf("${" );
- 1013 7 if (pos < 0) {
- 1014 4 return text;
- 1015
+ 945 7 final int pos = text.indexOf("${" );
+ 946 7 if (pos < 0) {
+ 947 4 return text;
+ 948
}
- 1016 3 final int end = text.indexOf("}" );
- 1017 3 if (end < pos) {
- 1018 0 return text;
- 1019
+ 949 3 final int end = text.indexOf("}" );
+ 950 3 if (end < pos) {
+ 951 0 return text;
+ 952
}
- 1020
+ 953
- 1021 3 final String propName = text.substring(pos + 2, end);
- 1022 3 String propValue = interpolateString(props.getProperty(propName), props);
- 1023 3 if (propValue == null ) {
- 1024 0 propValue = "" ;
- 1025
+ 954 3 final String propName = text.substring(pos + 2, end);
+ 955 3 String propValue = interpolateString(props.getProperty(propName), props);
+ 956 3 if (propValue == null ) {
+ 957 0 propValue = "" ;
+ 958
}
- 1026 3 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
- 1027 3 sb.append(text.subSequence(0, pos));
- 1028 3 sb.append(propValue);
- 1029 3 sb.append(text.substring(end + 1));
- 1030 3 return interpolateString(sb.toString(), props);
- 1031
+ 959 3 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
+ 960 3 sb.append(text.subSequence(0, pos));
+ 961 3 sb.append(propValue);
+ 962 3 sb.append(text.substring(end + 1));
+ 963 3 return interpolateString(sb.toString(), props);
+ 964
}
- 1032
+ 965
- 1033
+ 966
- 1034
+ 967
- 1035
+ 968
- 1036
+ 969
- 1037
+ 970
- 1038
+ 971
- 1039
+ 972
- 1040
+ 973
private boolean isImportPackage(String key, String value) {
- 1041 15 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
- 1042 15 final boolean matches = packageRx.matcher(value).matches();
- 1043 15 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
- 1044
+ 974 15 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
+ 975 15 final boolean matches = packageRx.matcher(value).matches();
+ 976 15 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
+ 977
}
- 1045
+ 978
- 1046
+ 979
- 1047
+ 980
- 1048
+ 981
- 1049
+ 982
- 1050
+ 983
- 1051
+ 984
- 1052
+ 985
- 1053
+ 986
private List<ClassNameInformation> collectClassNames(Dependency dependency) {
- 1054 5 final List<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
- 1055 5 JarFile jar = null ;
- 1056
+ 987 5 final List<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
+ 988 5 JarFile jar = null ;
+ 989
try {
- 1057 5 jar = new JarFile(dependency.getActualFilePath());
- 1058 5 final Enumeration entries = jar.entries();
- 1059 1848 while (entries.hasMoreElements()) {
- 1060 1843 final JarEntry entry = (JarEntry) entries.nextElement();
- 1061 1843 final String name = entry.getName().toLowerCase();
- 1062
+ 990 5 jar = new JarFile(dependency.getActualFilePath());
+ 991 5 final Enumeration entries = jar.entries();
+ 992 1848 while (entries.hasMoreElements()) {
+ 993 1843 final JarEntry entry = (JarEntry) entries.nextElement();
+ 994 1843 final String name = entry.getName().toLowerCase();
+ 995
- 1063 1843 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
- 1064 1535 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
- 1065 1535 classNames.add(className);
- 1066
+ 996 1843 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
+ 997 1535 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
+ 998 1535 classNames.add(className);
+ 999
}
- 1067 1843 }
- 1068 0 } catch (IOException ex) {
- 1069 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
- 1070 0 LOGGER.log(Level.WARNING, msg);
- 1071 0 LOGGER.log(Level.FINE, null , ex);
- 1072
+ 1000 1843 }
+ 1001 0 } catch (IOException ex) {
+ 1002 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
+ 1003 0 LOGGER.log(Level.WARNING, msg);
+ 1004 0 LOGGER.log(Level.FINE, null , ex);
+ 1005
} finally {
- 1073 5 if (jar != null ) {
- 1074
+ 1006 5 if (jar != null ) {
+ 1007
try {
- 1075 5 jar.close();
- 1076 0 } catch (IOException ex) {
- 1077 0 LOGGER.log(Level.FINEST, null , ex);
- 1078 5 }
- 1079
+ 1008 5 jar.close();
+ 1009 0 } catch (IOException ex) {
+ 1010 0 LOGGER.log(Level.FINEST, null , ex);
+ 1011 5 }
+ 1012
}
- 1080
+ 1013
}
- 1081 5 return classNames;
- 1082
+ 1014 5 return classNames;
+ 1015
}
- 1083
+ 1016
- 1084
+ 1017
- 1085
+ 1018
- 1086
+ 1019
- 1087
+ 1020
- 1088
+ 1021
- 1089
+ 1022
- 1090
+ 1023
- 1091
+ 1024
- 1092
+ 1025
private void analyzeFullyQualifiedClassNames(List<ClassNameInformation> classNames,
- 1093
+ 1026
Map<String, Integer> vendor, Map<String, Integer> product) {
- 1094 5 for (ClassNameInformation entry : classNames) {
- 1095 1535 final List<String> list = entry.getPackageStructure();
- 1096 1535 addEntry(vendor, list.get(0));
- 1097
+ 1027 5 for (ClassNameInformation entry : classNames) {
+ 1028 1535 final List<String> list = entry.getPackageStructure();
+ 1029 1535 addEntry(vendor, list.get(0));
+ 1030
- 1098 1535 if (list.size() == 2) {
- 1099 0 addEntry(product, list.get(1));
- 1100
+ 1031 1535 if (list.size() == 2) {
+ 1032 0 addEntry(product, list.get(1));
+ 1033
}
- 1101 1535 if (list.size() == 3) {
- 1102 345 addEntry(vendor, list.get(1));
- 1103 345 addEntry(product, list.get(1));
- 1104 345 addEntry(product, list.get(2));
- 1105
+ 1034 1535 if (list.size() == 3) {
+ 1035 345 addEntry(vendor, list.get(1));
+ 1036 345 addEntry(product, list.get(1));
+ 1037 345 addEntry(product, list.get(2));
+ 1038
}
- 1106 1535 if (list.size() >= 4) {
- 1107 1190 addEntry(vendor, list.get(1));
- 1108 1190 addEntry(vendor, list.get(2));
- 1109 1190 addEntry(product, list.get(1));
- 1110 1190 addEntry(product, list.get(2));
- 1111 1190 addEntry(product, list.get(3));
- 1112
+ 1039 1535 if (list.size() >= 4) {
+ 1040 1190 addEntry(vendor, list.get(1));
+ 1041 1190 addEntry(vendor, list.get(2));
+ 1042 1190 addEntry(product, list.get(1));
+ 1043 1190 addEntry(product, list.get(2));
+ 1044 1190 addEntry(product, list.get(3));
+ 1045
}
- 1113 1535 }
- 1114 5 }
- 1115
+ 1046 1535 }
+ 1047 5 }
+ 1048
- 1116
+ 1049
- 1117
+ 1050
- 1118
+ 1051
- 1119
+ 1052
- 1120
+ 1053
- 1121
+ 1054
- 1122
+ 1055
- 1123
+ 1056
private void addEntry(Map<String, Integer> collection, String key) {
- 1124 8520 if (collection.containsKey(key)) {
- 1125 7487 collection.put(key, collection.get(key) + 1);
- 1126
+ 1057 8520 if (collection.containsKey(key)) {
+ 1058 7487 collection.put(key, collection.get(key) + 1);
+ 1059
} else {
- 1127 1033 collection.put(key, 1);
- 1128
+ 1060 1033 collection.put(key, 1);
+ 1061
}
- 1129 8520 }
- 1130
+ 1062 8520 }
+ 1063
- 1131
+ 1064
- 1132
+ 1065
- 1133
+ 1066
- 1134
+ 1067
- 1135
+ 1068
- 1136
+ 1069
- 1137
+ 1070
- 1138
+ 1071
- 1139
+ 1072
- 1140
+ 1073
private void addMatchingValues(List<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
- 1141 39 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
- 1142 0 return ;
- 1143
+ 1074 39 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
+ 1075 0 return ;
+ 1076
}
- 1144 39 final String text = value.toLowerCase();
- 1145 39 for (ClassNameInformation cni : classes) {
- 1146 15708 for (String key : cni.getPackageStructure()) {
- 1147 60662 if (text.contains(key)) {
- 1148 14608 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
- 1149
+ 1077 39 final String text = value.toLowerCase();
+ 1078 39 for (ClassNameInformation cni : classes) {
+ 1079 15708 for (String key : cni.getPackageStructure()) {
+ 1080 60662 if (text.contains(key)) {
+ 1081 14608 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
+ 1082
}
- 1150 60662 }
- 1151 15708 }
- 1152 39 }
- 1153
+ 1083 60662 }
+ 1084 15708 }
+ 1085 39 }
+ 1086
- 1154
+ 1087
- 1155
+ 1088
- 1156
+ 1089
- 1157
+ 1090
- 1158
+ 1091
- 1159
+ 1092
- 1160
+ 1093
- 1161
+ 1094
private boolean isPackage(String key, String value) {
- 1162
+ 1095
- 1163 15 return !key.matches(".*(version|title|vendor|name|license|description).*" )
- 1164
+ 1096 15 return !key.matches(".*(version|title|vendor|name|license|description).*" )
+ 1097
&& value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
- 1165
+ 1098
- 1166
+ 1099
}
- 1167
+ 1100
- 1168
+ 1101
- 1169
+ 1102
- 1170
+ 1103
- 1171
+ 1104
- 1172
+ 1105
- 1173
+ 1106
- 1174
+ 1107
- 1175
+ 1108
public static void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
- 1176
+ 1109
- 1177 1 if (pom.getLicenses() != null ) {
- 1178 0 String license = null ;
- 1179 0 for (License lic : pom.getLicenses().getLicense()) {
- 1180 0 String tmp = null ;
- 1181 0 if (lic.getName() != null ) {
- 1182 0 tmp = interpolateString(lic.getName(), pomProperties);
- 1183
+ 1110 1 if (pom.getLicenses() != null ) {
+ 1111 1 String license = null ;
+ 1112 1 for (License lic : pom.getLicenses()) {
+ 1113 0 String tmp = null ;
+ 1114 0 if (lic.getName() != null ) {
+ 1115 0 tmp = interpolateString(lic.getName(), pomProperties);
+ 1116
}
- 1184 0 if (lic.getUrl() != null ) {
- 1185 0 if (tmp == null ) {
- 1186 0 tmp = interpolateString(lic.getUrl(), pomProperties);
- 1187
+ 1117 0 if (lic.getUrl() != null ) {
+ 1118 0 if (tmp == null ) {
+ 1119 0 tmp = interpolateString(lic.getUrl(), pomProperties);
+ 1120
} else {
- 1188 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
- 1189
+ 1121 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
+ 1122
}
- 1190
+ 1123
}
- 1191 0 if (tmp == null ) {
- 1192 0 continue ;
- 1193
+ 1124 0 if (tmp == null ) {
+ 1125 0 continue ;
+ 1126
}
- 1194 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
- 1195 0 tmp = Jsoup.parse(tmp).text();
- 1196
+ 1127 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
+ 1128 0 tmp = Jsoup.parse(tmp).text();
+ 1129
}
- 1197 0 if (license == null ) {
- 1198 0 license = tmp;
- 1199
+ 1130 0 if (license == null ) {
+ 1131 0 license = tmp;
+ 1132
} else {
- 1200 0 license += "\n" + tmp;
- 1201
+ 1133 0 license += "\n" + tmp;
+ 1134
}
- 1202 0 }
- 1203 0 if (license != null ) {
- 1204 0 dependency.setLicense(license);
- 1205
+ 1135 0 }
+ 1136 1 if (license != null ) {
+ 1137 0 dependency.setLicense(license);
+ 1138
}
- 1206
+ 1139
}
- 1207 1 }
- 1208
+ 1140 1 }
+ 1141
- 1209
+ 1142
- 1210
+ 1143
- 1211
+ 1144
- 1212
+ 1145
protected static class ClassNameInformation {
+ 1146
+
+ 1147
+
+ 1148
+
+ 1149
+
+ 1150
+
+ 1151
+
+ 1152
+
+ 1153
+
+ 1154
+
+ 1155
+
+ 1156
+
+ 1157
+
+ 1158
+
+ 1159
+
+ 1160
+
+ 1161
+
+ 1162
+
+ 1163
+
+ 1164
+
+ 1165
+
+ 1166
+
+ 1167 1535 ClassNameInformation(String className) {
+ 1168 1535 name = className;
+ 1169 1535 if (name.contains("/" )) {
+ 1170 1535 final String[] tmp = className.toLowerCase().split("/" );
+ 1171 1535 int start = 0;
+ 1172 1535 int end = 3;
+ 1173 1535 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
+ 1174 1535 start = 1;
+ 1175 1535 end = 4;
+ 1176
+ }
+ 1177 1535 if (tmp.length <= end) {
+ 1178 345 end = tmp.length - 1;
+ 1179
+ }
+ 1180 7330 for (int i = start; i <= end; i++) {
+ 1181 5795 packageStructure.add(tmp[i]);
+ 1182
+ }
+ 1183 1535 } else {
+ 1184 0 packageStructure.add(name);
+ 1185
+ }
+ 1186 1535 }
+ 1187
+
+ 1188
+
+ 1189
+
+ 1190
+ private String name;
+ 1191
+
+ 1192
+
+ 1193
+
+ 1194
+
+ 1195
+
+ 1196
+
+ 1197
+ public String getName() {
+ 1198 0 return name;
+ 1199
+ }
+ 1200
+
+ 1201
+
+ 1202
+
+ 1203
+
+ 1204
+
+ 1205
+
+ 1206
+ public void setName(String name) {
+ 1207 0 this .name = name;
+ 1208 0 }
+ 1209
+
+ 1210
+
+ 1211
+
+ 1212 1535 private final ArrayList<String> packageStructure = new ArrayList<String>();
1213
1214
1215
-
- 1216
-
- 1217
-
- 1218
-
- 1219
-
- 1220
-
- 1221
-
- 1222
-
- 1223
-
- 1224
-
- 1225
-
- 1226
-
- 1227
-
- 1228
-
- 1229
-
- 1230
-
- 1231
-
- 1232
-
- 1233
-
- 1234 1535 ClassNameInformation(String className) {
- 1235 1535 name = className;
- 1236 1535 if (name.contains("/" )) {
- 1237 1535 final String[] tmp = className.toLowerCase().split("/" );
- 1238 1535 int start = 0;
- 1239 1535 int end = 3;
- 1240 1535 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
- 1241 1535 start = 1;
- 1242 1535 end = 4;
- 1243
- }
- 1244 1535 if (tmp.length <= end) {
- 1245 345 end = tmp.length - 1;
- 1246
- }
- 1247 7330 for (int i = start; i <= end; i++) {
- 1248 5795 packageStructure.add(tmp[i]);
- 1249
- }
- 1250 1535 } else {
- 1251 0 packageStructure.add(name);
- 1252
- }
- 1253 1535 }
- 1254
-
- 1255
-
- 1256
-
- 1257
- private String name;
- 1258
-
- 1259
-
- 1260
-
- 1261
-
- 1262
-
- 1263
-
- 1264
- public String getName() {
- 1265 0 return name;
- 1266
- }
- 1267
-
- 1268
-
- 1269
-
- 1270
-
- 1271
-
- 1272
-
- 1273
- public void setName(String name) {
- 1274 0 this .name = name;
- 1275 0 }
- 1276
-
- 1277
-
- 1278
-
- 1279 1535 private final ArrayList<String> packageStructure = new ArrayList<String>();
- 1280
-
- 1281
-
- 1282
- 1283
+ 1216
- 1284
+ 1217
- 1285
+ 1218
- 1286
+ 1219
public ArrayList<String> getPackageStructure() {
- 1287 17243 return packageStructure;
- 1288
+ 1220 17243 return packageStructure;
+ 1221
}
- 1289
+ 1222
}
- 1290
+ 1223
- 1291
+ 1224
- 1292
+ 1225
- 1293
+ 1226
- 1294
+ 1227
- 1295
+ 1228
- 1296
+ 1229
- 1297
+ 1230
private File getNextTempDirectory() throws AnalysisException {
- 1298 0 dirCount += 1;
- 1299 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 1300
+ 1231 0 dirCount += 1;
+ 1232 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 1233
- 1301 0 if (directory.exists()) {
- 1302 0 return getNextTempDirectory();
- 1303
+ 1234 0 if (directory.exists()) {
+ 1235 0 return getNextTempDirectory();
+ 1236
}
- 1304 0 if (!directory.mkdirs()) {
- 1305 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
- 1306 0 throw new AnalysisException(msg);
- 1307
+ 1237 0 if (!directory.mkdirs()) {
+ 1238 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 1239 0 throw new AnalysisException(msg);
+ 1240
}
- 1308 0 return directory;
- 1309
+ 1241 0 return directory;
+ 1242
}
- 1310
+ 1243
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
index 3bdc4a7ef..39942edb8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
@@ -92,7 +92,7 @@
37
38
-
+
39
40 5 public class JavaScriptAnalyzer extends AbstractFileTypeAnalyzer {
@@ -274,6 +274,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
index 63f79d2ce..5f4440823 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
@@ -12,7 +12,7 @@
@@ -88,7 +88,7 @@
35
import org.owasp.dependencycheck.dependency.Evidence;
36
- import org.owasp.dependencycheck.jaxb.pom.PomUtils;
+ import org.owasp.dependencycheck.xml.pom.PomUtils;
37
import org.owasp.dependencycheck.utils.InvalidSettingException;
38
@@ -112,13 +112,13 @@
47
48
-
+
49
-
+
50
-
+
51
-
+
52
53
@@ -195,278 +195,271 @@
91 2 private final boolean enabled = checkEnabled();
92
-
+
93
-
+
94
-
- 95 2 private final PomUtils pomUtil = new PomUtils();
- 96
-
- 97
-
- 98
- 99
+ 95
- 100
+ 96
- 101
+ 97
- 102
+ 98
private boolean checkEnabled() {
- 103
+ 99
- 104
+ 100
- 105
+ 101
- 106
+ 102
- 107 2 boolean retval = false ;
- 108
+ 103 2 boolean retval = false ;
+ 104
try {
- 109 2 if ((!DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL)))
- 110
+ 105 2 if ((!DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL)))
+ 106
&& Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)) {
- 111 0 LOGGER.info("Enabling Nexus analyzer" );
- 112 0 retval = true ;
- 113
+ 107 0 LOGGER.info("Enabling Nexus analyzer" );
+ 108 0 retval = true ;
+ 109
} else {
- 114 2 LOGGER.fine("Nexus analyzer disabled, using Central instead" );
+ 110 2 LOGGER.fine("Nexus analyzer disabled, using Central instead" );
+ 111
+ }
+ 112 0 } catch (InvalidSettingException ise) {
+ 113 0 LOGGER.warning("Invalid setting. Disabling Nexus analyzer" );
+ 114 2 }
115
- }
- 116 0 } catch (InvalidSettingException ise) {
- 117 0 LOGGER.warning("Invalid setting. Disabling Nexus analyzer" );
- 118 2 }
+
+ 116 2 return retval;
+ 117
+ }
+ 118
+
119
-
- 120 2 return retval;
- 121
- }
- 122
-
- 123
- 124
+ 120
- 125
+ 121
- 126
+ 122
- 127
+ 123
- 128
+ 124
@Override
- 129
+ 125
public boolean isEnabled() {
- 130 0 return enabled;
- 131
+ 126 0 return enabled;
+ 127
}
- 132
+ 128
- 133
+ 129
- 134
+ 130
- 135
+ 131
- 136
+ 132
- 137
+ 133
- 138
+ 134
@Override
- 139
+ 135
public void initializeFileTypeAnalyzer() throws Exception {
- 140 0 LOGGER.fine("Initializing Nexus Analyzer" );
- 141 0 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
- 142 0 if (isEnabled()) {
- 143 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
- 144 0 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
- 145
+ 136 0 LOGGER.fine("Initializing Nexus Analyzer" );
+ 137 0 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
+ 138 0 if (isEnabled()) {
+ 139 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
+ 140 0 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
+ 141
try {
- 146 0 searcher = new NexusSearch(new URL(searchUrl));
- 147 0 if (!searcher.preflightRequest()) {
- 148 0 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
- 149 0 setEnabled(false );
- 150
+ 142 0 searcher = new NexusSearch(new URL(searchUrl));
+ 143 0 if (!searcher.preflightRequest()) {
+ 144 0 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
+ 145 0 setEnabled(false );
+ 146
}
- 151 0 } catch (MalformedURLException mue) {
- 152
+ 147 0 } catch (MalformedURLException mue) {
+ 148
- 153
+ 149
- 154 0 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
- 155 0 setEnabled(false );
- 156 0 }
+ 150 0 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
+ 151 0 setEnabled(false );
+ 152 0 }
+ 153
+ }
+ 154 0 }
+ 155
+
+ 156
+
157
- }
- 158 0 }
- 159
-
- 160
-
- 161
- 162
+ 158
- 163
+ 159
- 164
+ 160
- 165
+ 161
@Override
- 166
+ 162
public String getName() {
- 167 4 return ANALYZER_NAME;
- 168
+ 163 4 return ANALYZER_NAME;
+ 164
}
- 169
+ 165
- 170
+ 166
- 171
+ 167
- 172
+ 168
- 173
+ 169
- 174
+ 170
- 175
+ 171
@Override
- 176
+ 172
protected String getAnalyzerEnabledSettingKey() {
- 177 2 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
- 178
+ 173 2 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
+ 174
}
- 179
+ 175
- 180
+ 176
- 181
+ 177
- 182
+ 178
- 183
+ 179
- 184
+ 180
- 185
+ 181
@Override
- 186
+ 182
public AnalysisPhase getAnalysisPhase() {
- 187 1 return ANALYSIS_PHASE;
- 188
+ 183 1 return ANALYSIS_PHASE;
+ 184
}
- 189
+ 185
- 190
+ 186
- 191
+ 187
- 192
+ 188
- 193
+ 189
- 194
+ 190
- 195
+ 191
@Override
- 196
+ 192
public Set<String> getSupportedExtensions() {
- 197 0 return SUPPORTED_EXTENSIONS;
- 198
+ 193 0 return SUPPORTED_EXTENSIONS;
+ 194
}
- 199
+ 195
- 200
+ 196
- 201
+ 197
- 202
+ 198
- 203
+ 199
- 204
+ 200
- 205
+ 201
- 206
+ 202
- 207
+ 203
@Override
- 208
+ 204
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 209 0 if (!isEnabled()) {
- 210 0 return ;
- 211
+ 205 0 if (!isEnabled()) {
+ 206 0 return ;
+ 207
}
- 212
+ 208
try {
- 213 0 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
- 214 0 dependency.addAsEvidence("nexus" , ma, Confidence.HIGH);
- 215 0 boolean pomAnalyzed = false ;
- 216 0 LOGGER.fine("POM URL " + ma.getPomUrl());
- 217 0 for (Evidence e : dependency.getVendorEvidence()) {
- 218 0 if ("pom" .equals(e.getSource())) {
- 219 0 pomAnalyzed = true ;
- 220 0 break ;
+ 209 0 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
+ 210 0 dependency.addAsEvidence("nexus" , ma, Confidence.HIGH);
+ 211 0 boolean pomAnalyzed = false ;
+ 212 0 LOGGER.fine("POM URL " + ma.getPomUrl());
+ 213 0 for (Evidence e : dependency.getVendorEvidence()) {
+ 214 0 if ("pom" .equals(e.getSource())) {
+ 215 0 pomAnalyzed = true ;
+ 216 0 break ;
+ 217
+ }
+ 218 0 }
+ 219 0 if (!pomAnalyzed && ma.getPomUrl() != null ) {
+ 220 0 File pomFile = null ;
221
- }
- 222 0 }
- 223 0 if (!pomAnalyzed && ma.getPomUrl() != null ) {
- 224 0 File pomFile = null ;
- 225
try {
- 226 0 final File baseDir = Settings.getTempDirectory();
- 227 0 pomFile = File.createTempFile("pom" , ".xml" , baseDir);
- 228 0 if (!pomFile.delete()) {
- 229 0 final String msg = String.format("Unable to fetch pom.xml for %s from Nexus repository; "
- 230
+ 222 0 final File baseDir = Settings.getTempDirectory();
+ 223 0 pomFile = File.createTempFile("pom" , ".xml" , baseDir);
+ 224 0 if (!pomFile.delete()) {
+ 225 0 final String msg = String.format("Unable to fetch pom.xml for %s from Nexus repository; "
+ 226
+ "this could result in undetected CPE/CVEs." , dependency.getFileName());
- 231 0 LOGGER.warning(msg);
- 232 0 LOGGER.fine("Unable to delete temp file" );
- 233
+ 227 0 LOGGER.warning(msg);
+ 228 0 LOGGER.fine("Unable to delete temp file" );
+ 229
}
- 234 0 LOGGER.fine(String.format("Downloading %s" , ma.getPomUrl()));
- 235 0 Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile);
- 236 0 pomUtil.analyzePOM(dependency, pomFile);
- 237 0 } catch (DownloadFailedException ex) {
- 238 0 final String msg = String.format("Unable to download pom.xml for %s from Nexus repository; "
- 239
+ 230 0 LOGGER.fine(String.format("Downloading %s" , ma.getPomUrl()));
+ 231 0 Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile);
+ 232 0 PomUtils.analyzePOM(dependency, pomFile);
+ 233 0 } catch (DownloadFailedException ex) {
+ 234 0 final String msg = String.format("Unable to download pom.xml for %s from Nexus repository; "
+ 235
+ "this could result in undetected CPE/CVEs." , dependency.getFileName());
- 240 0 LOGGER.warning(msg);
- 241
+ 236 0 LOGGER.warning(msg);
+ 237
} finally {
- 242 0 if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) {
- 243 0 pomFile.deleteOnExit();
- 244
+ 238 0 if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) {
+ 239 0 pomFile.deleteOnExit();
+ 240
}
- 245
+ 241
}
- 246
+ 242
}
- 247 0 } catch (IllegalArgumentException iae) {
- 248
+ 243 0 } catch (IllegalArgumentException iae) {
+ 244
- 249 0 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
- 250 0 } catch (FileNotFoundException fnfe) {
- 251
+ 245 0 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
+ 246 0 } catch (FileNotFoundException fnfe) {
+ 247
- 252 0 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
- 253 0 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
- 254 0 } catch (IOException ioe) {
- 255
+ 248 0 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
+ 249 0 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
+ 250 0 } catch (IOException ioe) {
+ 251
- 256 0 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
- 257 0 }
- 258 0 }
- 259
+ 252 0 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
+ 253 0 }
+ 254 0 }
+ 255
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
index fd6587ddc..f03c8b4fb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
@@ -296,6 +296,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
index a4ecd8d6f..f368989de 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
@@ -86,7 +86,7 @@
34
35
-
+
36
37 2 public class NvdCveAnalyzer implements Analyzer {
@@ -292,6 +292,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
index 626d400b3..135e6c457 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31 2 public class VulnerabilitySuppressionAnalyzer extends AbstractSuppressionAnalyzer {
@@ -159,6 +159,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
index 5759a1078..2749f3cda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -143,6 +143,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
index ba5d6a664..dedc065e9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -143,6 +143,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
index a2a44c5fa..67f9bcc9f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
@@ -286,6 +286,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
index 7eb296dd9..573bbb4f3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
@@ -124,7 +124,7 @@
53
54
-
+
55
56
@@ -356,13 +356,13 @@
185
public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
- 186 24669 final Document doc = new Document();
- 187 24669 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
- 188 24669 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
- 189 24669 doc.add(v);
- 190 24669 doc.add(p);
- 191 24669 indexWriter.addDocument(doc);
- 192 24669 }
+ 186 24789 final Document doc = new Document();
+ 187 24789 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
+ 188 24789 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
+ 189 24789 doc.add(v);
+ 190 24789 doc.add(p);
+ 191 24789 indexWriter.addDocument(doc);
+ 192 24789 }
193
194
@@ -424,8 +424,8 @@
try {
233 1 final Set<Pair<String, String>> data = cve.getVendorProductList();
234 1 for (Pair<String, String> pair : data) {
- 235 24669 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
- 236 24669 }
+ 235 24789 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
+ 236 24789 }
237 0 } catch (DatabaseException ex) {
238 0 LOGGER.log(Level.FINE, null , ex);
239 0 throw new IndexException("Error reading CPE data" , ex);
@@ -553,7 +553,7 @@
315
public Document getDocument(int documentId) throws IOException {
- 316 43 return indexSearcher.doc(documentId);
+ 316 47 return indexSearcher.doc(documentId);
317
}
318
@@ -581,6 +581,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
index 86843b483..ec5fd5032 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -107,6 +107,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
index 1501c06a7..bb7d5108f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
@@ -70,10 +70,10 @@
26
27
-
+
28
- 29 1377 public class IndexEntry implements Serializable {
+ 29 1381 public class IndexEntry implements Serializable {
30
31
@@ -168,8 +168,8 @@
79
public void setVendor(String vendor) {
- 80 1376 this .vendor = vendor;
- 81 1376 }
+ 80 1380 this .vendor = vendor;
+ 81 1380 }
82
83
@@ -192,7 +192,7 @@
92
public String getProduct() {
- 93 58 return product;
+ 93 62 return product;
94
}
95
@@ -209,8 +209,8 @@
101
public void setProduct(String product) {
- 102 1376 this .product = product;
- 103 1376 }
+ 102 1380 this .product = product;
+ 103 1380 }
104
105
@@ -250,8 +250,8 @@
123
public void setSearchScore(float searchScore) {
- 124 43 this .searchScore = searchScore;
- 125 43 }
+ 124 47 this .searchScore = searchScore;
+ 125 47 }
126
127
@@ -320,17 +320,17 @@
@Override
164
public boolean equals(Object obj) {
- 165 139 if (obj == null ) {
+ 165 171 if (obj == null ) {
166 0 return false ;
167
}
- 168 139 if (getClass() != obj.getClass()) {
+ 168 171 if (getClass() != obj.getClass()) {
169 0 return false ;
170
}
- 171 139 final IndexEntry other = (IndexEntry) obj;
- 172 139 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
- 173 134 return false ;
+ 171 171 final IndexEntry other = (IndexEntry) obj;
+ 172 171 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
+ 173 166 return false ;
174
}
175 5 if ((this .product == null ) ? (other.product != null ) : !this .product.equals(other.product)) {
@@ -356,13 +356,13 @@
@Override
187
public String toString() {
- 188 43 return "IndexEntry{" + "vendor=" + vendor + ", product=" + product + '}' ;
+ 188 47 return "IndexEntry{" + "vendor=" + vendor + ", product=" + product + '}' ;
189
}
190
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
index e73e3b2f6..835aeacbd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -143,6 +143,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
index ab5d34caf..5d49952b1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31
@@ -182,6 +182,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
index c5cce9d74..803243dc5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
@@ -72,7 +72,7 @@
27
28
-
+
29
30 0 public class CweHandler extends DefaultHandler {
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
index 6031f2c11..ecb31a8bf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
@@ -72,7 +72,7 @@
27
28
-
+
29
30
@@ -85,7 +85,7 @@
34
- 35 10 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 35 9 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
36
37
@@ -100,7 +100,7 @@
42
protected CharTermAttribute getTermAtt() {
- 43 25757 return termAtt;
+ 43 19600 return termAtt;
44
}
45
@@ -125,7 +125,7 @@
55
protected LinkedList<String> getTokens() {
- 56 25758 return tokens;
+ 56 19490 return tokens;
57
}
58
@@ -142,9 +142,9 @@
64
public AbstractTokenizingFilter(TokenStream stream) {
- 65 10 super (stream);
- 66 10 tokens = new LinkedList<String>();
- 67 10 }
+ 65 9 super (stream);
+ 66 9 tokens = new LinkedList<String>();
+ 67 9 }
68
69
@@ -159,20 +159,20 @@
74
protected boolean addTerm() {
- 75 25700 final boolean termAdded = !tokens.isEmpty();
- 76 25697 if (termAdded) {
- 77 17242 final String term = tokens.pop();
- 78 17240 clearAttributes();
- 79 17239 termAtt.append(term);
+ 75 19420 final boolean termAdded = !tokens.isEmpty();
+ 76 19177 if (termAdded) {
+ 77 12818 final String term = tokens.pop();
+ 78 12798 clearAttributes();
+ 79 12919 termAtt.append(term);
80
}
- 81 25694 return termAdded;
+ 81 19203 return termAdded;
82
}
83
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
index 5191d7d3c..06933afa6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
@@ -70,7 +70,7 @@
26
27
-
+
28
29
@@ -131,13 +131,13 @@
@Override
59
protected boolean isTokenChar(int c) {
- 60 588397 return Character.isLetter(c) || Character.isDigit(c);
+ 60 591571 return Character.isLetter(c) || Character.isDigit(c);
61
}
62
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
index 551341dcf..e498ee131 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
@@ -64,7 +64,7 @@
23
24
-
+
25
26 0 public class DependencySimilarity extends DefaultSimilarity {
@@ -111,6 +111,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
index f84ff720c..3a5a6f92e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
@@ -86,7 +86,7 @@
34
35
-
+
36
37
@@ -170,6 +170,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
index 6ff52f72d..6eab9b151 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
@@ -70,7 +70,7 @@
26
27
-
+
28
29
@@ -124,15 +124,15 @@
final CharSequence text) {
55
- 56 102 if (text == null || buf == null ) {
+ 56 150 if (text == null || buf == null ) {
57 1 return ;
58
}
59
- 60 991 for (int i = 0; i < text.length(); i++) {
- 61 890 final char c = text.charAt(i);
- 62 890 switch (c) {
+ 60 1291 for (int i = 0; i < text.length(); i++) {
+ 61 1142 final char c = text.charAt(i);
+ 62 1142 switch (c) {
63
case '+' :
64
@@ -172,14 +172,14 @@
81 58 buf.append('\\' );
82
default :
- 83 890 buf.append(c);
+ 83 1142 buf.append(c);
84
break ;
85
}
86
}
- 87 101 }
+ 87 149 }
88
89
@@ -198,27 +198,27 @@
public static String escapeLuceneQuery(final CharSequence text) {
96
- 97 101 if (text == null ) {
+ 97 149 if (text == null ) {
98 1 return null ;
99
}
100
- 101 100 int size = text.length();
- 102 100 size = size >> 1;
- 103 100 final StringBuilder buf = new StringBuilder(size);
+ 101 148 int size = text.length();
+ 102 148 size = size >> 1;
+ 103 148 final StringBuilder buf = new StringBuilder(size);
104
- 105 100 appendEscapedLuceneQuery(buf, text);
+ 105 148 appendEscapedLuceneQuery(buf, text);
106
- 107 100 return buf.toString();
+ 107 148 return buf.toString();
108
}
109
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
index cc883b9ed..bdb40841e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
@@ -82,7 +82,7 @@
32
33
-
+
34
35
@@ -196,6 +196,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
index 85da73540..cd7853518 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
@@ -80,7 +80,7 @@
31
32
-
+
33
34
@@ -185,35 +185,35 @@
87
- 88 650 while (input.incrementToken()) {
- 89 184 final String word = new String(termAtt.buffer(), 0, termAtt.length());
- 90 184 words.add(word);
- 91 184 }
+ 88 842 while (input.incrementToken()) {
+ 89 232 final String word = new String(termAtt.buffer(), 0, termAtt.length());
+ 90 232 words.add(word);
+ 91 232 }
92
93
94
- 95 466 if (previousWord != null && !words.isEmpty()) {
- 96 176 final String word = words.getFirst();
- 97 176 clearAttributes();
- 98 176 termAtt.append(previousWord).append(word);
- 99 176 previousWord = null ;
- 100 176 return true ;
+ 95 610 if (previousWord != null && !words.isEmpty()) {
+ 96 224 final String word = words.getFirst();
+ 97 224 clearAttributes();
+ 98 224 termAtt.append(previousWord).append(word);
+ 99 224 previousWord = null ;
+ 100 224 return true ;
101
}
102
- 103 290 if (!words.isEmpty()) {
- 104 184 final String word = words.removeFirst();
- 105 184 clearAttributes();
- 106 184 termAtt.append(word);
- 107 184 previousWord = word;
- 108 184 return true ;
+ 103 386 if (!words.isEmpty()) {
+ 104 232 final String word = words.removeFirst();
+ 105 232 clearAttributes();
+ 106 232 termAtt.append(word);
+ 107 232 previousWord = word;
+ 108 232 return true ;
109
}
- 110 106 return false ;
+ 110 154 return false ;
111
}
112
@@ -241,6 +241,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
index 30acf624a..3d8e34094 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
@@ -88,7 +88,7 @@
35
36
-
+
37
38
@@ -112,8 +112,8 @@
48
public UrlTokenizingFilter(TokenStream stream) {
- 49 10 super (stream);
- 50 10 }
+ 49 9 super (stream);
+ 50 9 }
51
52
@@ -134,11 +134,11 @@
@Override
60
public boolean incrementToken() throws IOException {
- 61 25752 final LinkedList<String> tokens = getTokens();
- 62 25750 final CharTermAttribute termAtt = getTermAtt();
- 63 25757 if (tokens.isEmpty() && input.incrementToken()) {
- 64 17235 final String text = new String(termAtt.buffer(), 0, termAtt.length());
- 65 17231 if (UrlStringUtils.containsUrl(text)) {
+ 61 19218 final LinkedList<String> tokens = getTokens();
+ 62 19329 final CharTermAttribute termAtt = getTermAtt();
+ 63 19573 if (tokens.isEmpty() && input.incrementToken()) {
+ 64 12952 final String text = new String(termAtt.buffer(), 0, termAtt.length());
+ 65 12840 if (UrlStringUtils.containsUrl(text)) {
66 6 final String[] parts = text.split("\\s" );
67 12 for (String part : parts) {
68 6 if (UrlStringUtils.isUrl(part)) {
@@ -158,18 +158,18 @@
79
}
80 6 } else {
- 81 17224 tokens.add(text);
+ 81 12860 tokens.add(text);
82
}
83
}
- 84 25693 return addTerm();
+ 84 19288 return addTerm();
85
}
86
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
index 660df0fa5..65453e5e8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
@@ -415,6 +415,6 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
index b5100d9b6..cf23d0e49 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
@@ -12,7 +12,7 @@
@@ -102,7 +102,7 @@
42
43
-
+
44
45
@@ -112,232 +112,244 @@
47
48
-
+
49
50
private boolean useProxy;
51
-
+
52
-
+
53
-
- 54
- 55 0 private static final Logger LOGGER = Logger.getLogger(NexusSearch.class
+ 54 0 private String userName = null ;
+ 55
+
56
- .getName());
+
57
-
+
58
-
+ private char [] password;
59
-
- 60
-
- 61
-
- 62
-
- 63
-
- 64 0 public NexusSearch(URL rootURL) {
- 65 0 this .rootURL = rootURL;
- 66
- try {
- 67 0 if (null != Settings.getString(Settings.KEYS.PROXY_SERVER)
- 68
- && Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY)) {
- 69 0 useProxy = true ;
- 70 0 LOGGER.fine("Using proxy" );
- 71
- } else {
- 72 0 useProxy = false ;
- 73 0 LOGGER.fine("Not using proxy" );
- 74
- }
- 75 0 } catch (InvalidSettingException ise) {
- 76 0 useProxy = false ;
- 77 0 }
- 78 0 }
- 79
-
- 80
- 81
-
- 82
-
- 83
-
- 84
-
- 85
-
- 86
-
- 87
+ 60
+
+ 61
+ 62 0 private static final Logger LOGGER = Logger.getLogger(NexusSearch.class .getName());
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70 0 public NexusSearch(URL rootURL) {
+ 71 0 this .rootURL = rootURL;
+ 72
+ try {
+ 73 0 if (null != Settings.getString(Settings.KEYS.PROXY_SERVER)
+ 74
+ && Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY)) {
+ 75 0 useProxy = true ;
+ 76 0 LOGGER.fine("Using proxy" );
+ 77
+ } else {
+ 78 0 useProxy = false ;
+ 79 0 LOGGER.fine("Not using proxy" );
+ 80
+ }
+ 81 0 } catch (InvalidSettingException ise) {
+ 82 0 useProxy = false ;
+ 83 0 }
+ 84 0 }
+ 85
+
+ 86
+
+ 87
+
88
- public MavenArtifact searchSha1(String sha1) throws IOException {
- 89 0 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
- 90 0 throw new IllegalArgumentException("Invalid SHA1 format" );
+
+ 89
+
+ 90
+
91
- }
+
92
-
- 93 0 final URL url = new URL(rootURL, String.format("identify/sha1/%s" ,
+
+ 93
+
94
- sha1.toLowerCase()));
- 95
-
- 96 0 LOGGER.fine(String.format("Searching Nexus url %s" , url.toString()));
+ public MavenArtifact searchSha1(String sha1) throws IOException {
+ 95 0 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
+ 96 0 throw new IllegalArgumentException("Invalid SHA1 format" );
97
-
+ }
98
-
- 99
-
+
+ 99 0 final URL url = new URL(rootURL, String.format("identify/sha1/%s" ,
100
-
+ sha1.toLowerCase()));
101
-
- 102
-
- 103 0 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+
+ 102 0 LOGGER.fine(String.format("Searching Nexus url %s" , url.toString()));
+ 103
+
104
-
- 105 0 conn.setDoOutput(true );
+
+ 105
+
106
-
+
107
-
+
108
-
- 109 0 conn.addRequestProperty("Accept" , "application/xml" );
- 110 0 conn.connect();
+ HttpURLConnection conn;
+ 109 0 conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 110 0 conn.setDoOutput(true );
111
- 112 0 if (conn.getResponseCode() == 200) {
+ 112
+
113
+
+ 114 0 conn.addRequestProperty("Accept" , "application/xml" );
+ 115 0 conn.connect();
+ 116
+
+ 117 0 if (conn.getResponseCode() == 200) {
+ 118
try {
- 114 0 final DocumentBuilder builder = DocumentBuilderFactory
- 115
- .newInstance().newDocumentBuilder();
- 116 0 final Document doc = builder.parse(conn.getInputStream());
- 117 0 final XPath xpath = XPathFactory.newInstance().newXPath();
- 118 0 final String groupId = xpath
- 119
- .evaluate(
+ 119 0 final DocumentBuilder builder = DocumentBuilderFactory
120
- "/org.sonatype.nexus.rest.model.NexusArtifact/groupId" ,
- 121
- doc);
- 122 0 final String artifactId = xpath.evaluate(
- 123
- "/org.sonatype.nexus.rest.model.NexusArtifact/artifactId" ,
+ .newInstance().newDocumentBuilder();
+ 121 0 final Document doc = builder.parse(conn.getInputStream());
+ 122 0 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 123 0 final String groupId = xpath
124
- doc);
- 125 0 final String version = xpath
+ .evaluate(
+ 125
+ "/org.sonatype.nexus.rest.model.NexusArtifact/groupId" ,
126
- .evaluate(
- 127
- "/org.sonatype.nexus.rest.model.NexusArtifact/version" ,
+ doc);
+ 127 0 final String artifactId = xpath.evaluate(
128
- doc);
- 129 0 final String link = xpath
- 130
- .evaluate(
+ "/org.sonatype.nexus.rest.model.NexusArtifact/artifactId" ,
+ 129
+ doc);
+ 130 0 final String version = xpath
131
- "/org.sonatype.nexus.rest.model.NexusArtifact/artifactLink" ,
- 132
- doc);
- 133 0 final String pomLink = xpath
- 134
.evaluate(
- 135
- "/org.sonatype.nexus.rest.model.NexusArtifact/pomLink" ,
- 136
+ 132
+ "/org.sonatype.nexus.rest.model.NexusArtifact/version" ,
+ 133
doc);
- 137 0 final MavenArtifact ma = new MavenArtifact(groupId, artifactId, version);
- 138 0 if (link != null && !"" .equals(link)) {
- 139 0 ma.setArtifactUrl(link);
+ 134 0 final String link = xpath
+ 135
+ .evaluate(
+ 136
+ "/org.sonatype.nexus.rest.model.NexusArtifact/artifactLink" ,
+ 137
+ doc);
+ 138 0 final String pomLink = xpath
+ 139
+ .evaluate(
140
+ "/org.sonatype.nexus.rest.model.NexusArtifact/pomLink" ,
+ 141
+ doc);
+ 142 0 final MavenArtifact ma = new MavenArtifact(groupId, artifactId, version);
+ 143 0 if (link != null && !"" .equals(link)) {
+ 144 0 ma.setArtifactUrl(link);
+ 145
}
- 141 0 if (pomLink != null && !"" .equals(pomLink)) {
- 142 0 ma.setPomUrl(pomLink);
- 143
+ 146 0 if (pomLink != null && !"" .equals(pomLink)) {
+ 147 0 ma.setPomUrl(pomLink);
+ 148
}
- 144 0 return ma;
- 145 0 } catch (Throwable e) {
- 146
+ 149 0 return ma;
+ 150 0 } catch (Throwable e) {
+ 151
- 147
-
- 148 0 throw new IOException(e.getMessage(), e);
- 149
- }
- 150 0 } else if (conn.getResponseCode() == 404) {
- 151 0 throw new FileNotFoundException("Artifact not found in Nexus" );
152
- } else {
- 153 0 final String msg = String.format("Could not connect to Nexus received response code: %d %s" ,
+
+ 153 0 throw new IOException(e.getMessage(), e);
154
- conn.getResponseCode(), conn.getResponseMessage());
- 155 0 LOGGER.fine(msg);
- 156 0 throw new IOException(msg);
+ }
+ 155 0 } else if (conn.getResponseCode() == 404) {
+ 156 0 throw new FileNotFoundException("Artifact not found in Nexus" );
157
- }
- 158
- }
+ } else {
+ 158 0 final String msg = String.format("Could not connect to Nexus received response code: %d %s" ,
159
-
- 160
-
- 161
-
+ conn.getResponseCode(), conn.getResponseMessage());
+ 160 0 LOGGER.fine(msg);
+ 161 0 throw new IOException(msg);
162
-
+ }
163
-
- 164
-
- 165
- public boolean preflightRequest() {
- 166
- try {
- 167 0 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(new URL(rootURL, "status" ), useProxy);
- 168 0 conn.addRequestProperty("Accept" , "application/xml" );
- 169 0 conn.connect();
- 170 0 if (conn.getResponseCode() != 200) {
- 171 0 LOGGER.log(Level.WARNING, "Expected 200 result from Nexus, got {0}" , conn.getResponseCode());
- 172 0 return false ;
- 173
- }
- 174 0 final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- 175 0 final Document doc = builder.parse(conn.getInputStream());
- 176 0 if (!"status" .equals(doc.getDocumentElement().getNodeName())) {
- 177 0 LOGGER.log(Level.WARNING, "Expected root node name of status, got {0}" , doc.getDocumentElement().getNodeName());
- 178 0 return false ;
- 179
- }
- 180 0 } catch (Throwable e) {
- 181 0 return false ;
- 182 0 }
- 183
-
- 184 0 return true ;
- 185
}
- 186
- }
- 187
+ 164
- 188
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+ public boolean preflightRequest() {
+ 171
+ HttpURLConnection conn;
+ 172
+ try {
+ 173 0 URL url = new URL(rootURL, "status" );
+ 174 0 conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 175 0 conn.addRequestProperty("Accept" , "application/xml" );
+ 176 0 conn.connect();
+ 177 0 if (conn.getResponseCode() != 200) {
+ 178 0 LOGGER.log(Level.WARNING, "Expected 200 result from Nexus, got {0}" , conn.getResponseCode());
+ 179 0 return false ;
+ 180
+ }
+ 181 0 final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ 182 0 final Document doc = builder.parse(conn.getInputStream());
+ 183 0 if (!"status" .equals(doc.getDocumentElement().getNodeName())) {
+ 184 0 LOGGER.log(Level.WARNING, "Expected root node name of status, got {0}" , doc.getDocumentElement().getNodeName());
+ 185 0 return false ;
+ 186
+ }
+ 187 0 } catch (Throwable e) {
+ 188 0 return false ;
+ 189 0 }
+ 190
+
+ 191 0 return true ;
+ 192
+ }
+ 193
+ }
+ 194
+
+ 195
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
index 24d201dc5..00de45953 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
@@ -357,6 +357,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
index f32cc66a1..16c26900b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
@@ -147,6 +147,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
index e77ac79a8..659d69111 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
@@ -93,6 +93,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
index e2248c352..6af32a369 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
@@ -163,6 +163,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
index 51f5b4285..16fe897fa 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
@@ -100,7 +100,7 @@
41
42
-
+
43
44
@@ -499,6 +499,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
index 284ec6cfe..2443aaf5d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
@@ -64,7 +64,7 @@
23
24
-
+
25
26
@@ -117,6 +117,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
index cfa3cc114..65d7dc8a1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
@@ -116,7 +116,7 @@
49
50
-
+
51
52
@@ -602,8 +602,8 @@
try {
320 1 ps = getConnection().prepareStatement(SELECT_VENDOR_PRODUCT_LIST);
321 1 rs = ps.executeQuery();
- 322 24670 while (rs.next()) {
- 323 24669 data.add(new Pair<String, String>(rs.getString(1), rs.getString(2)));
+ 322 24790 while (rs.next()) {
+ 323 24789 data.add(new Pair<String, String>(rs.getString(1), rs.getString(2)));
324
}
325 0 } catch (SQLException ex) {
@@ -1374,6 +1374,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
index ad5e8621d..48cbd9fb1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -131,6 +131,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
index 5915459bb..f440a1863 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
@@ -86,7 +86,7 @@
34
35
-
+
36
37
@@ -342,6 +342,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
index 1a3b81c07..4c4fbcabc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -131,6 +131,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
index 809861163..4bbfe2d38 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
@@ -91,7 +91,7 @@
36
37
-
+
38
39
@@ -176,17 +176,17 @@
84 2 final File[] files = file.listFiles();
85
- 86 33 for (File f : files) {
+ 86 34 for (File f : files) {
87
try {
- 88 31 urls.add(f.toURI().toURL());
+ 88 32 urls.add(f.toURI().toURL());
89 0 } catch (MalformedURLException ex) {
90 0 final String msg = String.format("Unable to load database driver '%s'; invalid path provided '%s'" ,
91
className, f.getAbsoluteFile());
92 0 LOGGER.log(Level.FINE, msg, ex);
93 0 throw new DriverLoadException(msg, ex);
- 94 31 }
+ 94 32 }
95
}
96 2 } else if (file.exists()) {
@@ -274,6 +274,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
index 51d03ea4e..a16d35368 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
@@ -90,7 +90,7 @@
36
37
-
+
38
39
@@ -392,6 +392,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
index 064c4d2d5..407c608a6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
@@ -68,7 +68,7 @@
25
26
-
+
27
28
@@ -93,6 +93,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
index f767aec83..191f9816e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.EngineVersionCheck.html
@@ -96,7 +96,7 @@
39
40
-
+
41
42 2 public class EngineVersionCheck implements CachedWebDataSource {
@@ -369,6 +369,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
index 580ccfab5..6b0914f41 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25 15 public class NvdCveInfo {
@@ -276,6 +276,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
index aa3749051..b85eb5087 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
@@ -76,7 +76,7 @@
29
30
-
+
31
32 0 public class NvdCveUpdater implements CachedWebDataSource {
@@ -136,6 +136,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
index be4b32b3e..ab23bf60c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
@@ -110,7 +110,7 @@
46
47
-
+
48
49
@@ -520,6 +520,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
index dc4dc196a..25baf8c0b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
@@ -70,7 +70,7 @@
26
27
-
+
28
29
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
index 46eb94f0a..718aa7de2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
@@ -82,7 +82,7 @@
32
33
-
+
34
35 12 public class UpdateableNvdCve implements java.lang.Iterable<NvdCveInfo>, Iterator<NvdCveInfo> {
@@ -361,6 +361,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
index e50c7a3e9..4b4e151dd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25
@@ -115,6 +115,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
index 561b939a9..7b18a63c7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
@@ -66,7 +66,7 @@
24
25
-
+
26
27
@@ -147,6 +147,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.DownloadTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.DownloadTask.html
index 90ab667a1..47571ed2e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.DownloadTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.DownloadTask.html
@@ -102,7 +102,7 @@
42
43
-
+
44
45 0 public class DownloadTask implements Callable<Future<ProcessTask>> {
@@ -497,8 +497,8 @@
281
int len;
- 282 1521 while ((len = cin.read(buffer)) > 0) {
- 283 1519 out.write(buffer, 0, len);
+ 282 1200 while ((len = cin.read(buffer)) > 0) {
+ 283 1198 out.write(buffer, 0, len);
284
}
285
@@ -532,6 +532,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
index 6993217f2..5a2c507af 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
@@ -106,7 +106,7 @@
44
45
-
+
46
47 0 public class ProcessTask implements Callable<ProcessTask> {
@@ -340,6 +340,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
index 0680a5b19..f0ac532a7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
@@ -87,7 +87,7 @@
34
35
-
+
36
37 1 public class NvdCve12Handler extends DefaultHandler {
@@ -449,6 +449,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
index 9796bb03a..336cbbe3c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
@@ -95,7 +95,7 @@
38
39
-
+
40
41 1 public class NvdCve20Handler extends DefaultHandler {
@@ -867,6 +867,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
index ec8b46fa4..42182ef50 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
@@ -62,7 +62,7 @@
22
23
-
+
24
25 9 public enum Confidence {
@@ -100,6 +100,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
index 01ad19c27..9043d400f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
@@ -98,7 +98,7 @@
40
41
-
+
42
43 2 public class Dependency implements Serializable, Comparable<Dependency> {
@@ -869,7 +869,7 @@
473
public EvidenceCollection getProductEvidence() {
- 474 98 return this .productEvidence;
+ 474 102 return this .productEvidence;
475
}
476
@@ -1446,6 +1446,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
index 64af38224..43a077eb9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
@@ -12,7 +12,7 @@
@@ -66,10 +66,10 @@
24
25
-
+
26
- 27 37353 public class Evidence implements Serializable, Comparable<Evidence> {
+ 27 38725 public class Evidence implements Serializable, Comparable<Evidence> {
28
29
@@ -98,12 +98,12 @@
42
- 43 14719 public Evidence(String source, String name, String value, Confidence confidence) {
- 44 14719 this .source = source;
- 45 14719 this .name = name;
- 46 14719 this .value = value;
- 47 14719 this .confidence = confidence;
- 48 14719 }
+ 43 14740 public Evidence(String source, String name, String value, Confidence confidence) {
+ 44 14740 this .source = source;
+ 45 14740 this .name = name;
+ 46 14740 this .value = value;
+ 47 14740 this .confidence = confidence;
+ 48 14740 }
49
50
@@ -208,8 +208,8 @@
103
public String getValue() {
- 104 709 used = true ;
- 105 709 return value;
+ 104 837 used = true ;
+ 105 837 return value;
106
}
107
@@ -228,8 +228,8 @@
114
public String getValue(Boolean setUsed) {
- 115 50 used = used || setUsed;
- 116 50 return value;
+ 115 52 used = used || setUsed;
+ 116 52 return value;
117
}
118
@@ -270,7 +270,7 @@
137
public boolean isUsed() {
- 138 1059 return used;
+ 138 1279 return used;
139
}
140
@@ -311,7 +311,7 @@
159
public Confidence getConfidence() {
- 160 233 return confidence;
+ 160 239 return confidence;
161
}
162
@@ -372,18 +372,18 @@
@Override
194
public boolean equals(Object that) {
- 195 0 if (this == that) {
+ 195 9 if (this == that) {
196 0 return true ;
197
}
- 198 0 if (!(that instanceof Evidence)) {
+ 198 9 if (!(that instanceof Evidence)) {
199 0 return false ;
200
}
- 201 0 final Evidence e = (Evidence) that;
+ 201 9 final Evidence e = (Evidence) that;
202
- 203 0 return testEquality(name, e.name) && testEquality(source, e.source) && testEquality(value, e.value)
+ 203 9 return testEquality(name, e.name) && testEquality(source, e.source) && testEquality(value, e.value)
204
&& (confidence == null ? e.confidence == null : confidence == e.confidence);
205
@@ -406,7 +406,7 @@
214
private boolean testEquality(String l, String r) {
- 215 0 return l == null ? r == null : l.equalsIgnoreCase(r);
+ 215 11 return l == null ? r == null : l.equalsIgnoreCase(r);
216
}
217
@@ -425,15 +425,15 @@
224
public int compareTo(Evidence o) {
- 225 37353 if (o == null ) {
+ 225 38735 if (o == null ) {
226 0 return 1;
227
}
- 228 37353 if (equalsWithNullCheck(source, o.source)) {
- 229 23683 if (equalsWithNullCheck(name, o.name)) {
- 230 23576 if (equalsWithNullCheck(value, o.value)) {
- 231 14655 if (equalsWithNullCheck(confidence, o.confidence)) {
- 232 14642 return 0;
+ 228 38735 if (equalsWithNullCheck(source, o.source)) {
+ 229 23706 if (equalsWithNullCheck(name, o.name)) {
+ 230 23582 if (equalsWithNullCheck(value, o.value)) {
+ 231 14657 if (equalsWithNullCheck(confidence, o.confidence)) {
+ 232 14644 return 0;
233
} else {
234 13 return compareToWithNullCheck(confidence, o.confidence);
@@ -441,17 +441,17 @@
}
236
} else {
- 237 8921 return compareToIgnoreCaseWithNullCheck(value, o.value);
+ 237 8925 return compareToIgnoreCaseWithNullCheck(value, o.value);
238
}
239
} else {
- 240 107 return compareToIgnoreCaseWithNullCheck(name, o.name);
+ 240 124 return compareToIgnoreCaseWithNullCheck(name, o.name);
241
}
242
} else {
- 243 13670 return compareToIgnoreCaseWithNullCheck(source, o.source);
+ 243 15029 return compareToIgnoreCaseWithNullCheck(source, o.source);
244
}
245
@@ -474,13 +474,13 @@
254
private boolean equalsWithNullCheck(String me, String other) {
- 255 84612 if (me == null && other == null ) {
+ 255 86023 if (me == null && other == null ) {
256 0 return true ;
- 257 84612 } else if (me == null || other == null ) {
+ 257 86023 } else if (me == null || other == null ) {
258 0 return false ;
259
}
- 260 84612 return me.equals(other);
+ 260 86023 return me.equalsIgnoreCase(other);
261
}
262
@@ -501,13 +501,13 @@
270
private boolean equalsWithNullCheck(Confidence me, Confidence other) {
- 271 14655 if (me == null && other == null ) {
+ 271 14657 if (me == null && other == null ) {
272 0 return true ;
- 273 14655 } else if (me == null || other == null ) {
+ 273 14657 } else if (me == null || other == null ) {
274 0 return false ;
275
}
- 276 14655 return me.equals(other);
+ 276 14657 return me.equals(other);
277
}
278
@@ -530,15 +530,15 @@
287
private int compareToIgnoreCaseWithNullCheck(String me, String other) {
- 288 22698 if (me == null && other == null ) {
+ 288 24078 if (me == null && other == null ) {
289 0 return 0;
- 290 22698 } else if (me == null ) {
+ 290 24078 } else if (me == null ) {
291 0 return -1;
- 292 22698 } else if (other == null ) {
+ 292 24078 } else if (other == null ) {
293 0 return 1;
294
}
- 295 22698 return me.compareToIgnoreCase(other);
+ 295 24078 return me.compareToIgnoreCase(other);
296
}
297
@@ -546,9 +546,9 @@
298
299
-
+
300
-
+
301
302
@@ -573,9 +573,28 @@
315
}
316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+ @Override
+ 323
+ public String toString() {
+ 324 0 return "Evidence{" + "name=" + name + ", source=" + source + ", value=" + value + ", confidence=" + confidence + '}' ;
+ 325
+ }
+ 326
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
index 85a2930b6..d819eed3a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
@@ -97,7 +97,7 @@
37
38
-
+
39
40
@@ -117,10 +117,10 @@
48
- 49 59 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
+ 49 61 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
50
public boolean passes(Evidence evidence) {
- 51 58 return evidence.getConfidence() == Confidence.HIGHEST;
+ 51 60 return evidence.getConfidence() == Confidence.HIGHEST;
52
}
53
@@ -131,10 +131,10 @@
56
- 57 49 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
+ 57 50 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
58
public boolean passes(Evidence evidence) {
- 59 48 return evidence.getConfidence() == Confidence.HIGH;
+ 59 49 return evidence.getConfidence() == Confidence.HIGH;
60
}
61
@@ -148,7 +148,7 @@
65 1 private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
66
public boolean passes(Evidence evidence) {
- 67 32 return evidence.getConfidence() == Confidence.MEDIUM;
+ 67 34 return evidence.getConfidence() == Confidence.MEDIUM;
68
}
69
@@ -162,7 +162,7 @@
73 1 private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
74
public boolean passes(Evidence evidence) {
- 75 32 return evidence.getConfidence() == Confidence.LOW;
+ 75 34 return evidence.getConfidence() == Confidence.LOW;
76
}
77
@@ -176,7 +176,7 @@
81 1 private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
82
public boolean passes(Evidence evidence) {
- 83 1057 return evidence.isUsed();
+ 83 1277 return evidence.isUsed();
84
}
85
@@ -417,7 +417,7 @@
221
public Iterator<Evidence> iterator() {
- 222 126 return list.iterator();
+ 222 138 return list.iterator();
223
}
224
@@ -436,23 +436,23 @@
231
public boolean containsUsedString(String text) {
- 232 121 if (text == null ) {
+ 232 133 if (text == null ) {
233 0 return false ;
234
}
- 235 121 final String textToTest = text.toLowerCase();
+ 235 133 final String textToTest = text.toLowerCase();
236
- 237 121 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
+ 237 133 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
238
- 239 643 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
- 240 643 if (value.contains(textToTest)) {
+ 239 768 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
+ 240 768 if (value.contains(textToTest)) {
241 48 return true ;
242
}
- 243 595 }
- 244 73 return false ;
+ 243 720 }
+ 244 85 return false ;
245
}
246
@@ -504,11 +504,11 @@
273
public boolean contains(Confidence confidence) {
274 14 for (Evidence e : list) {
- 275 63 if (e.getConfidence().equals(confidence)) {
+ 275 62 if (e.getConfidence().equals(confidence)) {
276 12 return true ;
277
}
- 278 51 }
+ 278 50 }
279 2 return false ;
280
}
@@ -615,8 +615,8 @@
public String toString() {
342 3 final StringBuilder sb = new StringBuilder();
343 3 for (Evidence e : this .list) {
- 344 12 sb.append(e.getValue()).append(' ' );
- 345 12 }
+ 344 13 sb.append(e.getValue()).append(' ' );
+ 345 13 }
346 3 return sb.toString();
347
}
@@ -677,22 +677,22 @@
376
private String urlCorrection(String value) {
- 377 643 if (value == null || !UrlStringUtils.containsUrl(value)) {
- 378 627 return value;
+ 377 768 if (value == null || !UrlStringUtils.containsUrl(value)) {
+ 378 749 return value;
379
}
- 380 16 final StringBuilder sb = new StringBuilder(value.length());
- 381 16 final String[] parts = value.split("\\s" );
- 382 32 for (String part : parts) {
- 383 16 if (UrlStringUtils.isUrl(part)) {
+ 380 19 final StringBuilder sb = new StringBuilder(value.length());
+ 381 19 final String[] parts = value.split("\\s" );
+ 382 38 for (String part : parts) {
+ 383 19 if (UrlStringUtils.isUrl(part)) {
384
try {
- 385 16 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
- 386 16 sb.append(' ' ).append(StringUtils.join(data, ' ' ));
+ 385 19 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
+ 386 19 sb.append(' ' ).append(StringUtils.join(data, ' ' ));
387 0 } catch (MalformedURLException ex) {
388 0 LOGGER.log(Level.FINE, "error parsing " + part, ex);
389 0 sb.append(' ' ).append(part);
- 390 16 }
+ 390 19 }
391
} else {
392 0 sb.append(' ' ).append(part);
@@ -700,13 +700,13 @@
}
394
}
- 395 16 return sb.toString().trim();
+ 395 19 return sb.toString().trim();
396
}
397
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
index a768ec4eb..0e28dbf65 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
@@ -64,7 +64,7 @@
23
24
-
+
25
26 27 public class Identifier implements Serializable, Comparable<Identifier> {
@@ -425,6 +425,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
index aac40bbb8..068706341 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
@@ -66,7 +66,7 @@
24
25
-
+
26
27 502 public class Reference implements Serializable, Comparable<Reference> {
@@ -287,6 +287,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
index 93fdf880c..ad8e2d233 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
@@ -72,7 +72,7 @@
27
28
-
+
29
30 36 public class Vulnerability implements Serializable, Comparable<Vulnerability> {
@@ -833,6 +833,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
index 149177758..2d3ada036 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
@@ -68,7 +68,7 @@
25
26
-
+
27
28 105 public class VulnerabilityComparator implements Comparator<Vulnerability>, Serializable {
@@ -107,6 +107,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
index ffc2da475..67c5ec920 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
@@ -76,7 +76,7 @@
29
30
-
+
31
32 11337 public class VulnerableSoftware extends IndexEntry implements Serializable, Comparable<VulnerableSoftware> {
@@ -650,6 +650,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
index 3415020ac..761120809 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
@@ -66,7 +66,7 @@
24
25
-
+
26
27
@@ -147,6 +147,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
index 2a6633119..69403d0c2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
@@ -147,6 +147,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
index db3028ac5..f0aef99cb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
@@ -76,7 +76,7 @@
29
30
-
+
31
32 0 public class EscapeTool {
@@ -158,6 +158,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
index e1dd0c7b9..c376ff454 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
@@ -113,7 +113,7 @@
47
48
-
+
49
50
@@ -544,6 +544,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
index 6fc1e6056..01bcbd951 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
@@ -220,6 +220,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
index 36e8760ff..7c3bdd1e5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
@@ -68,7 +68,7 @@
25
26
-
+
27
28 171 public class PropertyType {
@@ -345,6 +345,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
index f63ed908a..2ea079148 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31 9 public class SuppressionErrorHandler implements ErrorHandler {
@@ -196,6 +196,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
index 61884f052..e09d32931 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31 9 public class SuppressionHandler extends DefaultHandler {
@@ -339,6 +339,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
index e15ab9f1a..3fbe5a7cc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
@@ -66,7 +66,7 @@
24
25
-
+
26
27
@@ -137,6 +137,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
index 5e79f1192..65673ac00 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
@@ -96,7 +96,7 @@
39
40
-
+
41
42 6 public class SuppressionParser {
@@ -237,6 +237,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
index d1b082217..d279ef7f7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31 91 public class SuppressionRule {
@@ -831,6 +831,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
index 914d4b1c9..fc220866c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
@@ -76,7 +76,7 @@
29
30
-
+
31
32
@@ -189,6 +189,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
index 9eeadfd13..90954bf54 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DateUtil.html
@@ -60,7 +60,7 @@
21
22
-
+
23
24
@@ -107,6 +107,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
index 88e15bd17..bafcfe2c1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
@@ -92,7 +92,7 @@
37
38
-
+
39
40 14 public class DependencyVersion implements Iterable, Comparable<DependencyVersion> {
@@ -445,6 +445,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
index 2155460d3..c9dcd4465 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
@@ -74,7 +74,7 @@
28
29
-
+
30
31
@@ -181,6 +181,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
index e7318c3c1..6f24d7936 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
@@ -88,7 +88,7 @@
35
36
-
+
37
38
@@ -256,6 +256,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
index cd199d1a2..aff52d3c4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
@@ -56,19 +56,19 @@
19
public Iterator<T> filter(Iterator<T> iterator) {
- 20 142 return new FilterIterator(iterator);
+ 20 154 return new FilterIterator(iterator);
21
}
22
23
public Iterable<T> filter(final Iterable<T> iterable) {
- 24 142 return new Iterable<T>() {
+ 24 154 return new Iterable<T>() {
25
26
public Iterator<T> iterator() {
- 27 142 return filter(iterable.iterator());
+ 27 154 return filter(iterable.iterator());
28
}
29
@@ -86,28 +86,28 @@
private T next;
36
- 37 142 private FilterIterator(Iterator<T> iterator) {
- 38 142 this .iterator = iterator;
- 39 142 toNext();
- 40 142 }
+ 37 154 private FilterIterator(Iterator<T> iterator) {
+ 38 154 this .iterator = iterator;
+ 39 154 toNext();
+ 40 154 }
41
42
public boolean hasNext() {
- 43 788 return next != null ;
+ 43 927 return next != null ;
44
}
45
46
public T next() {
- 47 694 if (next == null ) {
+ 47 821 if (next == null ) {
48 0 throw new NoSuchElementException();
49
}
- 50 694 T returnValue = next;
- 51 694 toNext();
- 52 694 return returnValue;
+ 50 821 T returnValue = next;
+ 51 821 toNext();
+ 52 821 return returnValue;
53
}
54
@@ -121,22 +121,22 @@
59
private void toNext() {
- 60 836 next = null ;
- 61 1325 while (iterator.hasNext()) {
- 62 1230 T item = iterator.next();
- 63 1230 if (item != null && passes(item)) {
- 64 741 next = item;
- 65 741 break ;
+ 60 975 next = null ;
+ 61 1564 while (iterator.hasNext()) {
+ 62 1457 T item = iterator.next();
+ 63 1457 if (item != null && passes(item)) {
+ 64 868 next = item;
+ 65 868 break ;
66
}
- 67 489 }
- 68 836 }
+ 67 589 }
+ 68 975 }
69
}
70
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
index 6d6533366..d4111812f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
@@ -12,7 +12,7 @@
@@ -70,7 +70,7 @@
26
27
-
+
28
29
@@ -89,8 +89,8 @@
36
public NonClosingStream(InputStream in) {
- 37 1 super (in);
- 38 1 }
+ 37 0 super (in);
+ 38 0 }
39
40
@@ -105,11 +105,11 @@
public void close() {
45
- 46 1 }
+ 46 0 }
47
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
index 6fb9d74f5..969ee88e8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
@@ -68,7 +68,7 @@
25
26
-
+
27
28
@@ -97,17 +97,17 @@
41
- 42 24669 public Pair(L left, R right) {
- 43 24669 this .left = left;
- 44 24669 this .right = right;
- 45 24669 }
+ 42 24789 public Pair(L left, R right) {
+ 43 24789 this .left = left;
+ 44 24789 this .right = right;
+ 45 24789 }
46
47
48
- 49 24669 private L left = null ;
+ 49 24789 private L left = null ;
50
51
@@ -122,7 +122,7 @@
56
public L getLeft() {
- 57 24669 return left;
+ 57 24789 return left;
58
}
59
@@ -147,7 +147,7 @@
70
- 71 24669 private R right = null ;
+ 71 24789 private R right = null ;
72
73
@@ -162,7 +162,7 @@
78
public R getRight() {
- 79 24669 return right;
+ 79 24789 return right;
80
}
81
@@ -197,10 +197,10 @@
@Override
97
public int hashCode() {
- 98 24681 int hash = 3;
- 99 24681 hash = 53 * hash + (this .left != null ? this .left.hashCode() : 0);
- 100 24681 hash = 53 * hash + (this .right != null ? this .right.hashCode() : 0);
- 101 24681 return hash;
+ 98 24801 int hash = 3;
+ 99 24801 hash = 53 * hash + (this .left != null ? this .left.hashCode() : 0);
+ 100 24801 hash = 53 * hash + (this .right != null ? this .right.hashCode() : 0);
+ 101 24801 return hash;
102
}
103
@@ -245,6 +245,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
index c6894b5d8..771fccadf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
@@ -78,7 +78,7 @@
30
31
-
+
32
33
@@ -125,7 +125,7 @@
56
public static boolean containsUrl(String text) {
- 57 17880 return CONTAINS_URL_TEST.matcher(text).matches();
+ 57 13740 return CONTAINS_URL_TEST.matcher(text).matches();
58
}
59
@@ -144,7 +144,7 @@
66
public static boolean isUrl(String text) {
- 67 22 return IS_URL_TEST.matcher(text).matches();
+ 67 25 return IS_URL_TEST.matcher(text).matches();
68
}
69
@@ -188,40 +188,40 @@
89
public static List<String> extractImportantUrlData(String text) throws MalformedURLException {
- 90 22 final List<String> importantParts = new ArrayList<String>();
- 91 22 final URL url = new URL(text);
- 92 22 final String[] domain = url.getHost().split("\\." );
+ 90 25 final List<String> importantParts = new ArrayList<String>();
+ 91 25 final URL url = new URL(text);
+ 92 25 final String[] domain = url.getHost().split("\\." );
93
- 94 63 for (int i = 0; i < domain.length - 1; i++) {
- 95 41 final String sub = domain[i];
- 96 41 if (!IGNORE_LIST.contains(sub.toLowerCase())) {
- 97 38 importantParts.add(sub);
+ 94 72 for (int i = 0; i < domain.length - 1; i++) {
+ 95 47 final String sub = domain[i];
+ 96 47 if (!IGNORE_LIST.contains(sub.toLowerCase())) {
+ 97 44 importantParts.add(sub);
98
}
99
}
- 100 22 final String document = url.getPath();
- 101 22 final String[] pathParts = document.split("[\\//]" );
- 102 38 for (int i = 0; i < pathParts.length - 2; i++) {
- 103 16 if (!pathParts[i].isEmpty()) {
+ 100 25 final String document = url.getPath();
+ 101 25 final String[] pathParts = document.split("[\\//]" );
+ 102 44 for (int i = 0; i < pathParts.length - 2; i++) {
+ 103 19 if (!pathParts[i].isEmpty()) {
104 0 importantParts.add(pathParts[i]);
105
}
106
}
- 107 22 if (pathParts.length > 0 && !pathParts[pathParts.length - 1].isEmpty()) {
- 108 19 final String fileNameNoExt = pathParts[pathParts.length - 1].replaceAll("\\..*{0,5}$" , "" );
- 109 19 importantParts.add(fileNameNoExt);
+ 107 25 if (pathParts.length > 0 && !pathParts[pathParts.length - 1].isEmpty()) {
+ 108 22 final String fileNameNoExt = pathParts[pathParts.length - 1].replaceAll("\\..*{0,5}$" , "" );
+ 109 22 importantParts.add(fileNameNoExt);
110
}
- 111 22 return importantParts;
+ 111 25 return importantParts;
112
}
113
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html
new file mode 100644
index 000000000..6d92acdde
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.License.html
@@ -0,0 +1,182 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.License
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+ package org.owasp.dependencycheck.xml.pom;
+ 17
+
+ 18
+
+ 19
+
+ 20
+
+ 21
+
+ 22
+ public class License {
+ 23
+
+ 24 0 public License() {
+ 25 0 }
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33 0 public License(String name, String url) {
+ 34 0 this .url = url;
+ 35 0 this .name = name;
+ 36
+
+ 37 0 }
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+ private String url;
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+ public String getUrl() {
+ 50 0 return url;
+ 51
+ }
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+ public void setUrl(String url) {
+ 59 0 this .url = url;
+ 60 0 }
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+ private String name;
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+ public String getName() {
+ 73 0 return name;
+ 74
+ }
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+ public void setName(String name) {
+ 82 0 this .name = name;
+ 83 0 }
+ 84
+
+ 85
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html
new file mode 100644
index 000000000..0a8afe885
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.Model.html
@@ -0,0 +1,512 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.Model
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.xml.pom;
+ 19
+
+ 20
+ import java.util.ArrayList;
+ 21
+ import java.util.List;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28 2 public class Model {
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ private String name;
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+ public String getName() {
+ 41 2 return name;
+ 42
+ }
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+ public void setName(String name) {
+ 50 2 this .name = name;
+ 51 2 }
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+ private String organization;
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+ public String getOrganization() {
+ 64 1 return organization;
+ 65
+ }
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+ public void setOrganization(String organization) {
+ 73 0 this .organization = organization;
+ 74 0 }
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+ private String description;
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public String getDescription() {
+ 87 1 return description;
+ 88
+ }
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+ public void setDescription(String description) {
+ 96 1 this .description = description;
+ 97 1 }
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+ private String groupId;
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+ public String getGroupId() {
+ 110 1 return groupId;
+ 111
+ }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+ public void setGroupId(String groupId) {
+ 119 2 this .groupId = groupId;
+ 120 2 }
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+ private String artifactId;
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+ public String getArtifactId() {
+ 133 1 return artifactId;
+ 134
+ }
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+ public void setArtifactId(String artifactId) {
+ 142 2 this .artifactId = artifactId;
+ 143 2 }
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+ private String version;
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+ public String getVersion() {
+ 156 1 return version;
+ 157
+ }
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+ public void setVersion(String version) {
+ 165 1 this .version = version;
+ 166 1 }
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+ private String parentGroupId;
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+ public String getParentGroupId() {
+ 179 2 return parentGroupId;
+ 180
+ }
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+ public void setParentGroupId(String parentGroupId) {
+ 188 1 this .parentGroupId = parentGroupId;
+ 189 1 }
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+ private String parentArtifactId;
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+ public String getParentArtifactId() {
+ 202 2 return parentArtifactId;
+ 203
+ }
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+ public void setParentArtifactId(String parentArtifactId) {
+ 211 1 this .parentArtifactId = parentArtifactId;
+ 212 1 }
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+ private String parentVersion;
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+ public String getParentVersion() {
+ 225 2 return parentVersion;
+ 226
+ }
+ 227
+
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+ public void setParentVersion(String parentVersion) {
+ 234 1 this .parentVersion = parentVersion;
+ 235 1 }
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240 2 private List<License> licenses = new ArrayList<License>();
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+ public List<License> getLicenses() {
+ 248 2 return licenses;
+ 249
+ }
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+ public void addLicense(License license) {
+ 257 0 licenses.add(license);
+ 258 0 }
+ 259
+
+ 260
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html
new file mode 100644
index 000000000..c3514f843
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomHandler.html
@@ -0,0 +1,355 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.PomHandler
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.xml.pom;
+ 19
+
+ 20
+ import java.util.ArrayDeque;
+ 21
+ import java.util.Deque;
+ 22
+ import org.xml.sax.Attributes;
+ 23
+ import org.xml.sax.SAXException;
+ 24
+ import org.xml.sax.helpers.DefaultHandler;
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31 2 public class PomHandler extends DefaultHandler {
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+ public static final String PROJECT = "project" ;
+ 37
+
+ 38
+
+ 39
+
+ 40
+ public static final String GROUPID = "groupId" ;
+ 41
+
+ 42
+
+ 43
+
+ 44
+ public static final String ARTIFACTID = "artifactId" ;
+ 45
+
+ 46
+
+ 47
+
+ 48
+ public static final String VERSION = "version" ;
+ 49
+
+ 50
+
+ 51
+
+ 52
+ public static final String PARENT = "parent" ;
+ 53
+
+ 54
+
+ 55
+
+ 56
+ public static final String NAME = "name" ;
+ 57
+
+ 58
+
+ 59
+
+ 60
+ public static final String ORGANIZATION = "organization" ;
+ 61
+
+ 62
+
+ 63
+
+ 64
+ public static final String DESCRIPTION = "description" ;
+ 65
+
+ 66
+
+ 67
+
+ 68
+ public static final String LICENSES = "licenses" ;
+ 69
+
+ 70
+
+ 71
+
+ 72
+ public static final String LICENSE = "license" ;
+ 73
+
+ 74
+
+ 75
+
+ 76
+ public static final String URL = "url" ;
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81 2 private Model model = new Model();
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+ public Model getModel() {
+ 89 2 return model;
+ 90
+ }
+ 91
+
+ 92
+
+ 93
+
+ 94 2 private final Deque<String> stack = new ArrayDeque<String>();
+ 95
+
+ 96
+
+ 97
+
+ 98 2 private License license = null ;
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+ private StringBuffer currentText;
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+ @Override
+ 115
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ 116 471 currentText = new StringBuffer();
+ 117 471 stack.push(qName);
+ 118 471 if (LICENSE.equals(qName)) {
+ 119 0 license = new License();
+ 120
+ }
+ 121 471 }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+ @Override
+ 132
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ 133 471 stack.pop();
+ 134 471 final String parentNode = stack.peek();
+ 135 471 if (PROJECT.equals(parentNode)) {
+ 136 29 if (GROUPID.equals(qName)) {
+ 137 2 model.setGroupId(currentText.toString());
+ 138 27 } else if (ARTIFACTID.equals(qName)) {
+ 139 2 model.setArtifactId(currentText.toString());
+ 140 25 } else if (VERSION.equals(qName)) {
+ 141 1 model.setVersion(currentText.toString());
+ 142 24 } else if (NAME.equals(qName)) {
+ 143 2 model.setName(currentText.toString());
+ 144 22 } else if (ORGANIZATION.equals(qName)) {
+ 145 0 model.setOrganization(currentText.toString());
+ 146 22 } else if (DESCRIPTION.equals(qName)) {
+ 147 1 model.setDescription(currentText.toString());
+ 148
+ }
+ 149 442 } else if (PARENT.equals(parentNode)) {
+ 150 3 if (GROUPID.equals(qName)) {
+ 151 1 model.setParentGroupId(currentText.toString());
+ 152 2 } else if (ARTIFACTID.equals(qName)) {
+ 153 1 model.setParentArtifactId(currentText.toString());
+ 154 1 } else if (VERSION.equals(qName)) {
+ 155 1 model.setParentVersion(currentText.toString());
+ 156
+ }
+ 157 439 } else if (LICENSE.equals(parentNode)) {
+ 158 0 if (license == null ) {
+ 159
+
+ 160 0 } else if (NAME.equals(qName)) {
+ 161 0 license.setName(currentText.toString());
+ 162 0 } else if (URL.equals(qName)) {
+ 163 0 license.setUrl(currentText.toString());
+ 164
+ }
+ 165 439 } else if (LICENSES.equals(parentNode)) {
+ 166 0 if (LICENSE.equals(qName)) {
+ 167 0 if (license != null ) {
+ 168 0 model.addLicense(license);
+ 169
+ } else {
+ 170
+
+ 171
+ }
+ 172
+ }
+ 173
+ }
+ 174 471 }
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+ @Override
+ 185
+ public void characters(char [] ch, int start, int length) throws SAXException {
+ 186 953 currentText.append(ch, start, length);
+ 187 953 }
+ 188
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html
new file mode 100644
index 000000000..7a33ab71e
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParseException.html
@@ -0,0 +1,144 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.PomParseException
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.xml.pom;
+ 19
+
+ 20
+ import org.owasp.dependencycheck.suppression.*;
+ 21
+ import java.io.IOException;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+ public class PomParseException extends IOException {
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ public PomParseException() {
+ 34 0 super ();
+ 35 0 }
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+ public PomParseException(String msg) {
+ 43 0 super (msg);
+ 44 0 }
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+ public PomParseException(Throwable ex) {
+ 52 0 super (ex);
+ 53 0 }
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+ public PomParseException(String msg, Throwable ex) {
+ 62 0 super (msg, ex);
+ 63 0 }
+ 64
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html
new file mode 100644
index 000000000..35261ab5d
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomParser.html
@@ -0,0 +1,216 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.PomParser
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.xml.pom;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.FileInputStream;
+ 22
+ import java.io.FileNotFoundException;
+ 23
+ import java.io.IOException;
+ 24
+ import java.io.InputStream;
+ 25
+ import java.io.InputStreamReader;
+ 26
+ import java.io.Reader;
+ 27
+ import java.util.List;
+ 28
+ import java.util.logging.Level;
+ 29
+ import java.util.logging.Logger;
+ 30
+ import javax.xml.parsers.ParserConfigurationException;
+ 31
+ import javax.xml.parsers.SAXParser;
+ 32
+ import javax.xml.parsers.SAXParserFactory;
+ 33
+ import org.xml.sax.InputSource;
+ 34
+ import org.xml.sax.SAXException;
+ 35
+ import org.xml.sax.XMLReader;
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42 2 public class PomParser {
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47 1 private static final Logger LOGGER = Logger.getLogger(PomParser.class .getName());
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+ public Model parse(File file) throws PomParseException {
+ 57 1 FileInputStream fis = null ;
+ 58
+ try {
+ 59 1 fis = new FileInputStream(file);
+ 60 1 return parse(fis);
+ 61 0 } catch (IOException ex) {
+ 62 0 LOGGER.log(Level.FINE, null , ex);
+ 63 0 throw new PomParseException(ex);
+ 64
+ } finally {
+ 65 1 if (fis != null ) {
+ 66
+ try {
+ 67 1 fis.close();
+ 68 0 } catch (IOException ex) {
+ 69 0 LOGGER.log(Level.FINE, "Unable to close stream" , ex);
+ 70 2 }
+ 71
+ }
+ 72
+ }
+ 73
+ }
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+ public Model parse(InputStream inputStream) throws PomParseException {
+ 83
+ try {
+ 84 2 final PomHandler handler = new PomHandler();
+ 85 2 final SAXParserFactory factory = SAXParserFactory.newInstance();
+ 86
+
+ 87
+
+ 88 2 final SAXParser saxParser = factory.newSAXParser();
+ 89 2 final XMLReader xmlReader = saxParser.getXMLReader();
+ 90 2 xmlReader.setContentHandler(handler);
+ 91
+
+ 92 2 final Reader reader = new InputStreamReader(inputStream, "UTF-8" );
+ 93 2 final InputSource in = new InputSource(reader);
+ 94
+
+ 95
+
+ 96 2 xmlReader.parse(in);
+ 97
+
+ 98 2 return handler.getModel();
+ 99 0 } catch (ParserConfigurationException ex) {
+ 100 0 LOGGER.log(Level.FINE, null , ex);
+ 101 0 throw new PomParseException(ex);
+ 102 0 } catch (SAXException ex) {
+ 103 0 LOGGER.log(Level.FINE, null , ex);
+ 104 0 throw new PomParseException(ex);
+ 105 0 } catch (FileNotFoundException ex) {
+ 106 0 LOGGER.log(Level.FINE, null , ex);
+ 107 0 throw new PomParseException(ex);
+ 108 0 } catch (IOException ex) {
+ 109 0 LOGGER.log(Level.FINE, null , ex);
+ 110 0 throw new PomParseException(ex);
+ 111
+ }
+ 112
+ }
+ 113
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html
new file mode 100644
index 000000000..7d93ee98b
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.xml.pom.PomUtils.html
@@ -0,0 +1,328 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.xml.pom.PomUtils
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.xml.pom;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.IOException;
+ 22
+ import java.util.jar.JarFile;
+ 23
+ import java.util.logging.Level;
+ 24
+ import java.util.logging.Logger;
+ 25
+ import java.util.zip.ZipEntry;
+ 26
+ import org.owasp.dependencycheck.analyzer.JarAnalyzer;
+ 27
+ import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
+ 28
+ import org.owasp.dependencycheck.dependency.Confidence;
+ 29
+ import org.owasp.dependencycheck.dependency.Dependency;
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+ public final class PomUtils {
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40 0 private PomUtils() {
+ 41 0 }
+ 42
+
+ 43
+
+ 44
+
+ 45 1 private static final Logger LOGGER = Logger.getLogger(PomUtils.class .getName());
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+ public static Model readPom(File file) throws AnalysisException {
+ 56 1 Model model = null ;
+ 57
+ try {
+ 58 1 PomParser parser = new PomParser();
+ 59 1 model = parser.parse(file);
+ 60 0 } catch (PomParseException ex) {
+ 61 0 final String msg = String.format("Unable to parse pom '%s'" , file.getPath());
+ 62 0 LOGGER.log(Level.WARNING, msg);
+ 63 0 LOGGER.log(Level.FINE, "" , ex);
+ 64 0 throw new AnalysisException(ex);
+ 65 0 } catch (IOException ex) {
+ 66 0 final String msg = String.format("Unable to parse pom '%s'(IO Exception)" , file.getPath());
+ 67 0 LOGGER.log(Level.WARNING, msg);
+ 68 0 LOGGER.log(Level.FINE, "" , ex);
+ 69 0 throw new AnalysisException(ex);
+ 70 0 } catch (Throwable ex) {
+ 71 0 final String msg = String.format("Unexpected error during parsing of the pom '%s'" , file.getPath());
+ 72 0 LOGGER.log(Level.WARNING, msg);
+ 73 0 LOGGER.log(Level.FINE, "" , ex);
+ 74 0 throw new AnalysisException(ex);
+ 75 1 }
+ 76 1 return model;
+ 77
+ }
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+ public static Model readPom(String path, JarFile jar) throws AnalysisException {
+ 89 1 final ZipEntry entry = jar.getEntry(path);
+ 90 1 Model model = null ;
+ 91 1 if (entry != null ) {
+ 92
+ try {
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97 1 final PomParser parser = new PomParser();
+ 98 1 model = parser.parse(jar.getInputStream(entry));
+ 99 1 LOGGER.fine(String.format("Read POM %s" , path));
+ 100 0 } catch (SecurityException ex) {
+ 101 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
+ 102 0 LOGGER.log(Level.WARNING, msg);
+ 103 0 LOGGER.log(Level.FINE, null , ex);
+ 104 0 throw new AnalysisException(ex);
+ 105 0 } catch (IOException ex) {
+ 106 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+ 107 0 LOGGER.log(Level.WARNING, msg);
+ 108 0 LOGGER.log(Level.FINE, "" , ex);
+ 109 0 throw new AnalysisException(ex);
+ 110 0 } catch (Throwable ex) {
+ 111 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
+ 112 0 LOGGER.log(Level.WARNING, msg);
+ 113 0 LOGGER.log(Level.FINE, "" , ex);
+ 114 0 throw new AnalysisException(ex);
+ 115 1 }
+ 116
+ }
+ 117 1 return model;
+ 118
+ }
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+ public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException {
+ 128 0 final Model pom = PomUtils.readPom(pomFile);
+ 129
+
+ 130 0 String groupid = pom.getGroupId();
+ 131 0 String parentGroupId = null ;
+ 132
+
+ 133 0 if (pom.getParentGroupId() != null ) {
+ 134 0 parentGroupId = pom.getParentGroupId();
+ 135 0 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
+ 136 0 groupid = parentGroupId;
+ 137
+ }
+ 138
+ }
+ 139 0 if (groupid != null && !groupid.isEmpty()) {
+ 140 0 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
+ 141 0 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 142 0 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
+ 143 0 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
+ 144 0 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
+ 145
+ }
+ 146
+ }
+ 147 0 String artifactid = pom.getArtifactId();
+ 148 0 String parentArtifactId = null ;
+ 149 0 if (pom.getParentArtifactId() != null ) {
+ 150 0 parentArtifactId = pom.getParentArtifactId();
+ 151 0 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
+ 152 0 artifactid = parentArtifactId;
+ 153
+ }
+ 154
+ }
+ 155 0 if (artifactid != null && !artifactid.isEmpty()) {
+ 156 0 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+ 157 0 artifactid = artifactid.substring(4);
+ 158
+ }
+ 159 0 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
+ 160 0 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+ 161 0 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
+ 162 0 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
+ 163 0 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
+ 164
+ }
+ 165
+ }
+ 166
+
+ 167 0 String version = pom.getVersion();
+ 168 0 String parentVersion = null ;
+ 169 0 if (pom.getParentVersion() != null ) {
+ 170 0 parentVersion = pom.getParentVersion();
+ 171 0 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
+ 172 0 version = parentVersion;
+ 173
+ }
+ 174
+ }
+ 175 0 if (version != null && !version.isEmpty()) {
+ 176 0 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+ 177 0 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
+ 178 0 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
+ 179
+ }
+ 180
+ }
+ 181
+
+ 182 0 final String orgName = pom.getOrganization();
+ 183 0 if (orgName != null && !orgName.isEmpty()) {
+ 184 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+ 185
+ }
+ 186 0 final String pomName = pom.getName();
+ 187 0 if (pomName != null && !pomName.isEmpty()) {
+ 188 0 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 189 0 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 190
+ }
+ 191
+
+ 192 0 if (pom.getDescription() != null ) {
+ 193 0 final String description = pom.getDescription();
+ 194 0 if (description != null && !description.isEmpty()) {
+ 195 0 JarAnalyzer.addDescription(dependency, description, "pom" , "description" );
+ 196
+ }
+ 197
+ }
+ 198 0 JarAnalyzer.extractLicense(pom, null , dependency);
+ 199 0 }
+ 200
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cpd.html b/dependency-check-core/cpd.html
index a12127418..36c67f0d8 100644
--- a/dependency-check-core/cpd.html
+++ b/dependency-check-core/cpd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - CPD Results
@@ -19,7 +19,7 @@
-
+
@@ -42,7 +42,7 @@
-
dependency-check-core
+
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2015-03-06
+
| Last Published: 2015-04-12
- Version: 1.2.9
+ Version: 1.2.10
@@ -244,7 +244,7 @@
165
org\owasp\dependencycheck\analyzer\JarAnalyzer.java
-948
+
881
@Override
diff --git a/dependency-check-core/dependency-updates-report.html b/dependency-check-core/dependency-updates-report.html
index 4fb8bf81d..24507c297 100644
--- a/dependency-check-core/dependency-updates-report.html
+++ b/dependency-check-core/dependency-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Dependency Updates Report
@@ -19,7 +19,7 @@
-
+
@@ -42,7 +42,7 @@
-
dependency-check-core
+
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2015-03-06
+
| Last Published: 2015-04-12
- Version: 1.2.9
+ Version: 1.2.10
@@ -237,7 +237,7 @@
# of dependencies using the latest version available
-9
+
10
# of dependencies where the next version available is smaller than an incremental version update
@@ -297,12 +297,12 @@
org.jmockit
jmockit
-1.15
+1.16
test
jar
-1.16-beta1
+1.17-beta1
@@ -612,7 +612,7 @@
org.owasp
dependency-check-utils
-1.2.9
+1.2.10
compile
jar
@@ -655,8 +655,20 @@
3.0.1.RELEASE
3.1.0.RELEASE
-
+
4.0.0.RELEASE
+
+uk.ltd.getahead
+dwr
+1.1.1
+provided
+
+jar
+
+
+
+
+
Status
Group Id
Artifact Id
@@ -674,25 +686,25 @@
com.google.code.findbugs:annotations
-
+
Status
No newer versions available.
-
+
Group Id
com.google.code.findbugs
-
+
Artifact Id
annotations
-
+
Current Version
3.0.0
-
+
Scope
compile
-
+
Classifier
-
+
Type
jar
@@ -748,7 +760,7 @@
jar
Newer versions
-1.4.177 Next Minor 1.4.178 1.4.179 1.4.180 1.4.181 1.4.182 1.4.183 1.4.184 1.4.1851.4.186 Latest Minor
+1.4.177 Next Minor 1.4.178 1.4.179 1.4.180 1.4.181 1.4.182 1.4.183 1.4.184 1.4.185 1.4.1861.4.187 Latest Minor