- org/owasp/dependencycheck/data/update/StandardUpdate.java
+ org/owasp/dependencycheck/data/lucene/package-info.java
0
@@ -71,1504 +71,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/nexus/NexusSearch.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/HintAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/exception/ScanAgentException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/CachedWebDataSource.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/generated-classes/cobertura/cobertura.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/DependencyVersion.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Dependency.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Dependency.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/IssueManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/LogUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/generated-classes/cobertura/task.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/Pair.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/FileTypeAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nexus/MavenArtifact.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/URLConnectionFactory.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/CpeSuppressionAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/exception/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/EvidenceCollection.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Parent.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/classes/task.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-maven/target/generated-classes/cobertura/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/RepositoryPolicy.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/NonClosingStream.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/DownloadFailedException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cwe/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/CorruptDatabaseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Exclusion.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Build.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/DBUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Relocation.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/generated-classes/cobertura/taskdefs.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Developer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/VulnerableSoftware.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Notifier.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/DependencySimilarity.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/suppression/PropertyType.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cpe/Fields.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/suppression/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-cli/target/maven-archiver/pom.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/VulnerabilityComparator.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/CiManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/exception/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Identifier.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/src/main/resources/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/classes/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/NexusAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/TokenPairConcatenatingFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Reporting.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-cli/target/generated-classes/cobertura/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/Checksum.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/src/test/resources/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/FieldAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Confidence.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 3
-
-
-
-
- org/owasp/dependencycheck/utils/InvalidSettingException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/Downloader.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Evidence.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Prerequisites.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/test-classes/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Reference.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-cli/src/main/resources/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/LogFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/PluginManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/exception/UpdateException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-maven/target/generated-classes/cobertura/cobertura.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cwe/CweHandler.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/LuceneUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/Filter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cwe/CweDB.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/CveDB.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Profile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationFile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/reporting/VelocityLoggerRedirect.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/URLConnectionFailureException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Organization.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-cli/target/generated-classes/cobertura/cobertura.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-ant/target/generated-classes/cobertura/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nuget/NuspecParseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cpe/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/suppression/SuppressionParseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/generated-classes/cobertura/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/SearchFieldAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/exception/ArchiveExtractionException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/VersionTokenizingFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/exception/NoDataException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/task/ProcessTask.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/DistributionManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/DriverShim.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/Vulnerability.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/MailingList.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/utils/ExtractionException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-maven/src/main/resources/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 2
-
-
-
-
- org/owasp/dependencycheck/data/update/xml/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nuget/NugetPackage.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/classes/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/NvdCveUpdater.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-maven/target/classes/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1586,7 +88,7 @@ under the License.
- org/owasp/dependencycheck/data/lucene/package-info.java
+ org/owasp/dependencycheck/data/update/StandardUpdate.java
0
@@ -1600,7 +102,7 @@ under the License.
- dependency-check-maven/target/generated-classes/cobertura/mojo.properties
+ org/owasp/dependencycheck/data/nexus/NexusSearch.java
0
@@ -1625,6 +127,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/analyzer/HintAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1639,6 +155,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/exception/ScanAgentException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1670,7 +200,7 @@ under the License.
- org/owasp/dependencycheck/utils/FileUtils.java
+ org/owasp/dependencycheck/data/update/CachedWebDataSource.java
0
@@ -1684,7 +214,21 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/BuildBase.java
+ org/owasp/dependencycheck/utils/DependencyVersion.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/FileUtils.java
0
@@ -1709,6 +253,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/BuildBase.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Dependency.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1723,6 +295,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/dependency/Dependency.java
+
+
+ 0
+
+
+ 0
+
+
+ 1
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/IssueManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1737,6 +337,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/LogUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1754,7 +368,7 @@ under the License.
- dependency-check-maven/target/maven-archiver/pom.properties
+ org/owasp/dependencycheck/utils/Pair.java
0
@@ -1796,7 +410,7 @@ under the License.
- org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.java
+ org/owasp/dependencycheck/analyzer/FileTypeAnalyzer.java
0
@@ -1824,7 +438,35 @@ under the License.
- dependency-check-maven/target/maven-plugin-help.properties
+ org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nexus/MavenArtifact.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/URLConnectionFactory.java
0
@@ -1852,7 +494,21 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Model.java
+ org/owasp/dependencycheck/analyzer/CpeSuppressionAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/exception/package-info.java
0
@@ -1877,6 +533,48 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Parent.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Model.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/EvidenceCollection.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1905,6 +603,90 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/NonClosingStream.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/RepositoryPolicy.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/DownloadFailedException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cwe/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Exclusion.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/CorruptDatabaseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1947,6 +729,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Build.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1975,6 +771,76 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/DBUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Relocation.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Developer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Notifier.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/VulnerableSoftware.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -1989,6 +855,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2017,6 +897,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/suppression/PropertyType.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/DependencySimilarity.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2048,7 +956,7 @@ under the License.
- dependency-check-ant/target/maven-archiver/pom.properties
+ org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzer.java
0
@@ -2073,6 +981,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/cpe/Fields.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2104,7 +1026,7 @@ under the License.
- org/owasp/dependencycheck/data/lucene/VersionAnalyzer.java
+ org/owasp/dependencycheck/suppression/package-info.java
0
@@ -2118,7 +1040,7 @@ under the License.
- org/owasp/dependencycheck/data/nuget/package-info.java
+ org/owasp/dependencycheck/data/lucene/VersionAnalyzer.java
0
@@ -2143,6 +1065,48 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/nuget/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/VulnerabilityComparator.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/CiManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2157,6 +1121,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/update/exception/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2171,6 +1149,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/dependency/Identifier.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2185,6 +1177,20 @@ under the License.
0
+
+
+
+ dependency-check-core/src/main/resources/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2213,6 +1219,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/analyzer/NexusAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2227,6 +1247,76 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/TokenPairConcatenatingFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Reporting.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/Checksum.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/src/test/resources/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2244,7 +1334,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/AbstractAnalyzer.java
+ org/owasp/dependencycheck/data/lucene/FieldAnalyzer.java
0
@@ -2258,7 +1348,35 @@ under the License.
- dependency-check-ant/target/classes/taskdefs.properties
+ org/owasp/dependencycheck/reporting/EscapeTool.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/Confidence.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/AbstractAnalyzer.java
0
@@ -2283,6 +1401,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 2
+
@@ -2311,6 +1443,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/InvalidSettingException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/Downloader.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2339,6 +1499,76 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/dependency/Evidence.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/test-classes/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Prerequisites.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-cli/src/main/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2353,6 +1583,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/dependency/Reference.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/LogFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2367,6 +1625,62 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/PluginManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/exception/UpdateException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2423,6 +1737,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/lucene/LuceneUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cwe/CweHandler.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2465,6 +1807,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/Filter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2479,6 +1835,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/cwe/CweDB.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2493,6 +1863,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2524,7 +1908,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/VulnerabilitySuppressionAnalyzer.java
+ org/owasp/dependencycheck/jaxb/pom/generated/Extension.java
0
@@ -2538,7 +1922,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Extension.java
+ org/owasp/dependencycheck/analyzer/VulnerabilitySuppressionAnalyzer.java
0
@@ -2577,6 +1961,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/CveDB.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2591,6 +1989,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Profile.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2605,6 +2017,62 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/ActivationFile.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/URLConnectionFailureException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/reporting/VelocityLoggerRedirect.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Organization.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2619,6 +2087,62 @@ under the License.
0
+
+
+
+ dependency-check-core/target/generated-classes/cobertura/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/suppression/SuppressionParseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cpe/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nuget/NuspecParseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2650,7 +2174,35 @@ under the License.
- dependency-check-cli/target/classes/log.properties
+ org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/SearchFieldAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/exception/ArchiveExtractionException.java
0
@@ -2675,6 +2227,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/lucene/VersionTokenizingFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2703,6 +2269,20 @@ under the License.
1
+
+
+
+ org/owasp/dependencycheck/exception/NoDataException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2731,6 +2311,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/update/task/ProcessTask.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2748,7 +2342,21 @@ under the License.
- dependency-check-maven/target/classes/mojo.properties
+ org/owasp/dependencycheck/jaxb/pom/generated/DistributionManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/DriverShim.java
0
@@ -2773,6 +2381,20 @@ under the License.
0
+
+
+
+ dependency-check-core/target/test-classes/test.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2790,7 +2412,35 @@ under the License.
- dependency-check-core/target/test-classes/test.properties
+ org/owasp/dependencycheck/dependency/Vulnerability.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/MailingList.java
0
@@ -2815,6 +2465,34 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/utils/ExtractionException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/src/main/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2829,6 +2507,62 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 2
+
+
+
+
+ org/owasp/dependencycheck/data/nuget/NugetPackage.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/xml/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/classes/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -2843,6 +2577,20 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/data/update/NvdCveUpdater.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
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 499551c2e..9b9d1dd6f 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
@@ -15,67 +15,67 @@ org.owasp.dependencycheck.analyzer
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cpe.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cpe.html
index 61c9854cf..c6d96b96d 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cpe.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cpe.html
@@ -15,13 +15,13 @@ org.owasp.dependencycheck.data.cpe
-CpeMemoryIndex (0%)
+CpeMemoryIndex (73%)
Fields (N/A)
-IndexEntry (0%)
+IndexEntry (58%)
IndexException (N/A)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
index 4868d347e..72235246a 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck.data.cwe
-CweDB (0%)
+CweDB (54%)
CweHandler (0%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.lucene.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.lucene.html
index f251b9c37..85d25c1f2 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.lucene.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.lucene.html
@@ -15,31 +15,31 @@ org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
index 84c146116..aef13d5cc 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nvdcve.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
index 6275c06ad..85459f21e 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.html
@@ -30,7 +30,7 @@ org.owasp.dependencycheck.data.update
UpdateService (0%)
-UpdateableNvdCve (0%)
+UpdateableNvdCve (93%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.xml.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.xml.html
index 49fd999f9..2847f58b9 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.xml.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.xml.html
@@ -15,10 +15,10 @@ org.owasp.dependencycheck.data.update.xml
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 1d6831f15..35e50e2c6 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
@@ -15,31 +15,31 @@ org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
index a99d369f0..0a4463e7e 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.reporting.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.reporting.html
index 142dc00ac..bdf39eb08 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.reporting.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.reporting.html
@@ -15,6 +15,9 @@ org.owasp.dependencycheck.reporting
+EscapeTool (0%)
+
+
ReportGenerator (0%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
index f2216eda3..23f095ba8 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.suppression.html
@@ -15,22 +15,22 @@ org.owasp.dependencycheck.suppression
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 9152bccc8..d1219b86d 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
@@ -15,31 +15,31 @@ org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/cobertura/frame-sourcefiles.html b/dependency-check-core/cobertura/frame-sourcefiles.html
index c9924262d..0c06b337a 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles.html
@@ -15,16 +15,16 @@ All Packages
-AbstractAnalyzer (0%)
+AbstractAnalyzer (100%)
-AbstractFileTypeAnalyzer (0%)
+AbstractFileTypeAnalyzer (74%)
-AbstractSuppressionAnalyzer (0%)
+AbstractSuppressionAnalyzer (48%)
-AbstractTokenizingFilter (0%)
+AbstractTokenizingFilter (100%)
Activation (N/A)
@@ -39,28 +39,28 @@ All Packages
ActivationProperty (N/A)
-AlphaNumericTokenizer (0%)
+AlphaNumericTokenizer (100%)
AnalysisException (N/A)
-AnalysisPhase (0%)
+AnalysisPhase (100%)
Analyzer (N/A)
-AnalyzerService (0%)
+AnalyzerService (100%)
-ArchiveAnalyzer (0%)
+ArchiveAnalyzer (38%)
ArchiveExtractionException (N/A)
-AssemblyAnalyzer (0%)
+AssemblyAnalyzer (67%)
Build (0%)
@@ -69,7 +69,7 @@ All Packages
BuildBase (0%)
-CPEAnalyzer (0%)
+CPEAnalyzer (81%)
CachedWebDataSource (N/A)
@@ -78,16 +78,16 @@ All Packages
CallableDownloadTask (0%)
-Checksum (0%)
+Checksum (88%)
CiManagement (0%)
-Confidence (0%)
+Confidence (100%)
-ConnectionFactory (0%)
+ConnectionFactory (45%)
Contributor (0%)
@@ -96,34 +96,34 @@ All Packages
CorruptDatabaseException (N/A)
-CpeMemoryIndex (0%)
+CpeMemoryIndex (73%)
-CpeSuppressionAnalyzer (0%)
+CpeSuppressionAnalyzer (55%)
-CweDB (0%)
+CweDB (54%)
CweHandler (0%)
-DBUtils (0%)
+DBUtils (39%)
DatabaseException (N/A)
-DatabaseProperties (0%)
+DatabaseProperties (21%)
-Dependency (0%)
+Dependency (59%)
Dependency (0%)
-DependencyBundlingAnalyzer (0%)
+DependencyBundlingAnalyzer (34%)
DependencyCheckScanAgent (0%)
@@ -135,10 +135,10 @@ All Packages
DependencySimilarity (0%)
-DependencyVersion (0%)
+DependencyVersion (87%)
-DependencyVersionUtil (0%)
+DependencyVersionUtil (95%)
DeploymentRepository (N/A)
@@ -153,25 +153,28 @@ All Packages
DownloadFailedException (N/A)
-Downloader (0%)
+Downloader (19%)
DriverLoadException (N/A)
-DriverLoader (0%)
+DriverLoader (59%)
-DriverShim (0%)
+DriverShim (9%)
-Engine (0%)
+Engine (53%)
-Evidence (0%)
+EscapeTool (0%)
-EvidenceCollection (0%)
+Evidence (74%)
+
+
+EvidenceCollection (79%)
Exclusion (N/A)
@@ -183,34 +186,34 @@ All Packages
ExtractionException (N/A)
-FalsePositiveAnalyzer (0%)
+FalsePositiveAnalyzer (57%)
-FieldAnalyzer (0%)
+FieldAnalyzer (100%)
Fields (N/A)
-FileNameAnalyzer (0%)
+FileNameAnalyzer (85%)
FileTypeAnalyzer (N/A)
-FileUtils (0%)
+FileUtils (16%)
-Filter (0%)
+Filter (91%)
-HintAnalyzer (0%)
+HintAnalyzer (76%)
-Identifier (0%)
+Identifier (31%)
-IndexEntry (0%)
+IndexEntry (58%)
IndexException (N/A)
@@ -225,10 +228,10 @@ All Packages
IssueManagement (N/A)
-JarAnalyzer (0%)
+JarAnalyzer (53%)
-JavaScriptAnalyzer (0%)
+JavaScriptAnalyzer (26%)
License (N/A)
@@ -237,16 +240,16 @@ All Packages
LogFilter (0%)
-LogUtils (0%)
+LogUtils (12%)
-LuceneUtils (0%)
+LuceneUtils (100%)
MailingList (0%)
-MavenArtifact (0%)
+MavenArtifact (50%)
MavenNamespaceFilter (0%)
@@ -255,16 +258,16 @@ All Packages
Model (0%)
-NexusAnalyzer (0%)
+NexusAnalyzer (15%)
-NexusSearch (0%)
+NexusSearch (70%)
NoDataException (N/A)
-NonClosingStream (0%)
+NonClosingStream (100%)
Notifier (0%)
@@ -273,7 +276,7 @@ All Packages
NugetPackage (0%)
-NuspecAnalyzer (0%)
+NuspecAnalyzer (20%)
NuspecParseException (N/A)
@@ -282,13 +285,13 @@ All Packages
NuspecParser (N/A)
-NvdCve12Handler (0%)
+NvdCve12Handler (94%)
-NvdCve20Handler (0%)
+NvdCve20Handler (85%)
-NvdCveAnalyzer (0%)
+NvdCveAnalyzer (67%)
NvdCveInfo (N/A)
@@ -303,7 +306,7 @@ All Packages
Organization (N/A)
-Pair (0%)
+Pair (28%)
Parent (N/A)
@@ -327,10 +330,10 @@ All Packages
Profile (0%)
-PropertyType (0%)
+PropertyType (57%)
-Reference (0%)
+Reference (28%)
Relocation (N/A)
@@ -363,13 +366,13 @@ All Packages
Scm (N/A)
-SearchFieldAnalyzer (0%)
+SearchFieldAnalyzer (100%)
SearchVersionAnalyzer (0%)
-Settings (0%)
+Settings (52%)
Site (N/A)
@@ -378,25 +381,25 @@ All Packages
StandardUpdate (0%)
-SuppressionErrorHandler (0%)
+SuppressionErrorHandler (6%)
-SuppressionHandler (0%)
+SuppressionHandler (97%)
SuppressionParseException (N/A)
-SuppressionParser (0%)
+SuppressionParser (58%)
-SuppressionRule (0%)
+SuppressionRule (95%)
-TokenPairConcatenatingFilter (0%)
+TokenPairConcatenatingFilter (100%)
-URLConnectionFactory (0%)
+URLConnectionFactory (18%)
URLConnectionFailureException (N/A)
@@ -408,13 +411,13 @@ All Packages
UpdateService (0%)
-UpdateableNvdCve (0%)
+UpdateableNvdCve (93%)
-UrlStringUtils (0%)
+UrlStringUtils (95%)
-UrlTokenizingFilter (0%)
+UrlTokenizingFilter (78%)
VelocityLoggerRedirect (0%)
@@ -426,19 +429,19 @@ All Packages
VersionTokenizingFilter (0%)
-Vulnerability (0%)
+Vulnerability (69%)
-VulnerabilityComparator (0%)
+VulnerabilityComparator (100%)
-VulnerabilitySuppressionAnalyzer (0%)
+VulnerabilitySuppressionAnalyzer (55%)
-VulnerableSoftware (0%)
+VulnerableSoftware (78%)
-XPathNuspecParser (0%)
+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 0538deccc..fae91402c 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 f4f4722ed..6f08cea33 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 c46d74fc8..f4f87c09c 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 @@
@@ -29,50 +29,50 @@ packageTable.sort(0);
@@ -81,6 +81,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 be1c34876..567cb6e13 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
@@ -16,7 +16,7 @@
-
+
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 950e92089..2396da5d1 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
@@ -16,7 +16,7 @@
-
+
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 7c08ec8a4..3a5945c79 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
@@ -16,7 +16,7 @@
-
+
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 f2902f3cc..09c79d8ff 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 8819c2b21..8741678cf 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
@@ -16,7 +16,7 @@
-
+
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 38767050f..497ffb0a9 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
@@ -16,7 +16,7 @@
-
+
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 ab7389d9b..df828dba5 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 c1210475f..6a35f9261 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
@@ -16,10 +16,10 @@
-
+
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 3ced2e7b6..1db0b780c 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
@@ -16,7 +16,7 @@
-
+
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 7c9c156f5..50215def3 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
@@ -16,7 +16,7 @@
-
+
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 be68cf191..e65c30932 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 474d0f3ca..84b355060 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 adc01cb28..99e2d740e 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
@@ -16,27 +16,27 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
index aeef3e13a..f3a2e5825 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
@@ -160,6 +160,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.jaxb.pom.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
index 9f3b2c7e8..d32aa21fa 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
@@ -38,6 +38,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.reporting.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
index 7bc35945d..84b177da0 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
@@ -16,7 +16,7 @@
-
+
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 40cc46b7e..34663378d 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
@@ -16,7 +16,7 @@
-
+
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 7fd501762..c92ee04ee 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.html b/dependency-check-core/cobertura/frame-summary.html
index 8b8e0ae28..266bd4cfd 100644
--- a/dependency-check-core/cobertura/frame-summary.html
+++ b/dependency-check-core/cobertura/frame-summary.html
@@ -16,28 +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 b4b2248f7..3d2d58267 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
@@ -12,7 +12,7 @@
@@ -154,607 +154,610 @@
68
private final Set<FileTypeAnalyzer> fileTypeAnalyzers;
69
-
+
70
-
+
71
-
+
72
-
+ private ClassLoader serviceClassLoader;
73
-
- 74
-
- 75 0 public Engine() throws DatabaseException {
- 76 0 this .dependencies = new ArrayList<Dependency>();
- 77 0 this .analyzers = new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
- 78 0 this .fileTypeAnalyzers = new HashSet<FileTypeAnalyzer>();
- 79
-
- 80 0 ConnectionFactory.initialize();
- 81
-
- 82 0 boolean autoUpdate = true ;
- 83
- try {
- 84 0 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
- 85 0 } catch (InvalidSettingException ex) {
- 86 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "Invalid setting for auto-update; using true." );
- 87 0 }
- 88 0 if (autoUpdate) {
- 89 0 doUpdates();
- 90
- }
- 91 0 loadAnalyzers();
- 92 0 }
- 93
-
- 94
- 95
-
- 96
+ 74
+
+ 75
- 97
- public void cleanup() {
- 98 0 ConnectionFactory.cleanup();
- 99 0 }
+ 76 1 private static final Logger LOGGER = Logger.getLogger(Engine.class .getName());
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+ public Engine() throws DatabaseException {
+ 84 1 this (Thread.currentThread().getContextClassLoader());
+ 85 1 }
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93 1 public Engine(ClassLoader serviceClassLoader) throws DatabaseException {
+ 94 1 this .dependencies = new ArrayList<Dependency>();
+ 95 1 this .analyzers = new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+ 96 1 this .fileTypeAnalyzers = new HashSet<FileTypeAnalyzer>();
+ 97 1 this .serviceClassLoader = serviceClassLoader;
+ 98
+
+ 99 1 ConnectionFactory.initialize();
100
- 101
-
+ 101 1 boolean autoUpdate = true ;
102
-
- 103
-
- 104
- private void loadAnalyzers() {
- 105
-
- 106 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 107 0 analyzers.put(phase, new ArrayList<Analyzer>());
- 108
- }
+ try {
+ 103 1 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+ 104 0 } catch (InvalidSettingException ex) {
+ 105 0 LOGGER.log(Level.FINE, "Invalid setting for auto-update; using true." );
+ 106 1 }
+ 107 1 if (autoUpdate) {
+ 108 0 doUpdates();
109
+ }
+ 110 1 loadAnalyzers();
+ 111 1 }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+ public void cleanup() {
+ 117 0 ConnectionFactory.cleanup();
+ 118 0 }
+ 119
- 110 0 final AnalyzerService service = AnalyzerService.getInstance();
- 111 0 final Iterator<Analyzer> iterator = service.getAnalyzers();
- 112 0 while (iterator.hasNext()) {
- 113 0 final Analyzer a = iterator.next();
- 114 0 analyzers.get(a.getAnalysisPhase()).add(a);
- 115 0 if (a instanceof FileTypeAnalyzer) {
- 116 0 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
- 117
- }
- 118 0 }
- 119 0 }
120
-
+
121
-
+
122
-
+
123
-
+ private void loadAnalyzers() {
124
-
- 125
-
- 126
-
- 127
- public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
- 128 0 return analyzers.get(phase);
- 129
- }
- 130
- 131
-
- 132
-
- 133
-
- 134
-
- 135
-
+ 125 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 126 9 analyzers.put(phase, new ArrayList<Analyzer>());
+ 127
+ }
+ 128
+
+ 129 1 final AnalyzerService service = new AnalyzerService(serviceClassLoader);
+ 130 1 final Iterator<Analyzer> iterator = service.getAnalyzers();
+ 131 14 while (iterator.hasNext()) {
+ 132 13 final Analyzer a = iterator.next();
+ 133 13 analyzers.get(a.getAnalysisPhase()).add(a);
+ 134 13 if (a instanceof FileTypeAnalyzer) {
+ 135 5 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
136
- public List<Dependency> getDependencies() {
- 137
- return dependencies;
- 138
- }
+ }
+ 137 13 }
+ 138 1 }
139
140
- public void setDependencies(List<Dependency> dependencies) {
- 141
- this .dependencies = dependencies;
- 142
-
- 143
-
- 144
-
- 145
- }
- 146
-
- 147
- 148
-
- 149
-
- 150
+ 141
+
+ 142
+ 143
+
+ 144
+
+ 145
+
+ 146
+ public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
+ 147 0 return analyzers.get(phase);
+ 148
+ }
+ 149
+
+ 150
+
151
-
+
152
153
-
+
154
155
- public void scan(String[] paths) {
- 156 0 for (String path : paths) {
- 157 0 final File file = new File(path);
- 158 0 scan(file);
+ public List<Dependency> getDependencies() {
+ 156
+ return dependencies;
+ 157
+ }
+ 158
+
159
- }
- 160 0 }
+ public void setDependencies(List<Dependency> dependencies) {
+ 160
+ this .dependencies = dependencies;
161
-
+
162
-
+
163
-
+
164
-
+ }
165
-
+
166
-
+
167
-
- 168
- public void scan(String path) {
- 169 0 if (path.matches("^.*[\\/]\\*\\.[^\\/:*|?<>\"]+$" )) {
- 170 0 final String[] parts = path.split("\\*\\." );
- 171 0 final String[] ext = new String[]{parts[parts.length - 1]};
- 172 0 final File dir = new File(path.substring(0, path.length() - ext[0].length() - 2));
- 173 0 if (dir.isDirectory()) {
- 174 0 final List<File> files = (List<File>) org.apache.commons.io.FileUtils.listFiles(dir, ext, true );
- 175 0 scan(files);
- 176 0 } else {
- 177 0 final String msg = String.format("Invalid file path provided to scan '%s'" , path);
- 178 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
- 179
- }
- 180 0 } else {
- 181 0 final File file = new File(path);
- 182 0 scan(file);
- 183
- }
- 184 0 }
- 185
-
- 186
-
- 187
- 188
+ 168
- 189
+ 169
- 190
+ 170
- 191
+ 171
- 192
-
- 193
+ 172
+
+ 173
- 194
- public void scan(File[] files) {
- 195 0 for (File file : files) {
- 196 0 scan(file);
- 197
+ 174
+ public void scan(String[] paths) {
+ 175 0 for (String path : paths) {
+ 176 0 final File file = new File(path);
+ 177 0 scan(file);
+ 178
}
- 198 0 }
- 199
+ 179 0 }
+ 180
- 200
+ 181
- 201
-
- 202
-
- 203
-
- 204
-
- 205
-
- 206
-
- 207
-
- 208
- public void scan(Set<File> files) {
- 209 0 for (File file : files) {
- 210 0 scan(file);
- 211 0 }
- 212 0 }
- 213
-
- 214
-
- 215
-
- 216
-
- 217
-
- 218
-
- 219
-
- 220
-
- 221
-
- 222
- public void scan(List<File> files) {
- 223 0 for (File file : files) {
- 224 0 scan(file);
- 225 0 }
- 226 0 }
- 227
-
- 228
-
- 229
+ 182
- 230
+ 183
- 231
+ 184
+ 185
+
+ 186
+
+ 187
+ public void scan(String path) {
+ 188 0 if (path.matches("^.*[\\/]\\*\\.[^\\/:*|?<>\"]+$" )) {
+ 189 0 final String[] parts = path.split("\\*\\." );
+ 190 0 final String[] ext = new String[]{parts[parts.length - 1]};
+ 191 0 final File dir = new File(path.substring(0, path.length() - ext[0].length() - 2));
+ 192 0 if (dir.isDirectory()) {
+ 193 0 final List<File> files = (List<File>) org.apache.commons.io.FileUtils.listFiles(dir, ext, true );
+ 194 0 scan(files);
+ 195 0 } else {
+ 196 0 final String msg = String.format("Invalid file path provided to scan '%s'" , path);
+ 197 0 LOGGER.log(Level.SEVERE, msg);
+ 198
+ }
+ 199 0 } else {
+ 200 0 final File file = new File(path);
+ 201 0 scan(file);
+ 202
+ }
+ 203 0 }
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+ public void scan(File[] files) {
+ 214 0 for (File file : files) {
+ 215 0 scan(file);
+ 216
+ }
+ 217 0 }
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+ public void scan(Set<File> files) {
+ 228 0 for (File file : files) {
+ 229 0 scan(file);
+ 230 0 }
+ 231 0 }
232
-
+
233
-
+
234
-
+
235
-
+
236
- public void scan(File file) {
- 237 0 if (file.exists()) {
- 238 0 if (file.isDirectory()) {
- 239 0 scanDirectory(file);
+
+ 237
+
+ 238
+
+ 239
+
240
- } else {
- 241 0 scanFile(file);
- 242
- }
- 243
- }
- 244 0 }
- 245
-
+
+ 241
+ public void scan(List<File> files) {
+ 242 0 for (File file : files) {
+ 243 0 scan(file);
+ 244 0 }
+ 245 0 }
246
-
+
247
-
+
248
-
+
249
-
+
250
-
+
251
- protected void scanDirectory(File dir) {
- 252 0 final File[] files = dir.listFiles();
- 253 0 if (files != null ) {
- 254 0 for (File f : files) {
- 255 0 if (f.isDirectory()) {
- 256 0 scanDirectory(f);
- 257
- } else {
- 258 0 scanFile(f);
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+ public void scan(File file) {
+ 256 4 if (file.exists()) {
+ 257 4 if (file.isDirectory()) {
+ 258 2 scanDirectory(file);
259
- }
- 260
- }
+ } else {
+ 260 2 scanFile(file);
261
+ }
+ 262
}
- 262 0 }
- 263
-
+ 263 4 }
264
-
+
265
-
+
266
-
+
267
-
+
268
-
+
269
- protected void scanFile(File file) {
- 270 0 if (!file.isFile()) {
- 271 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
- 272 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 273 0 return ;
- 274
+
+ 270
+ protected void scanDirectory(File dir) {
+ 271 38 final File[] files = dir.listFiles();
+ 272 38 if (files != null ) {
+ 273 74 for (File f : files) {
+ 274 36 if (f.isDirectory()) {
+ 275 36 scanDirectory(f);
+ 276
+ } else {
+ 277 0 scanFile(f);
+ 278
+ }
+ 279
+ }
+ 280
}
- 275 0 final String fileName = file.getName();
- 276 0 final String extension = FileUtils.getFileExtension(fileName);
- 277 0 if (extension != null ) {
- 278 0 if (supportsExtension(extension)) {
- 279 0 final Dependency dependency = new Dependency(file);
- 280 0 dependencies.add(dependency);
- 281 0 }
+ 281 38 }
282
- } else {
- 283 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
+
+ 283
+
284
- file.toString());
- 285 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, msg);
+
+ 285
+
286
- }
- 287 0 }
+
+ 287
+
288
-
- 289
-
- 290
-
- 291
-
- 292
- public void analyzeDependencies() {
+ protected void scanFile(File file) {
+ 289 2 if (!file.isFile()) {
+ 290 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+ 291 0 LOGGER.log(Level.FINE, msg);
+ 292 0 return ;
293
-
- 294
- try {
- 295 0 ensureDataExists();
- 296 0 } catch (NoDataException ex) {
- 297 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 298 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
- 299 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, null , ex);
- 300 0 return ;
- 301 0 } catch (DatabaseException ex) {
- 302 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 303 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
- 304 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, null , ex);
- 305 0 return ;
- 306
+ }
+ 294 2 final String fileName = file.getName();
+ 295 2 final String extension = FileUtils.getFileExtension(fileName);
+ 296 2 if (extension != null ) {
+ 297 2 if (supportsExtension(extension)) {
+ 298 2 final Dependency dependency = new Dependency(file);
+ 299 2 dependencies.add(dependency);
+ 300 2 }
+ 301
+ } else {
+ 302 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
+ 303
+ file.toString());
+ 304 0 LOGGER.log(Level.FINEST, msg);
+ 305
+ }
+ 306 2 }
+ 307
- 307 0 }
308
-
- 309 0 final String logHeader = String.format("%n"
+
+ 309
+
310
- + "----------------------------------------------------%n"
+
311
- + "BEGIN ANALYSIS%n"
+ public void analyzeDependencies() {
312
- + "----------------------------------------------------" );
- 313 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, logHeader);
- 314 0 Logger.getLogger(Engine.class .getName()).log(Level.INFO, "Analysis Starting" );
- 315
-
- 316
-
- 317 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 318 0 final List<Analyzer> analyzerList = analyzers.get(phase);
- 319
-
- 320 0 for (Analyzer a : analyzerList) {
- 321 0 initializeAnalyzer(a);
- 322
-
- 323
-
- 324
-
+
+ 313
+ try {
+ 314 1 ensureDataExists();
+ 315 0 } catch (NoDataException ex) {
+ 316 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 317 0 LOGGER.log(Level.SEVERE, msg);
+ 318 0 LOGGER.log(Level.FINE, null , ex);
+ 319 0 return ;
+ 320 0 } catch (DatabaseException ex) {
+ 321 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 322 0 LOGGER.log(Level.SEVERE, msg);
+ 323 0 LOGGER.log(Level.FINE, null , ex);
+ 324 0 return ;
325
-
- 326
-
- 327 0 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
- 328 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 329 0 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 330 0 dependencySet.addAll(dependencies);
- 331 0 for (Dependency d : dependencySet) {
- 332 0 boolean shouldAnalyze = true ;
- 333 0 if (a instanceof FileTypeAnalyzer) {
- 334 0 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
- 335 0 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
- 336
- }
- 337 0 if (shouldAnalyze) {
- 338 0 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
- 339 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msgFile);
- 340
- try {
- 341 0 a.analyze(d, this );
- 342 0 } catch (AnalysisException ex) {
- 343 0 final String exMsg = String.format("An error occured while analyzing '%s'." , d.getActualFilePath());
- 344 0 Logger.getLogger(Engine.class .getName()).log(Level.WARNING, exMsg);
- 345 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "" , ex);
- 346 0 } catch (Throwable ex) {
- 347 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
- 348
-
- 349 0 Logger.getLogger(Engine.class .getName()).log(Level.WARNING, axMsg);
- 350 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "" , ex);
- 351 0 }
- 352
- }
- 353 0 }
- 354 0 }
- 355
- }
- 356 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 357 0 final List<Analyzer> analyzerList = analyzers.get(phase);
- 358
- 359 0 for (Analyzer a : analyzerList) {
- 360 0 closeAnalyzer(a);
- 361 0 }
- 362
- }
- 363
+ 326 1 }
+ 327
- 364 0 final String logFooter = String.format("%n"
- 365
+ 328 1 final String logHeader = String.format("%n"
+ 329
+ "----------------------------------------------------%n"
- 366
- + "END ANALYSIS%n"
- 367
+ 330
+ + "BEGIN ANALYSIS%n"
+ 331
+ "----------------------------------------------------" );
- 368 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, logFooter);
- 369 0 Logger.getLogger(Engine.class .getName()).log(Level.INFO, "Analysis Complete" );
- 370 0 }
+ 332 1 LOGGER.log(Level.FINE, logHeader);
+ 333 1 LOGGER.log(Level.INFO, "Analysis Starting" );
+ 334
+
+ 335
+
+ 336 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 337 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 338
+
+ 339 9 for (Analyzer a : analyzerList) {
+ 340 13 initializeAnalyzer(a);
+ 341
+
+ 342
+
+ 343
+
+ 344
+
+ 345
+
+ 346 13 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+ 347 13 LOGGER.log(Level.FINE, msg);
+ 348 13 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 349 13 dependencySet.addAll(dependencies);
+ 350 13 for (Dependency d : dependencySet) {
+ 351 26 boolean shouldAnalyze = true ;
+ 352 26 if (a instanceof FileTypeAnalyzer) {
+ 353 10 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
+ 354 10 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
+ 355
+ }
+ 356 26 if (shouldAnalyze) {
+ 357 20 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+ 358 20 LOGGER.log(Level.FINE, msgFile);
+ 359
+ try {
+ 360 20 a.analyze(d, this );
+ 361 0 } catch (AnalysisException ex) {
+ 362 0 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
+ 363 0 LOGGER.log(Level.WARNING, exMsg);
+ 364 0 LOGGER.log(Level.FINE, "" , ex);
+ 365 0 } catch (Throwable ex) {
+ 366 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
+ 367
+
+ 368 0 LOGGER.log(Level.WARNING, axMsg);
+ 369 0 LOGGER.log(Level.FINE, "" , ex);
+ 370 20 }
371
-
- 372
-
- 373
-
+ }
+ 372 26 }
+ 373 13 }
374
-
- 375
-
- 376
-
+ }
+ 375 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 376 9 final List<Analyzer> analyzerList = analyzers.get(phase);
377
- private void initializeAnalyzer(Analyzer analyzer) {
- 378
- try {
- 379 0 final String msg = String.format("Initializing %s" , analyzer.getName());
- 380 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 381 0 analyzer.initialize();
- 382 0 } catch (Throwable ex) {
- 383 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
- 384 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
- 385 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, null , ex);
+
+ 378 9 for (Analyzer a : analyzerList) {
+ 379 13 closeAnalyzer(a);
+ 380 13 }
+ 381
+ }
+ 382
+
+ 383 1 final String logFooter = String.format("%n"
+ 384
+ + "----------------------------------------------------%n"
+ 385
+ + "END ANALYSIS%n"
386
- try {
- 387 0 analyzer.close();
- 388 0 } catch (Throwable ex1) {
- 389 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex1);
- 390 0 }
- 391 0 }
- 392 0 }
+ + "----------------------------------------------------" );
+ 387 1 LOGGER.log(Level.FINE, logFooter);
+ 388 1 LOGGER.log(Level.INFO, "Analysis Complete" );
+ 389 1 }
+ 390
+
+ 391
+
+ 392
+
393
-
- 394
-
- 395
-
- 396
+ 394
+
+ 395
+
+ 396
+ private void initializeAnalyzer(Analyzer analyzer) {
397
-
- 398
-
- 399
- private void closeAnalyzer(Analyzer analyzer) {
- 400 0 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
- 401 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 402
try {
- 403 0 analyzer.close();
- 404 0 } catch (Throwable ex) {
- 405 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex);
- 406 0 }
- 407 0 }
- 408
-
- 409
-
- 410
-
- 411
-
- 412
- private void doUpdates() {
- 413 0 final UpdateService service = UpdateService.getInstance();
- 414 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
- 415 0 while (iterator.hasNext()) {
- 416 0 final CachedWebDataSource source = iterator.next();
- 417
+ 398 13 final String msg = String.format("Initializing %s" , analyzer.getName());
+ 399 13 LOGGER.log(Level.FINE, msg);
+ 400 13 analyzer.initialize();
+ 401 0 } catch (Throwable ex) {
+ 402 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
+ 403 0 LOGGER.log(Level.SEVERE, msg);
+ 404 0 LOGGER.log(Level.FINE, null , ex);
+ 405
try {
- 418 0 source.update();
- 419 0 } catch (UpdateException ex) {
- 420 0 Logger.getLogger(Engine.class .getName()).log(Level.WARNING,
+ 406 0 analyzer.close();
+ 407 0 } catch (Throwable ex1) {
+ 408 0 LOGGER.log(Level.FINEST, null , ex1);
+ 409 0 }
+ 410 13 }
+ 411 13 }
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+ private void closeAnalyzer(Analyzer analyzer) {
+ 419 13 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
+ 420 13 LOGGER.log(Level.FINE, msg);
421
- "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
- 422 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE,
- 423
- String.format("Unable to update details for %s" , source.getClass().getName()), ex);
- 424 0 }
- 425 0 }
- 426 0 }
+ try {
+ 422 13 analyzer.close();
+ 423 0 } catch (Throwable ex) {
+ 424 0 LOGGER.log(Level.FINEST, null , ex);
+ 425 13 }
+ 426 13 }
427
428
429
-
+
430
-
+
431
-
- 432
-
- 433
- public List<Analyzer> getAnalyzers() {
- 434 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
- 435 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 436 0 final List<Analyzer> analyzerList = analyzers.get(phase);
- 437 0 ret.addAll(analyzerList);
- 438
- }
- 439 0 return ret;
+ private void doUpdates() {
+ 432 0 final UpdateService service = new UpdateService(serviceClassLoader);
+ 433 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+ 434 0 while (iterator.hasNext()) {
+ 435 0 final CachedWebDataSource source = iterator.next();
+ 436
+ try {
+ 437 0 source.update();
+ 438 0 } catch (UpdateException ex) {
+ 439 0 LOGGER.log(Level.WARNING,
440
- }
- 441
-
+ "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
+ 441 0 LOGGER.log(Level.FINE,
442
-
- 443
-
- 444
-
- 445
-
+ String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+ 443 0 }
+ 444 0 }
+ 445 0 }
446
-
+
447
-
+
448
- public boolean supportsExtension(String ext) {
- 449 0 if (ext == null ) {
- 450 0 return false ;
+
+ 449
+
+ 450
+
451
+
+ 452
+ public List<Analyzer> getAnalyzers() {
+ 453 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
+ 454 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 455 0 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 456 0 ret.addAll(analyzerList);
+ 457
}
- 452 0 boolean scan = false ;
- 453 0 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
- 454
-
- 455
-
- 456 0 scan |= a.supportsExtension(ext);
- 457 0 }
- 458 0 return scan;
+ 458 0 return ret;
459
}
460
@@ -762,45 +765,74 @@
461
462
-
+
463
464
-
+
465
-
+
466
467
- private void ensureDataExists() throws NoDataException, DatabaseException {
- 468 0 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
- 469 0 final CveDB cve = new CveDB();
+ public boolean supportsExtension(String ext) {
+ 468 851 if (ext == null ) {
+ 469 3 return false ;
470
-
- 471
- try {
- 472 0 cve.open();
- 473 0 cpe.open(cve);
- 474 0 } catch (IndexException ex) {
- 475 0 throw new NoDataException(ex.getMessage(), ex);
- 476 0 } catch (DatabaseException ex) {
- 477 0 throw new NoDataException(ex.getMessage(), ex);
- 478
- } finally {
- 479 0 cve.close();
- 480 0 }
- 481 0 if (cpe.numDocs() <= 0) {
- 482 0 cpe.close();
- 483 0 throw new NoDataException("No documents exist" );
- 484
}
- 485 0 }
- 486
+ 471 848 boolean scan = false ;
+ 472 848 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
+ 473
+
+ 474
+
+ 475 4240 scan |= a.supportsExtension(ext);
+ 476 4240 }
+ 477 848 return scan;
+ 478
+ }
+ 479
- 487
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+
+ 485
+
+ 486
+ private void ensureDataExists() throws NoDataException, DatabaseException {
+ 487 1 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
+ 488 1 final CveDB cve = new CveDB();
+ 489
+
+ 490
+ try {
+ 491 1 cve.open();
+ 492 1 cpe.open(cve);
+ 493 0 } catch (IndexException ex) {
+ 494 0 throw new NoDataException(ex.getMessage(), ex);
+ 495 0 } catch (DatabaseException ex) {
+ 496 0 throw new NoDataException(ex.getMessage(), ex);
+ 497
+ } finally {
+ 498 1 cve.close();
+ 499 1 }
+ 500 1 if (cpe.numDocs() <= 0) {
+ 501 0 cpe.close();
+ 502 0 throw new NoDataException("No documents exist" );
+ 503
+ }
+ 504 1 }
+ 505
}
-
+
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 0bc723a8c..34d33919a 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 @@
@@ -148,1684 +148,1679 @@
66 0 private static final String NEW_LINE = System.getProperty("line.separator" , "\n" ).intern();
67
-
+
68
-
+
69
-
- 70
- 71 0 private String applicationName = "Dependency-Check" ;
+ 70 0 private static final Logger LOGGER = Logger.getLogger(DependencyCheckScanAgent.class .getName());
+ 71
+
72
-
+
73
-
- 74
-
+
+ 74 0 private String applicationName = "Dependency-Check" ;
75
-
+
76
-
+
77
-
+
78
- public String getApplicationName() {
+
79
- return applicationName;
+
80
- }
+
81
-
+ public String getApplicationName() {
82
-
+ return applicationName;
83
-
+ }
84
-
+
85
-
+
86
-
+
87
- public void setApplicationName(String applicationName) {
+
88
- this .applicationName = applicationName;
+
89
- }
+
90
-
+ public void setApplicationName(String applicationName) {
91
-
+ this .applicationName = applicationName;
92
-
+ }
93
-
+
94
- private List<Dependency> dependencies;
+
95
-
+
96
-
+
97
-
+ private List<Dependency> dependencies;
98
-
+
99
-
+
100
-
+
101
- public List<Dependency> getDependencies() {
+
102
- return dependencies;
+
103
- }
+
104
-
+ public List<Dependency> getDependencies() {
105
-
+ return dependencies;
106
-
+ }
107
-
+
108
-
+
109
-
+
110
- public void setDependencies(List<Dependency> dependencies) {
+
111
- this .dependencies = dependencies;
+
112
- }
+
113
-
+ public void setDependencies(List<Dependency> dependencies) {
114
-
+ this .dependencies = dependencies;
115
-
+ }
116
-
- 117 0 private String dataDirectory = null ;
+
+ 117
+
118
-
+
119
-
- 120
-
+
+ 120 0 private String dataDirectory = null ;
121
-
+
122
-
+
123
-
+
124
- public String getDataDirectory() {
+
125
- return dataDirectory;
+
126
- }
+
127
-
+ public String getDataDirectory() {
128
-
+ return dataDirectory;
129
-
+ }
130
-
+
131
-
+
132
-
+
133
- public void setDataDirectory(String dataDirectory) {
+
134
- this .dataDirectory = dataDirectory;
+
135
- }
+
136
-
+ public void setDataDirectory(String dataDirectory) {
137
-
+ this .dataDirectory = dataDirectory;
138
-
+ }
139
-
+
140
- private String reportOutputDirectory;
+
141
-
+
142
-
+
143
-
+ private String reportOutputDirectory;
144
-
+
145
-
+
146
-
+
147
- public String getReportOutputDirectory() {
+
148
- return reportOutputDirectory;
+
149
- }
+
150
-
+ public String getReportOutputDirectory() {
151
-
+ return reportOutputDirectory;
152
-
+ }
153
-
+
154
-
+
155
-
+
156
- public void setReportOutputDirectory(String reportOutputDirectory) {
+
157
- this .reportOutputDirectory = reportOutputDirectory;
+
158
- }
+
159
-
+ public void setReportOutputDirectory(String reportOutputDirectory) {
160
-
+ this .reportOutputDirectory = reportOutputDirectory;
161
-
+ }
162
-
+
163
-
+
164
-
- 165 0 private float failBuildOnCVSS = 11;
+
+ 165
+
166
-
+
167
-
- 168
-
+
+ 168 0 private float failBuildOnCVSS = 11;
169
-
+
170
-
+
171
-
+
172
- public float getFailBuildOnCVSS() {
+
173
- return failBuildOnCVSS;
+
174
- }
+
175
-
+ public float getFailBuildOnCVSS() {
176
-
+ return failBuildOnCVSS;
177
-
+ }
178
-
+
179
-
+
180
-
+
181
- public void setFailBuildOnCVSS(float failBuildOnCVSS) {
+
182
- this .failBuildOnCVSS = failBuildOnCVSS;
+
183
- }
+
184
-
+ public void setFailBuildOnCVSS(float failBuildOnCVSS) {
185
-
+ this .failBuildOnCVSS = failBuildOnCVSS;
186
-
+ }
187
-
+
188
-
- 189 0 private boolean autoUpdate = true ;
+
+ 189
+
190
-
+
191
-
- 192
-
+
+ 192 0 private boolean autoUpdate = true ;
193
-
+
194
-
+
195
-
+
196
- public boolean isAutoUpdate() {
+
197
- return autoUpdate;
+
198
- }
+
199
-
+ public boolean isAutoUpdate() {
200
-
+ return autoUpdate;
201
-
+ }
202
-
+
203
-
+
204
-
+
205
- public void setAutoUpdate(boolean autoUpdate) {
+
206
- this .autoUpdate = autoUpdate;
+
207
- }
+
208
-
+ public void setAutoUpdate(boolean autoUpdate) {
209
-
+ this .autoUpdate = autoUpdate;
210
-
+ }
211
-
+
212
-
- 213 0 private ReportGenerator.Format reportFormat = ReportGenerator.Format.HTML;
+
+ 213
+
214
-
+
215
-
- 216
-
+
+ 216 0 private ReportGenerator.Format reportFormat = ReportGenerator.Format.HTML;
217
-
+
218
-
+
219
-
+
220
- public ReportGenerator.Format getReportFormat() {
+
221
- return reportFormat;
+
222
- }
+
223
-
+ public ReportGenerator.Format getReportFormat() {
224
-
+ return reportFormat;
225
-
+ }
226
-
+
227
-
+
228
-
+
229
- public void setReportFormat(ReportGenerator.Format reportFormat) {
+
230
- this .reportFormat = reportFormat;
+
231
- }
+
232
-
+ public void setReportFormat(ReportGenerator.Format reportFormat) {
233
-
+ this .reportFormat = reportFormat;
234
-
+ }
235
-
+
236
- private String proxyUrl;
+
237
-
+
238
-
+
239
-
+ private String proxyUrl;
240
-
+
241
-
+
242
-
+
243
- public String getProxyUrl() {
+
244
- return proxyUrl;
+
245
- }
+
246
-
+ public String getProxyUrl() {
247
-
+ return proxyUrl;
248
-
+ }
249
-
+
250
-
+
251
-
+
252
- public void setProxyUrl(String proxyUrl) {
+
253
- this .proxyUrl = proxyUrl;
+
254
- }
+
255
-
+ public void setProxyUrl(String proxyUrl) {
256
-
+ this .proxyUrl = proxyUrl;
257
-
+ }
258
-
+
259
- private String proxyPort;
+
260
-
+
261
-
+
262
-
+ private String proxyPort;
263
-
+
264
-
+
265
-
+
266
- public String getProxyPort() {
+
267
- return proxyPort;
+
268
- }
+
269
-
+ public String getProxyPort() {
270
-
+ return proxyPort;
271
-
+ }
272
-
+
273
-
+
274
-
+
275
- public void setProxyPort(String proxyPort) {
+
276
- this .proxyPort = proxyPort;
+
277
- }
+
278
-
+ public void setProxyPort(String proxyPort) {
279
-
+ this .proxyPort = proxyPort;
280
-
+ }
281
-
+
282
- private String proxyUsername;
+
283
-
+
284
-
+
285
-
+ private String proxyUsername;
286
-
+
287
-
+
288
-
+
289
- public String getProxyUsername() {
+
290
- return proxyUsername;
+
291
- }
+
292
-
+ public String getProxyUsername() {
293
-
+ return proxyUsername;
294
-
+ }
295
-
+
296
-
+
297
-
+
298
- public void setProxyUsername(String proxyUsername) {
+
299
- this .proxyUsername = proxyUsername;
+
300
- }
+
301
-
+ public void setProxyUsername(String proxyUsername) {
302
-
+ this .proxyUsername = proxyUsername;
303
-
+ }
304
-
+
305
- private String proxyPassword;
+
306
-
+
307
-
+
308
-
+ private String proxyPassword;
309
-
+
310
-
+
311
-
+
312
- public String getProxyPassword() {
+
313
- return proxyPassword;
+
314
- }
+
315
-
+ public String getProxyPassword() {
316
-
+ return proxyPassword;
317
-
+ }
318
-
+
319
-
+
320
-
+
321
- public void setProxyPassword(String proxyPassword) {
+
322
- this .proxyPassword = proxyPassword;
+
323
- }
+
324
-
+ public void setProxyPassword(String proxyPassword) {
325
-
+ this .proxyPassword = proxyPassword;
326
-
+ }
327
-
+
328
- private String connectionTimeout;
+
329
-
+
330
-
+
331
-
+ private String connectionTimeout;
332
-
+
333
-
+
334
-
+
335
- public String getConnectionTimeout() {
+
336
- return connectionTimeout;
+
337
- }
+
338
-
+ public String getConnectionTimeout() {
339
-
+ return connectionTimeout;
340
-
+ }
341
-
+
342
-
+
343
-
+
344
- public void setConnectionTimeout(String connectionTimeout) {
+
345
- this .connectionTimeout = connectionTimeout;
+
346
- }
+
347
-
+ public void setConnectionTimeout(String connectionTimeout) {
348
-
+ this .connectionTimeout = connectionTimeout;
349
-
+ }
350
-
- 351 0 private String logFile = null ;
+
+ 351
+
352
-
+
353
-
- 354
-
+
+ 354 0 private String logFile = null ;
355
-
+
356
-
+
357
-
+
358
- public String getLogFile() {
+
359
- return logFile;
+
360
- }
+
361
-
+ public String getLogFile() {
362
-
+ return logFile;
363
-
+ }
364
-
+
365
-
+
366
-
+
367
- public void setLogFile(String logFile) {
+
368
- this .logFile = logFile;
+
369
- }
+
370
-
+ public void setLogFile(String logFile) {
371
-
+ this .logFile = logFile;
372
-
+ }
373
-
+
374
- private String suppressionFile;
+
375
-
+
376
-
+
377
-
+ private String suppressionFile;
378
-
+
379
-
+
380
-
+
381
- public String getSuppressionFile() {
+
382
- return suppressionFile;
+
383
- }
+
384
-
+ public String getSuppressionFile() {
385
-
+ return suppressionFile;
386
-
+ }
387
-
+
388
-
+
389
-
+
390
- public void setSuppressionFile(String suppressionFile) {
+
391
- this .suppressionFile = suppressionFile;
+
392
- }
+
393
-
+ public void setSuppressionFile(String suppressionFile) {
394
-
+ this .suppressionFile = suppressionFile;
395
-
+ }
396
-
- 397 0 private boolean showSummary = true ;
+
+ 397
+
398
-
+
399
-
- 400
-
+
+ 400 0 private boolean showSummary = true ;
401
-
+
402
-
+
403
-
+
404
- public boolean isShowSummary() {
+
405
- return showSummary;
+
406
- }
+
407
-
+ public boolean isShowSummary() {
408
-
+ return showSummary;
409
-
+ }
410
-
+
411
-
+
412
-
+
413
- public void setShowSummary(boolean showSummary) {
+
414
- this .showSummary = showSummary;
+
415
- }
+
416
-
+ public void setShowSummary(boolean showSummary) {
417
-
+ this .showSummary = showSummary;
418
-
+ }
419
-
- 420 0 private boolean nexusAnalyzerEnabled = true ;
+
+ 420
+
421
-
+
422
-
- 423
-
+
+ 423 0 private boolean nexusAnalyzerEnabled = true ;
424
-
+
425
-
+
426
-
+
427
- public boolean isNexusAnalyzerEnabled() {
+
428
- return nexusAnalyzerEnabled;
+
429
- }
+
430
-
+ public boolean isNexusAnalyzerEnabled() {
431
-
+ return nexusAnalyzerEnabled;
432
-
+ }
433
-
+
434
-
+
435
-
+
436
- public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled) {
+
437
- this .nexusAnalyzerEnabled = nexusAnalyzerEnabled;
+
438
- }
+
439
-
+ public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled) {
440
-
+ this .nexusAnalyzerEnabled = nexusAnalyzerEnabled;
441
-
+ }
442
-
+
443
- private String nexusUrl;
+
444
-
+
445
-
+
446
-
+ private String nexusUrl;
447
-
+
448
-
+
449
-
+
450
- public String getNexusUrl() {
+
451
- return nexusUrl;
+
452
- }
+
453
-
+ public String getNexusUrl() {
454
-
+ return nexusUrl;
455
-
+ }
456
-
+
457
-
+
458
-
+
459
- public void setNexusUrl(String nexusUrl) {
+
460
- this .nexusUrl = nexusUrl;
+
461
- }
+
462
-
+ public void setNexusUrl(String nexusUrl) {
463
-
+ this .nexusUrl = nexusUrl;
464
-
+ }
465
-
- 466 0 private boolean nexusUsesProxy = true ;
+
+ 466
+
467
-
+
468
-
- 469
-
+
+ 469 0 private boolean nexusUsesProxy = true ;
470
-
+
471
-
+
472
-
+
473
- public boolean isNexusUsesProxy() {
+
474
- return nexusUsesProxy;
+
475
- }
+
476
-
+ public boolean isNexusUsesProxy() {
477
-
+ return nexusUsesProxy;
478
-
+ }
479
-
+
480
-
+
481
-
+
482
- public void setNexusUsesProxy(boolean nexusUsesProxy) {
+
483
- this .nexusUsesProxy = nexusUsesProxy;
+
484
- }
+
485
-
+ public void setNexusUsesProxy(boolean nexusUsesProxy) {
486
-
+ this .nexusUsesProxy = nexusUsesProxy;
487
-
+ }
488
-
+
489
- private String databaseDriverName;
+
490
-
+
491
-
+
492
-
+ private String databaseDriverName;
493
-
+
494
-
+
495
-
+
496
- public String getDatabaseDriverName() {
+
497
- return databaseDriverName;
+
498
- }
+
499
-
+ public String getDatabaseDriverName() {
500
-
+ return databaseDriverName;
501
-
+ }
502
-
+
503
-
+
504
-
+
505
- public void setDatabaseDriverName(String databaseDriverName) {
+
506
- this .databaseDriverName = databaseDriverName;
+
507
- }
+
508
-
+ public void setDatabaseDriverName(String databaseDriverName) {
509
-
+ this .databaseDriverName = databaseDriverName;
510
-
+ }
511
-
+
512
- private String databaseDriverPath;
+
513
-
+
514
-
+
515
-
+ private String databaseDriverPath;
516
-
+
517
-
+
518
-
+
519
- public String getDatabaseDriverPath() {
+
520
- return databaseDriverPath;
+
521
- }
+
522
-
+ public String getDatabaseDriverPath() {
523
-
+ return databaseDriverPath;
524
-
+ }
525
-
+
526
-
+
527
-
+
528
- public void setDatabaseDriverPath(String databaseDriverPath) {
+
529
- this .databaseDriverPath = databaseDriverPath;
+
530
- }
+
531
-
+ public void setDatabaseDriverPath(String databaseDriverPath) {
532
-
+ this .databaseDriverPath = databaseDriverPath;
533
-
+ }
534
-
+
535
- private String connectionString;
+
536
-
+
537
-
+
538
-
+ private String connectionString;
539
-
+
540
-
+
541
-
+
542
- public String getConnectionString() {
+
543
- return connectionString;
+
544
- }
+
545
-
+ public String getConnectionString() {
546
-
+ return connectionString;
547
-
+ }
548
-
+
549
-
+
550
-
+
551
- public void setConnectionString(String connectionString) {
+
552
- this .connectionString = connectionString;
+
553
- }
+
554
-
+ public void setConnectionString(String connectionString) {
555
-
+ this .connectionString = connectionString;
556
-
+ }
557
-
+
558
- private String databaseUser;
+
559
-
+
560
-
+
561
-
+ private String databaseUser;
562
-
+
563
-
+
564
-
+
565
- public String getDatabaseUser() {
+
566
- return databaseUser;
+
567
- }
+
568
-
+ public String getDatabaseUser() {
569
-
+ return databaseUser;
570
-
+ }
571
-
+
572
-
+
573
-
+
574
- public void setDatabaseUser(String databaseUser) {
+
575
- this .databaseUser = databaseUser;
+
576
- }
+
577
-
+ public void setDatabaseUser(String databaseUser) {
578
-
+ this .databaseUser = databaseUser;
579
-
+ }
580
-
+
581
- private String databasePassword;
+
582
-
+
583
-
+
584
-
+ private String databasePassword;
585
-
+
586
-
+
587
-
+
588
- public String getDatabasePassword() {
+
589
- return databasePassword;
+
590
- }
+
591
-
+ public String getDatabasePassword() {
592
-
+ return databasePassword;
593
-
+ }
594
-
+
595
-
+
596
-
+
597
- public void setDatabasePassword(String databasePassword) {
+
598
- this .databasePassword = databasePassword;
+
599
- }
+
600
-
+ public void setDatabasePassword(String databasePassword) {
601
-
+ this .databasePassword = databasePassword;
602
-
+ }
603
-
+
604
-
+
605
- private String zipExtensions;
+
606
-
+
607
-
+
608
-
+ private String zipExtensions;
609
-
+
610
-
+
611
-
+
612
- public String getZipExtensions() {
+
613
- return zipExtensions;
+
614
- }
+
615
-
+ public String getZipExtensions() {
616
-
+ return zipExtensions;
617
-
+ }
618
-
+
619
-
+
620
-
+
621
- public void setZipExtensions(String zipExtensions) {
+
622
- this .zipExtensions = zipExtensions;
+
623
- }
+
624
-
+ public void setZipExtensions(String zipExtensions) {
625
-
+ this .zipExtensions = zipExtensions;
626
-
+ }
627
-
+
628
- private String cveUrl12Modified;
+
629
-
+
630
-
+
631
-
+ private String cveUrl12Modified;
632
-
+
633
-
+
634
-
+
635
- public String getCveUrl12Modified() {
+
636
- return cveUrl12Modified;
+
637
- }
+
638
-
+ public String getCveUrl12Modified() {
639
-
+ return cveUrl12Modified;
640
-
+ }
641
-
+
642
-
+
643
-
+
644
- public void setCveUrl12Modified(String cveUrl12Modified) {
+
645
- this .cveUrl12Modified = cveUrl12Modified;
+
646
- }
+
647
-
+ public void setCveUrl12Modified(String cveUrl12Modified) {
648
-
+ this .cveUrl12Modified = cveUrl12Modified;
649
-
+ }
650
-
+
651
- private String cveUrl20Modified;
+
652
-
+
653
-
+
654
-
+ private String cveUrl20Modified;
655
-
+
656
-
+
657
-
+
658
- public String getCveUrl20Modified() {
+
659
- return cveUrl20Modified;
+
660
- }
+
661
-
+ public String getCveUrl20Modified() {
662
-
+ return cveUrl20Modified;
663
-
+ }
664
-
+
665
-
+
666
-
+
667
- public void setCveUrl20Modified(String cveUrl20Modified) {
+
668
- this .cveUrl20Modified = cveUrl20Modified;
+
669
- }
+
670
-
+ public void setCveUrl20Modified(String cveUrl20Modified) {
671
-
+ this .cveUrl20Modified = cveUrl20Modified;
672
-
+ }
673
-
+
674
- private String cveUrl12Base;
+
675
-
+
676
-
+
677
-
+ private String cveUrl12Base;
678
-
+
679
-
+
680
-
+
681
- public String getCveUrl12Base() {
+
682
- return cveUrl12Base;
+
683
- }
+
684
-
+ public String getCveUrl12Base() {
685
-
+ return cveUrl12Base;
686
-
+ }
687
-
+
688
-
+
689
-
+
690
- public void setCveUrl12Base(String cveUrl12Base) {
+
691
- this .cveUrl12Base = cveUrl12Base;
+
692
- }
+
693
-
+ public void setCveUrl12Base(String cveUrl12Base) {
694
-
+ this .cveUrl12Base = cveUrl12Base;
695
-
+ }
696
-
+
697
- private String cveUrl20Base;
+
698
-
+
699
-
+
700
-
+ private String cveUrl20Base;
701
-
+
702
-
+
703
-
+
704
- public String getCveUrl20Base() {
+
705
- return cveUrl20Base;
+
706
- }
+
707
-
+ public String getCveUrl20Base() {
708
-
+ return cveUrl20Base;
709
-
+ }
710
-
+
711
-
+
712
-
+
713
- public void setCveUrl20Base(String cveUrl20Base) {
+
714
- this .cveUrl20Base = cveUrl20Base;
+
715
- }
+
716
-
+ public void setCveUrl20Base(String cveUrl20Base) {
717
-
+ this .cveUrl20Base = cveUrl20Base;
718
-
+ }
719
-
+
720
- private String pathToMono;
+
721
-
+
722
-
+
723
-
+ private String pathToMono;
724
-
+
725
-
+
726
-
+
727
- public String getPathToMono() {
+
728
- return pathToMono;
+
729
- }
+
730
-
+ public String getPathToMono() {
731
-
+ return pathToMono;
732
-
+ }
733
-
+
734
-
+
735
-
+
736
- public void setPathToMono(String pathToMono) {
+
737
- this .pathToMono = pathToMono;
+
738
- }
+
739
-
+ public void setPathToMono(String pathToMono) {
740
-
+ this .pathToMono = pathToMono;
741
-
- 742
-
- 743
-
- 744
-
- 745
-
- 746
-
- 747
- private Engine executeDependencyCheck() throws DatabaseException {
- 748 0 populateSettings();
- 749 0 Engine engine = null ;
- 750
- try {
- 751 0 engine = new Engine();
- 752 0 engine.setDependencies(this .dependencies);
- 753 0 engine.analyzeDependencies();
- 754
-
- 755
- } finally {
- 756 0 if (engine != null ) {
- 757 0 engine.cleanup();
- 758
- }
- 759
- }
- 760 0 return engine;
- 761
}
- 762
+ 742
- 763
+ 743
- 764
-
- 765
+ 744
+
+ 745
- 766
-
- 767
-
- 768
+ 746
+
+ 747
+
+ 748
+
+ 749
- 769
+ 750
+ private Engine executeDependencyCheck() throws DatabaseException {
+ 751 0 populateSettings();
+ 752 0 Engine engine = null ;
+ 753 0 engine = new Engine();
+ 754 0 engine.setDependencies(this .dependencies);
+ 755 0 engine.analyzeDependencies();
+ 756 0 return engine;
+ 757
+ }
+ 758
+
+ 759
+
+ 760
+
+ 761
+
+ 762
+
+ 763
+
+ 764
+
+ 765
private void generateExternalReports(Engine engine, File outDirectory) {
- 770 0 DatabaseProperties prop = null ;
- 771 0 CveDB cve = null ;
- 772
+ 766 0 DatabaseProperties prop = null ;
+ 767 0 CveDB cve = null ;
+ 768
try {
- 773 0 cve = new CveDB();
- 774 0 cve.open();
- 775 0 prop = cve.getDatabaseProperties();
- 776 0 } catch (DatabaseException ex) {
- 777 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.FINE, "Unable to retrieve DB Properties" , ex);
- 778
+ 769 0 cve = new CveDB();
+ 770 0 cve.open();
+ 771 0 prop = cve.getDatabaseProperties();
+ 772 0 } catch (DatabaseException ex) {
+ 773 0 LOGGER.log(Level.FINE, "Unable to retrieve DB Properties" , ex);
+ 774
} finally {
- 779 0 if (cve != null ) {
- 780 0 cve.close();
- 781
+ 775 0 if (cve != null ) {
+ 776 0 cve.close();
+ 777
}
- 782
+ 778
}
- 783 0 final ReportGenerator r = new ReportGenerator(this .applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
- 784
+ 779 0 final ReportGenerator r = new ReportGenerator(this .applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
+ 780
try {
- 785 0 r.generateReports(outDirectory.getCanonicalPath(), this .reportFormat.name());
- 786 0 } catch (IOException ex) {
- 787 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.SEVERE,
+ 781 0 r.generateReports(outDirectory.getCanonicalPath(), this .reportFormat.name());
+ 782 0 } catch (IOException ex) {
+ 783 0 LOGGER.log(Level.SEVERE,
+ 784
+ "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
+ 785 0 LOGGER.log(Level.FINE, null , ex);
+ 786 0 } catch (Throwable ex) {
+ 787 0 LOGGER.log(Level.SEVERE,
788
"Unexpected exception occurred during analysis; please see the verbose error log for more details." );
- 789 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.FINE, null , ex);
- 790 0 } catch (Throwable ex) {
- 791 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.SEVERE,
+ 789 0 LOGGER.log(Level.FINE, null , ex);
+ 790 0 }
+ 791 0 }
792
- "Unexpected exception occurred during analysis; please see the verbose error log for more details." );
- 793 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.FINE, null , ex);
- 794 0 }
- 795 0 }
- 796
- 797
+ 793
- 798
+ 794
- 799
+ 795
- 800
+ 796
- 801
+ 797
private void populateSettings() {
- 802 0 if (dataDirectory != null ) {
- 803 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
- 804
+ 798 0 Settings.initialize();
+ 799 0 if (dataDirectory != null ) {
+ 800 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
+ 801
} else {
- 805 0 final File jarPath = new File(DependencyCheckScanAgent.class .getProtectionDomain().getCodeSource().getLocation().getPath());
- 806 0 final File base = jarPath.getParentFile();
- 807 0 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
- 808 0 final File dataDir = new File(base, sub);
- 809 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
- 810
+ 802 0 final File jarPath = new File(DependencyCheckScanAgent.class .getProtectionDomain().getCodeSource().getLocation().getPath());
+ 803 0 final File base = jarPath.getParentFile();
+ 804 0 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
+ 805 0 final File dataDir = new File(base, sub);
+ 806 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
+ 807
}
- 811
+ 808
- 812 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+ 809 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+ 810
+
+ 811 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
+ 812 0 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
813
-
- 814 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
- 815 0 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
+ }
+ 814 0 if (proxyPort != null && !proxyPort.isEmpty()) {
+ 815 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
816
}
- 817 0 if (proxyPort != null && !proxyPort.isEmpty()) {
- 818 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
+ 817 0 if (proxyUsername != null && !proxyUsername.isEmpty()) {
+ 818 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUsername);
819
}
- 820 0 if (proxyUsername != null && !proxyUsername.isEmpty()) {
- 821 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUsername);
+ 820 0 if (proxyPassword != null && !proxyPassword.isEmpty()) {
+ 821 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
822
}
- 823 0 if (proxyPassword != null && !proxyPassword.isEmpty()) {
- 824 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
+ 823 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
+ 824 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
825
}
- 826 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
- 827 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+ 826 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
+ 827 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
828
}
- 829 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
- 830 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
- 831
+ 829 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
+ 830 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
+ 831 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+ 832
}
- 832 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
- 833 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
- 834 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
- 835
+ 833 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
+ 834 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
+ 835 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
+ 836
}
- 836 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
- 837 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
- 838 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
+ 837 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
+ 838 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
839
}
- 840 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
- 841 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
+ 840 0 if (connectionString != null && !connectionString.isEmpty()) {
+ 841 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
842
}
- 843 0 if (connectionString != null && !connectionString.isEmpty()) {
- 844 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
+ 843 0 if (databaseUser != null && !databaseUser.isEmpty()) {
+ 844 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
845
}
- 846 0 if (databaseUser != null && !databaseUser.isEmpty()) {
- 847 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
+ 846 0 if (databasePassword != null && !databasePassword.isEmpty()) {
+ 847 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
848
}
- 849 0 if (databasePassword != null && !databasePassword.isEmpty()) {
- 850 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
+ 849 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
+ 850 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
851
}
- 852 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
- 853 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
+ 852 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
+ 853 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
854
}
- 855 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
- 856 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
+ 855 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
+ 856 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
857
}
- 858 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
- 859 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
+ 858 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
+ 859 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
860
}
- 861 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
- 862 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
+ 861 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
+ 862 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
863
}
- 864 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
- 865 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
+ 864 0 if (pathToMono != null && !pathToMono.isEmpty()) {
+ 865 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
866
}
- 867 0 if (pathToMono != null && !pathToMono.isEmpty()) {
- 868 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
- 869
- }
- 870 0 }
- 871
+ 867 0 }
+ 868
- 872
+ 869
- 873
+ 870
- 874
+ 871
- 875
+ 872
- 876
+ 873
- 877
+ 874
- 878
+ 875
public void execute() throws ScanAgentException {
- 879 0 Engine engine = null ;
- 880
+ 876 0 Engine engine = null ;
+ 877
try {
- 881 0 engine = executeDependencyCheck();
- 882 0 generateExternalReports(engine, new File(this .reportOutputDirectory));
- 883 0 if (this .showSummary) {
- 884 0 showSummary(engine.getDependencies());
+ 878 0 engine = executeDependencyCheck();
+ 879 0 generateExternalReports(engine, new File(this .reportOutputDirectory));
+ 880 0 if (this .showSummary) {
+ 881 0 showSummary(engine.getDependencies());
+ 882
+ }
+ 883 0 if (this .failBuildOnCVSS <= 10) {
+ 884 0 checkForFailure(engine.getDependencies());
885
}
- 886 0 if (this .failBuildOnCVSS <= 10) {
- 887 0 checkForFailure(engine.getDependencies());
+ 886 0 } catch (DatabaseException ex) {
+ 887 0 LOGGER.log(Level.SEVERE,
888
- }
- 889 0 } catch (DatabaseException ex) {
- 890 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.SEVERE,
- 891
"Unable to connect to the dependency-check database; analysis has stopped" );
- 892 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.FINE, "" , ex);
- 893
+ 889 0 LOGGER.log(Level.FINE, "" , ex);
+ 890
} finally {
- 894 0 if (engine != null ) {
- 895 0 engine.cleanup();
- 896
+ 891 0 Settings.cleanup();
+ 892 0 if (engine != null ) {
+ 893 0 engine.cleanup();
+ 894
}
+ 895
+ }
+ 896 0 }
897
- }
- 898 0 }
+
+ 898
+
899
-
- 900
-
- 901
- 902
+ 900
- 903
+ 901
- 904
+ 902
- 905
+ 903
- 906
+ 904
- 907
+ 905
- 908
+ 906
private void checkForFailure(List<Dependency> dependencies) throws ScanAgentException {
- 909 0 final StringBuilder ids = new StringBuilder();
- 910 0 for (Dependency d : dependencies) {
- 911 0 boolean addName = true ;
- 912 0 for (Vulnerability v : d.getVulnerabilities()) {
- 913 0 if (v.getCvssScore() >= failBuildOnCVSS) {
- 914 0 if (addName) {
- 915 0 addName = false ;
- 916 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
- 917 0 ids.append(v.getName());
+ 907 0 final StringBuilder ids = new StringBuilder();
+ 908 0 for (Dependency d : dependencies) {
+ 909 0 boolean addName = true ;
+ 910 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 911 0 if (v.getCvssScore() >= failBuildOnCVSS) {
+ 912 0 if (addName) {
+ 913 0 addName = false ;
+ 914 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
+ 915 0 ids.append(v.getName());
+ 916
+ } else {
+ 917 0 ids.append(", " ).append(v.getName());
918
- } else {
- 919 0 ids.append(", " ).append(v.getName());
- 920
}
- 921
+ 919
}
- 922 0 }
- 923 0 }
- 924 0 if (ids.length() > 0) {
- 925 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
- 926
+ 920 0 }
+ 921 0 }
+ 922 0 if (ids.length() > 0) {
+ 923 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
+ 924
+ "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
- 927
+ 925
+ "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
+ 926
+
+ 927 0 throw new ScanAgentException(msg);
928
-
- 929 0 throw new ScanAgentException(msg);
+ }
+ 929 0 }
930
- }
- 931 0 }
- 932
- 933
+ 931
- 934
+ 932
- 935
+ 933
- 936
+ 934
- 937
+ 935
- 938
+ 936
private void showSummary(List<Dependency> dependencies) {
- 939 0 final StringBuilder summary = new StringBuilder();
- 940 0 for (Dependency d : dependencies) {
- 941 0 boolean firstEntry = true ;
- 942 0 final StringBuilder ids = new StringBuilder();
- 943 0 for (Vulnerability v : d.getVulnerabilities()) {
- 944 0 if (firstEntry) {
- 945 0 firstEntry = false ;
- 946
+ 937 0 final StringBuilder summary = new StringBuilder();
+ 938 0 for (Dependency d : dependencies) {
+ 939 0 boolean firstEntry = true ;
+ 940 0 final StringBuilder ids = new StringBuilder();
+ 941 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 942 0 if (firstEntry) {
+ 943 0 firstEntry = false ;
+ 944
} else {
- 947 0 ids.append(", " );
- 948
+ 945 0 ids.append(", " );
+ 946
}
- 949 0 ids.append(v.getName());
- 950 0 }
- 951 0 if (ids.length() > 0) {
- 952 0 summary.append(d.getFileName()).append(" (" );
- 953 0 firstEntry = true ;
- 954 0 for (Identifier id : d.getIdentifiers()) {
- 955 0 if (firstEntry) {
- 956 0 firstEntry = false ;
- 957
+ 947 0 ids.append(v.getName());
+ 948 0 }
+ 949 0 if (ids.length() > 0) {
+ 950 0 summary.append(d.getFileName()).append(" (" );
+ 951 0 firstEntry = true ;
+ 952 0 for (Identifier id : d.getIdentifiers()) {
+ 953 0 if (firstEntry) {
+ 954 0 firstEntry = false ;
+ 955
} else {
- 958 0 summary.append(", " );
- 959
+ 956 0 summary.append(", " );
+ 957
}
- 960 0 summary.append(id.getValue());
- 961 0 }
- 962 0 summary.append(") : " ).append(ids).append(NEW_LINE);
- 963
+ 958 0 summary.append(id.getValue());
+ 959 0 }
+ 960 0 summary.append(") : " ).append(ids).append(NEW_LINE);
+ 961
}
- 964 0 }
- 965 0 if (summary.length() > 0) {
- 966 0 final String msg = String.format("%n%n"
- 967
+ 962 0 }
+ 963 0 if (summary.length() > 0) {
+ 964 0 final String msg = String.format("%n%n"
+ 965
+ "One or more dependencies were identified with known vulnerabilities:%n%n%s"
- 968
+ 966
+ "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
- 969 0 Logger.getLogger(DependencyCheckScanAgent.class .getName()).log(Level.WARNING, msg);
- 970
+ 967 0 LOGGER.log(Level.WARNING, msg);
+ 968
}
- 971 0 }
- 972
+ 969 0 }
+ 970
- 973
+ 971
}
-
+
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 bcb2cf808..c00ca7438 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
@@ -12,7 +12,7 @@
@@ -83,7 +83,7 @@
public void initialize() throws Exception {
33
- 34 0 }
+ 34 9 }
35
36
@@ -102,11 +102,11 @@
public void close() throws Exception {
43
- 44 0 }
+ 44 15 }
45
}
-
+
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 3cb332227..cf5a5b917 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
@@ -12,7 +12,7 @@
@@ -101,39 +101,39 @@
42
- 43 0 public AbstractFileTypeAnalyzer() {
- 44 0 final String key = getAnalyzerEnabledSettingKey();
+ 43 29 public AbstractFileTypeAnalyzer() {
+ 44 29 final String key = getAnalyzerEnabledSettingKey();
45
try {
- 46 0 enabled = Settings.getBoolean(key, true );
+ 46 29 enabled = Settings.getBoolean(key, true );
47 0 } catch (InvalidSettingException ex) {
- 48 0 String msg = String.format("Invalid settting for property '%s'" , key);
+ 48 0 String msg = String.format("Invalid setting for property '%s'" , key);
49 0 LOGGER.log(Level.WARNING, msg);
50 0 LOGGER.log(Level.FINE, "" , ex);
51 0 msg = String.format("%s has been disabled" , getName());
52 0 LOGGER.log(Level.WARNING, msg);
- 53 0 }
- 54 0 }
+ 53 29 }
+ 54 29 }
55
56
57
-
+
58
59
60
- 61 0 private static final Logger LOGGER = Logger.getLogger(AbstractFileTypeAnalyzer.class .getName());
+ 61 1 private static final Logger LOGGER = Logger.getLogger(AbstractFileTypeAnalyzer.class .getName());
62
63
64
- 65 0 private boolean filesMatched = false ;
+ 65 29 private boolean filesMatched = false ;
66
67
@@ -178,7 +178,7 @@
87
- 88 0 private boolean enabled = true ;
+ 88 29 private boolean enabled = true ;
89
90
@@ -321,14 +321,14 @@
@Override
159
public final void initialize() throws Exception {
- 160 0 if (filesMatched) {
- 161 0 initializeFileTypeAnalyzer();
+ 160 10 if (filesMatched) {
+ 161 7 initializeFileTypeAnalyzer();
162
} else {
- 163 0 enabled = false ;
+ 163 3 enabled = false ;
164
}
- 165 0 }
+ 165 10 }
166
167
@@ -351,11 +351,11 @@
@Override
176
public final void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 177 0 if (enabled) {
- 178 0 analyzeFileType(dependency, engine);
+ 177 10 if (enabled) {
+ 178 10 analyzeFileType(dependency, engine);
179
}
- 180 0 }
+ 180 9 }
181
182
@@ -374,25 +374,25 @@
@Override
189
public final boolean supportsExtension(String extension) {
- 190 0 if (!enabled) {
- 191 0 return false ;
+ 190 4259 if (!enabled) {
+ 191 854 return false ;
192
}
- 193 0 final Set<String> ext = getSupportedExtensions();
- 194 0 if (ext == null ) {
+ 193 3405 final Set<String> ext = getSupportedExtensions();
+ 194 3405 if (ext == null ) {
195 0 final String msg = String.format("The '%s' analyzer is misconfigured and does not have any file extensions;"
196
+ " it will be disabled" , getName());
- 197 0 Logger.getLogger(AbstractFileTypeAnalyzer.class .getName()).log(Level.SEVERE, msg);
+ 197 0 LOGGER.log(Level.SEVERE, msg);
198 0 return false ;
199
} else {
- 200 0 final boolean match = ext.contains(extension);
- 201 0 if (match) {
- 202 0 filesMatched = match;
+ 200 3405 final boolean match = ext.contains(extension);
+ 201 3405 if (match) {
+ 202 16 filesMatched = match;
203
}
- 204 0 return match;
+ 204 3405 return match;
205
}
206
@@ -429,11 +429,11 @@
222
protected static Set<String> newHashSet(String... strings) {
- 223 0 final Set<String> set = new HashSet<String>();
+ 223 10 final Set<String> set = new HashSet<String>();
224
- 225 0 Collections.addAll(set, strings);
- 226 0 return set;
+ 225 10 Collections.addAll(set, strings);
+ 226 10 return set;
227
}
228
@@ -442,6 +442,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 26988d67e..938ebd345 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
@@ -12,7 +12,7 @@
@@ -60,218 +60,257 @@
21
import java.io.IOException;
22
- import java.net.MalformedURLException;
+ import java.io.InputStream;
23
- import java.net.URL;
+ import java.net.MalformedURLException;
24
- import java.util.List;
+ import java.net.URL;
25
- import java.util.Set;
+ import java.util.List;
26
- import java.util.logging.Level;
+ import java.util.Set;
27
- import java.util.logging.Logger;
+ import java.util.logging.Level;
28
- import java.util.regex.Pattern;
+ import java.util.logging.Logger;
29
- import org.owasp.dependencycheck.suppression.SuppressionParseException;
+ import java.util.regex.Pattern;
30
- import org.owasp.dependencycheck.suppression.SuppressionParser;
+ import org.owasp.dependencycheck.suppression.SuppressionParseException;
31
- import org.owasp.dependencycheck.suppression.SuppressionRule;
+ import org.owasp.dependencycheck.suppression.SuppressionParser;
32
- import org.owasp.dependencycheck.utils.DownloadFailedException;
+ import org.owasp.dependencycheck.suppression.SuppressionRule;
33
- import org.owasp.dependencycheck.utils.Downloader;
+ import org.owasp.dependencycheck.utils.DownloadFailedException;
34
- import org.owasp.dependencycheck.utils.FileUtils;
+ import org.owasp.dependencycheck.utils.Downloader;
35
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.utils.FileUtils;
36
-
+ import org.owasp.dependencycheck.utils.Settings;
37
-
- 38
-
- 39
-
- 40
-
- 41
-
- 42
- public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
- 43
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
44
-
+
45
46
-
+
47
-
- 48
-
+
+ 48 1 private static final Logger LOGGER = Logger.getLogger(AbstractSuppressionAnalyzer.class .getName());
49
-
+
50
- public Set<String> getSupportedExtensions() {
+
51
- return null ;
+
52
- }
+
53
-
+
54
-
+
55
-
+
56
-
+ public Set<String> getSupportedExtensions() {
57
-
+ return null ;
58
-
+ }
59
-
- 60
- @Override
- 61
- public void initialize() throws Exception {
- 62 0 super .initialize();
- 63 0 loadSuppressionData();
- 64 0 }
- 65
-
- 66
-
- 67
-
- 68
- private List<SuppressionRule> rules;
- 69
- 70
+ 60
+
+ 61
- 71
-
- 72
+ 62
+
+ 63
+ 64
+
+ 65
+
+ 66
+ @Override
+ 67
+ public void initialize() throws Exception {
+ 68 4 super .initialize();
+ 69 4 loadSuppressionData();
+ 70 4 }
+ 71
+
+ 72
+
73
-
+
74
75
- public List<SuppressionRule> getRules() {
+ private List<SuppressionRule> rules;
76
- return rules;
+
77
- }
+
78
-
+
79
-
+
80
-
+
81
-
+
82
-
+ public List<SuppressionRule> getRules() {
83
-
+ return rules;
84
- public void setRules(List<SuppressionRule> rules) {
- 85
- this .rules = rules;
- 86
}
- 87
+ 85
- 88
+ 86
- 89
-
- 90
+ 87
+
+ 88
- 91
-
- 92
+ 89
+
+ 90
+ 91
+ public void setRules(List<SuppressionRule> rules) {
+ 92
+ this .rules = rules;
93
- private void loadSuppressionData() throws SuppressionParseException {
- 94 0 final String suppressionFilePath = Settings.getString(Settings.KEYS.SUPPRESSION_FILE);
- 95 0 if (suppressionFilePath == null ) {
- 96 0 return ;
- 97
- }
- 98 0 File file = null ;
- 99 0 boolean deleteTempFile = false ;
- 100
- try {
- 101 0 final Pattern uriRx = Pattern.compile("^(https?|file)\\:.*" , Pattern.CASE_INSENSITIVE);
- 102 0 if (uriRx.matcher(suppressionFilePath).matches()) {
- 103 0 deleteTempFile = true ;
- 104 0 file = FileUtils.getTempFile("suppression" , "xml" );
- 105 0 final URL url = new URL(suppressionFilePath);
- 106
- try {
- 107 0 Downloader.fetchFile(url, file, false );
- 108 0 } catch (DownloadFailedException ex) {
- 109 0 Downloader.fetchFile(url, file, true );
- 110 0 }
- 111 0 } else {
- 112 0 file = new File(suppressionFilePath);
- 113
- }
- 114
+ }
+ 94
- 115 0 if (file != null ) {
- 116 0 final SuppressionParser parser = new SuppressionParser();
- 117
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+ private void loadSuppressionData() throws SuppressionParseException {
+ 101 4 final String suppressionFilePath = Settings.getString(Settings.KEYS.SUPPRESSION_FILE);
+ 102 4 if (suppressionFilePath == null ) {
+ 103 2 return ;
+ 104
+ }
+ 105 2 File file = null ;
+ 106 2 boolean deleteTempFile = false ;
+ 107
+ try {
+ 108 2 final Pattern uriRx = Pattern.compile("^(https?|file)\\:.*" , Pattern.CASE_INSENSITIVE);
+ 109 2 if (uriRx.matcher(suppressionFilePath).matches()) {
+ 110 2 deleteTempFile = true ;
+ 111 2 file = FileUtils.getTempFile("suppression" , "xml" );
+ 112 2 final URL url = new URL(suppressionFilePath);
+ 113
try {
- 118 0 rules = parser.parseSuppressionRules(file);
- 119 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.FINE, rules.size() + " suppression rules were loaded." );
- 120 0 } catch (SuppressionParseException ex) {
- 121 0 final String msg = String.format("Unable to parse suppression xml file '%s'" , file.getPath());
- 122 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.WARNING, msg);
- 123 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.WARNING, ex.getMessage());
- 124 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.FINE, "" , ex);
- 125 0 throw ex;
- 126 0 }
- 127
- }
- 128 0 } catch (DownloadFailedException ex) {
- 129 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.WARNING,
+ 114 2 Downloader.fetchFile(url, file, false );
+ 115 0 } catch (DownloadFailedException ex) {
+ 116 0 Downloader.fetchFile(url, file, true );
+ 117 2 }
+ 118 2 } else {
+ 119 0 file = new File(suppressionFilePath);
+ 120 0 if (!file.exists()) {
+ 121 0 final InputStream suppressionsFromClasspath = this .getClass().getClassLoader().getResourceAsStream(suppressionFilePath);
+ 122 0 if (suppressionsFromClasspath != null ) {
+ 123 0 deleteTempFile = true ;
+ 124 0 file = FileUtils.getTempFile("suppression" , "xml" );
+ 125
+ try {
+ 126 0 org.apache.commons.io.FileUtils.copyInputStreamToFile(suppressionsFromClasspath, file);
+ 127 0 } catch (IOException ex) {
+ 128 0 throwSuppressionParseException("Unable to locate suppressions file in classpath" , ex);
+ 129 0 }
130
- "Unable to fetch the configured suppression file" );
- 131 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.FINE, "" , ex);
- 132 0 throw new SuppressionParseException("Unable to fetch the configured suppression file" , ex);
- 133 0 } catch (MalformedURLException ex) {
- 134 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.WARNING,
- 135
- "Configured suppression file has an invalid URL" );
- 136 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.FINE, "" , ex);
- 137 0 throw new SuppressionParseException("Configured suppression file has an invalid URL" , ex);
- 138 0 } catch (IOException ex) {
- 139 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.WARNING,
- 140
- "Unable to create temp file for suppressions" );
- 141 0 Logger.getLogger(AbstractSuppressionAnalyzer.class .getName()).log(Level.FINE, "" , ex);
- 142 0 throw new SuppressionParseException("Unable to create temp file for suppressions" , ex);
- 143
- } finally {
- 144 0 if (deleteTempFile && file != null ) {
- 145 0 FileUtils.delete(file);
+ }
+ 131
+ }
+ 132
+ }
+ 133
+
+ 134 2 if (file != null ) {
+ 135 2 final SuppressionParser parser = new SuppressionParser();
+ 136
+ try {
+ 137 2 rules = parser.parseSuppressionRules(file);
+ 138 2 LOGGER.log(Level.FINE, rules.size() + " suppression rules were loaded." );
+ 139 0 } catch (SuppressionParseException ex) {
+ 140 0 final String msg = String.format("Unable to parse suppression xml file '%s'" , file.getPath());
+ 141 0 LOGGER.log(Level.WARNING, msg);
+ 142 0 LOGGER.log(Level.WARNING, ex.getMessage());
+ 143 0 LOGGER.log(Level.FINE, "" , ex);
+ 144 0 throw ex;
+ 145 2 }
146
}
- 147
+ 147 0 } catch (DownloadFailedException ex) {
+ 148 0 throwSuppressionParseException("Unable to fetch the configured suppression file" , ex);
+ 149 0 } catch (MalformedURLException ex) {
+ 150 0 throwSuppressionParseException("Configured suppression file has an invalid URL" , ex);
+ 151 0 } catch (IOException ex) {
+ 152 0 throwSuppressionParseException("Unable to create temp file for suppressions" , ex);
+ 153
+ } finally {
+ 154 2 if (deleteTempFile && file != null ) {
+ 155 2 FileUtils.delete(file);
+ 156
+ }
+ 157
}
- 148 0 }
- 149
+ 158 2 }
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+ private void throwSuppressionParseException(String message, Exception exception) throws SuppressionParseException {
+ 168 0 LOGGER.log(Level.WARNING, message);
+ 169 0 LOGGER.log(Level.FINE, "" , exception);
+ 170 0 throw new SuppressionParseException(message, exception);
+ 171
+ }
+ 172
}
-
+
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 fcc51cc2e..d058d75d4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
@@ -12,7 +12,7 @@
@@ -65,7 +65,7 @@
24
- 25 0 public enum AnalysisPhase {
+ 25 5 public enum AnalysisPhase {
26
27
@@ -74,67 +74,67 @@
29
- 30 0 INITIAL,
+ 30 1 INITIAL,
31
32
33
- 34 0 INFORMATION_COLLECTION,
+ 34 1 INFORMATION_COLLECTION,
35
36
37
- 38 0 PRE_IDENTIFIER_ANALYSIS,
+ 38 1 PRE_IDENTIFIER_ANALYSIS,
39
40
41
- 42 0 IDENTIFIER_ANALYSIS,
+ 42 1 IDENTIFIER_ANALYSIS,
43
44
45
- 46 0 POST_IDENTIFIER_ANALYSIS,
+ 46 1 POST_IDENTIFIER_ANALYSIS,
47
48
49
- 50 0 PRE_FINDING_ANALYSIS,
+ 50 1 PRE_FINDING_ANALYSIS,
51
52
53
- 54 0 FINDING_ANALYSIS,
+ 54 1 FINDING_ANALYSIS,
55
56
57
- 58 0 POST_FINDING_ANALYSIS,
+ 58 1 POST_FINDING_ANALYSIS,
59
60
61
- 62 0 FINAL
+ 62 1 FINAL
63
}
-
+
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 53c70ace1..617d8fa0d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
@@ -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 75febe131..39f9019a3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
@@ -12,7 +12,7 @@
@@ -64,84 +64,63 @@
23
24
-
+
25
-
+
26
-
+
27
- public final class AnalyzerService {
+
28
-
+
29
-
+ public class AnalyzerService {
30
-
- 31
-
- 32
- private static AnalyzerService service;
- 33
-
- 34
-
- 35
-
- 36
- private final ServiceLoader<Analyzer> loader;
- 37
- 38
+ 31
- 39
+ 32
+
+ 33
+
+ 34
+ private final ServiceLoader<Analyzer> loader;
+ 35
+
+ 36
+
+ 37
+ 38
+
+ 39
+
40
- 41 0 private AnalyzerService() {
- 42 0 loader = ServiceLoader.load(Analyzer.class );
- 43 0 }
+ 41 2 public AnalyzerService(ClassLoader classLoader) {
+ 42 2 loader = ServiceLoader.load(Analyzer.class , classLoader);
+ 43 2 }
44
45
46
-
+
47
48
-
+
49
50
- public static synchronized AnalyzerService getInstance() {
- 51 0 if (service == null ) {
- 52 0 service = new AnalyzerService();
- 53
- }
- 54 0 return service;
- 55
- }
- 56
-
- 57
-
- 58
-
- 59
-
- 60
-
- 61
-
- 62
public Iterator<Analyzer> getAnalyzers() {
- 63 0 return loader.iterator();
- 64
+ 51 2 return loader.iterator();
+ 52
}
- 65
+ 53
}
-
+
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 a4193476b..90f98be0e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -137,7 +137,7 @@
60
- 61 0 private static final Logger LOGGER = Logger.getLogger(ArchiveAnalyzer.class .getName());
+ 61 1 private static final Logger LOGGER = Logger.getLogger(ArchiveAnalyzer.class .getName());
62
63
@@ -152,7 +152,7 @@
68
- 69 0 private static int dirCount = 0;
+ 69 1 private static int dirCount = 0;
70
71
@@ -167,7 +167,7 @@
76
- 77 0 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
+ 77 1 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
78
79
@@ -194,14 +194,14 @@
90
- 91 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
+ 91 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
92
93
94
- 95 0 private static final Set<String> ZIPPABLES = newHashSet("zip" , "ear" , "war" , "nupkg" );
+ 95 1 private static final Set<String> ZIPPABLES = newHashSet("zip" , "ear" , "war" , "jar" , "sar" , "apk" , "nupkg" );
96
97
@@ -210,19 +210,19 @@
99
- 100 0 private static final Set<String> EXTENSIONS = newHashSet("tar" , "gz" , "tgz" );
+ 100 1 private static final Set<String> EXTENSIONS = newHashSet("tar" , "gz" , "tgz" );
101
102
static {
- 103 0 final String additionalZipExt = Settings.getString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS);
- 104 0 if (additionalZipExt != null ) {
+ 103 1 final String additionalZipExt = Settings.getString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS);
+ 104 1 if (additionalZipExt != null ) {
105 0 final HashSet ext = new HashSet<String>(Arrays.asList(additionalZipExt));
106 0 ZIPPABLES.addAll(ext);
107
}
- 108 0 EXTENSIONS.addAll(ZIPPABLES);
- 109 0 }
+ 108 1 EXTENSIONS.addAll(ZIPPABLES);
+ 109 1 }
110
111
@@ -239,7 +239,7 @@
@Override
117
public Set<String> getSupportedExtensions() {
- 118 0 return EXTENSIONS;
+ 118 850 return EXTENSIONS;
119
}
120
@@ -258,7 +258,7 @@
@Override
127
public String getName() {
- 128 0 return ANALYZER_NAME;
+ 128 4 return ANALYZER_NAME;
129
}
130
@@ -277,7 +277,7 @@
@Override
137
public AnalysisPhase getAnalysisPhase() {
- 138 0 return ANALYSIS_PHASE;
+ 138 1 return ANALYSIS_PHASE;
139
}
140
@@ -298,7 +298,7 @@
@Override
148
protected String getAnalyzerEnabledSettingKey() {
- 149 0 return Settings.KEYS.ANALYZER_ARCHIVE_ENABLED;
+ 149 2 return Settings.KEYS.ANALYZER_ARCHIVE_ENABLED;
150
}
151
@@ -317,391 +317,377 @@
@Override
158
public void initializeFileTypeAnalyzer() throws Exception {
- 159 0 final File baseDir = Settings.getTempDirectory();
- 160 0 if (!baseDir.exists()) {
- 161 0 if (!baseDir.mkdirs()) {
- 162 0 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
- 163 0 throw new AnalysisException(msg);
+ 159 1 final File baseDir = Settings.getTempDirectory();
+ 160 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+ 161 1 if (!tempFileLocation.delete()) {
+ 162 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+ 163 0 throw new AnalysisException(msg);
164
- }
- 165
}
- 166 0 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
- 167 0 if (!tempFileLocation.delete()) {
- 168 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
- 169 0 throw new AnalysisException(msg);
+ 165 1 if (!tempFileLocation.mkdirs()) {
+ 166 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+ 167 0 throw new AnalysisException(msg);
+ 168
+ }
+ 169 1 }
170
- }
- 171 0 if (!tempFileLocation.mkdirs()) {
- 172 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
- 173 0 throw new AnalysisException(msg);
- 174
- }
- 175 0 }
- 176
- 177
+ 171
- 178
+ 172
- 179
+ 173
- 180
+ 174
- 181
+ 175
- 182
+ 176
@Override
- 183
+ 177
public void close() throws Exception {
- 184 0 if (tempFileLocation != null && tempFileLocation.exists()) {
- 185 0 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
- 186 0 final boolean success = FileUtils.delete(tempFileLocation);
- 187 0 if (!success) {
- 188 0 LOGGER.log(Level.WARNING, "Failed to delete some temporary files, see the log for more details" );
- 189
+ 178 1 if (tempFileLocation != null && tempFileLocation.exists()) {
+ 179 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
+ 180 1 final boolean success = FileUtils.delete(tempFileLocation);
+ 181 1 if (!success) {
+ 182 0 LOGGER.log(Level.WARNING, "Failed to delete some temporary files, see the log for more details" );
+ 183
}
- 190
+ 184
}
- 191 0 }
- 192
+ 185 1 }
+ 186
- 193
+ 187
- 194
+ 188
- 195
+ 189
- 196
+ 190
- 197
+ 191
- 198
+ 192
- 199
+ 193
- 200
+ 194
- 201
+ 195
@Override
- 202
+ 196
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 203 0 final File f = new File(dependency.getActualFilePath());
- 204 0 final File tmpDir = getNextTempDirectory();
- 205 0 extractFiles(f, tmpDir, engine);
- 206
+ 197 2 final File f = new File(dependency.getActualFilePath());
+ 198 2 final File tmpDir = getNextTempDirectory();
+ 199 2 extractFiles(f, tmpDir, engine);
+ 200
- 207
+ 201
- 208 0 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
- 209 0 engine.scan(tmpDir);
- 210 0 final List<Dependency> newDependencies = engine.getDependencies();
- 211 0 if (dependencies.size() != newDependencies.size()) {
- 212
+ 202 2 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
+ 203 2 engine.scan(tmpDir);
+ 204 2 final List<Dependency> newDependencies = engine.getDependencies();
+ 205 2 if (dependencies.size() != newDependencies.size()) {
+ 206
- 213 0 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 214 0 dependencySet.addAll(newDependencies);
- 215 0 dependencySet.removeAll(dependencies);
- 216
+ 207 0 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 208 0 dependencySet.addAll(newDependencies);
+ 209 0 dependencySet.removeAll(dependencies);
+ 210
- 217 0 for (Dependency d : dependencySet) {
- 218
+ 211 0 for (Dependency d : dependencySet) {
+ 212
- 219 0 final String displayPath = String.format("%s%s" ,
- 220
+ 213 0 final String displayPath = String.format("%s%s" ,
+ 214
dependency.getFilePath(),
- 221
+ 215
d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
- 222 0 final String displayName = String.format("%s%s%s" ,
- 223
+ 216 0 final String displayName = String.format("%s%s%s" ,
+ 217
dependency.getFileName(),
- 224
+ 218
File.separator,
- 225
+ 219
d.getFileName());
- 226 0 d.setFilePath(displayPath);
- 227 0 d.setFileName(displayName);
- 228
+ 220 0 d.setFilePath(displayPath);
+ 221 0 d.setFileName(displayName);
+ 222
- 229
+ 223
- 230
+ 224
- 231 0 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
- 232 0 scanDepth += 1;
- 233 0 analyze(d, engine);
- 234 0 scanDepth -= 1;
+ 225 0 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
+ 226 0 scanDepth += 1;
+ 227 0 analyze(d, engine);
+ 228 0 scanDepth -= 1;
+ 229
+ }
+ 230 0 }
+ 231
+ }
+ 232 2 Collections.sort(engine.getDependencies());
+ 233 2 }
+ 234
+
235
- }
- 236 0 }
- 237
- }
- 238 0 Collections.sort(engine.getDependencies());
- 239 0 }
- 240
-
- 241
- 242
+ 236
- 243
+ 237
- 244
+ 238
- 245
+ 239
- 246
+ 240
- 247
+ 241
private File getNextTempDirectory() throws AnalysisException {
- 248 0 dirCount += 1;
- 249 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 250
+ 242 2 dirCount += 1;
+ 243 2 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 244
- 251 0 if (directory.exists()) {
- 252 0 return getNextTempDirectory();
+ 245 2 if (directory.exists()) {
+ 246 0 return getNextTempDirectory();
+ 247
+ }
+ 248 2 if (!directory.mkdirs()) {
+ 249 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 250 0 throw new AnalysisException(msg);
+ 251
+ }
+ 252 2 return directory;
253
- }
- 254 0 if (!directory.mkdirs()) {
- 255 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
- 256 0 throw new AnalysisException(msg);
- 257
- }
- 258 0 return directory;
- 259
}
- 260
+ 254
- 261
+ 255
- 262
+ 256
- 263
+ 257
- 264
+ 258
- 265
+ 259
- 266
+ 260
- 267
+ 261
- 268
+ 262
- 269
+ 263
private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
- 270 0 if (archive == null || destination == null ) {
- 271 0 return ;
- 272
+ 264 2 if (archive == null || destination == null ) {
+ 265 0 return ;
+ 266
}
- 273
+ 267
- 274 0 FileInputStream fis = null ;
- 275
+ 268 2 FileInputStream fis = null ;
+ 269
try {
- 276 0 fis = new FileInputStream(archive);
- 277 0 } catch (FileNotFoundException ex) {
- 278 0 LOGGER.log(Level.FINE, null , ex);
- 279 0 throw new AnalysisException("Archive file was not found." , ex);
- 280 0 }
- 281 0 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
- 282
+ 270 2 fis = new FileInputStream(archive);
+ 271 0 } catch (FileNotFoundException ex) {
+ 272 0 LOGGER.log(Level.FINE, null , ex);
+ 273 0 throw new AnalysisException("Archive file was not found." , ex);
+ 274 2 }
+ 275 2 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
+ 276
try {
- 283 0 if (ZIPPABLES.contains(archiveExt)) {
- 284 0 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
- 285 0 } else if ("tar" .equals(archiveExt)) {
- 286 0 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
- 287 0 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
- 288 0 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
- 289 0 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
- 290 0 if (engine.supportsExtension(uncompressedExt)) {
- 291 0 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
- 292
+ 277 2 if (ZIPPABLES.contains(archiveExt)) {
+ 278 2 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 279 0 } else if ("tar" .equals(archiveExt)) {
+ 280 0 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 281 0 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
+ 282 0 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
+ 283 0 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
+ 284 0 if (engine.supportsExtension(uncompressedExt)) {
+ 285 0 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
+ 286
}
- 293
+ 287
}
- 294 0 } catch (ArchiveExtractionException ex) {
- 295 0 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
- 296 0 LOGGER.log(Level.WARNING, msg);
- 297 0 LOGGER.log(Level.FINE, null , ex);
- 298 0 } catch (IOException ex) {
- 299 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
- 300 0 LOGGER.log(Level.WARNING, msg);
- 301 0 LOGGER.log(Level.FINE, null , ex);
- 302
+ 288 0 } catch (ArchiveExtractionException ex) {
+ 289 0 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
+ 290 0 LOGGER.log(Level.WARNING, msg);
+ 291 0 LOGGER.log(Level.FINE, null , ex);
+ 292 0 } catch (IOException ex) {
+ 293 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+ 294 0 LOGGER.log(Level.WARNING, msg);
+ 295 0 LOGGER.log(Level.FINE, null , ex);
+ 296
} finally {
- 303 0 try {
- 304 0 fis.close();
- 305 0 } catch (IOException ex) {
- 306 0 LOGGER.log(Level.FINEST, null , ex);
- 307 0 }
- 308 0 }
- 309 0 }
- 310
+ 297 0 try {
+ 298 2 fis.close();
+ 299 0 } catch (IOException ex) {
+ 300 0 LOGGER.log(Level.FINEST, null , ex);
+ 301 2 }
+ 302 0 }
+ 303 2 }
+ 304
- 311
+ 305
- 312
+ 306
- 313
+ 307
- 314
+ 308
- 315
+ 309
- 316
+ 310
- 317
+ 311
- 318
+ 312
- 319
+ 313
private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
- 320
+ 314
ArchiveEntry entry;
- 321
+ 315
try {
- 322 0 while ((entry = input.getNextEntry()) != null ) {
- 323 0 if (entry.isDirectory()) {
- 324 0 final File d = new File(destination, entry.getName());
- 325 0 if (!d.exists()) {
- 326 0 if (!d.mkdirs()) {
- 327 0 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
- 328 0 throw new AnalysisException(msg);
- 329
+ 316 887 while ((entry = input.getNextEntry()) != null ) {
+ 317 885 if (entry.isDirectory()) {
+ 318 36 final File d = new File(destination, entry.getName());
+ 319 36 if (!d.exists()) {
+ 320 36 if (!d.mkdirs()) {
+ 321 0 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
+ 322 0 throw new AnalysisException(msg);
+ 323
}
+ 324
+ }
+ 325 36 } else {
+ 326 849 final File file = new File(destination, entry.getName());
+ 327 849 final String ext = FileUtils.getFileExtension(file.getName());
+ 328 849 if (engine.supportsExtension(ext)) {
+ 329 0 BufferedOutputStream bos = null ;
330
- }
- 331 0 } else {
- 332 0 final File file = new File(destination, entry.getName());
- 333 0 final String ext = FileUtils.getFileExtension(file.getName());
- 334 0 if (engine.supportsExtension(ext)) {
- 335 0 BufferedOutputStream bos = null ;
- 336
FileOutputStream fos;
- 337
+ 331
try {
- 338 0 final File parent = file.getParentFile();
- 339 0 if (!parent.isDirectory()) {
- 340 0 if (!parent.mkdirs()) {
- 341 0 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
- 342 0 throw new AnalysisException(msg);
- 343
+ 332 0 final File parent = file.getParentFile();
+ 333 0 if (!parent.isDirectory()) {
+ 334 0 if (!parent.mkdirs()) {
+ 335 0 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
+ 336 0 throw new AnalysisException(msg);
+ 337
}
- 344
+ 338
}
- 345 0 fos = new FileOutputStream(file);
- 346 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
- 347
+ 339 0 fos = new FileOutputStream(file);
+ 340 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 341
int count;
- 348 0 final byte data[] = new byte [BUFFER_SIZE];
- 349 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
- 350 0 bos.write(data, 0, count);
- 351
+ 342 0 final byte data[] = new byte [BUFFER_SIZE];
+ 343 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+ 344 0 bos.write(data, 0, count);
+ 345
}
- 352 0 bos.flush();
- 353 0 } catch (FileNotFoundException ex) {
- 354 0 Logger.getLogger(ArchiveAnalyzer.class
+ 346 0 bos.flush();
+ 347 0 } catch (FileNotFoundException ex) {
+ 348 0 LOGGER.log(Level.FINE, null , ex);
+ 349 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
+ 350 0 throw new AnalysisException(msg, ex);
+ 351 0 } catch (IOException ex) {
+ 352 0 LOGGER.log(Level.FINE, null , ex);
+ 353 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+ 354 0 throw new AnalysisException(msg, ex);
355
- .getName()).log(Level.FINE, null , ex);
- 356 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
- 357 0 throw new AnalysisException(msg, ex);
- 358 0 } catch (IOException ex) {
- 359 0 Logger.getLogger(ArchiveAnalyzer.class
- 360
- .getName()).log(Level.FINE, null , ex);
- 361 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
- 362 0 throw new AnalysisException(msg, ex);
- 363
} finally {
- 364 0 if (bos != null ) {
- 365
+ 356 0 if (bos != null ) {
+ 357
try {
- 366 0 bos.close();
- 367 0 } catch (IOException ex) {
- 368 0 Logger.getLogger(ArchiveAnalyzer.class
- 369
- .getName()).log(Level.FINEST, null , ex);
- 370 0 }
- 371
+ 358 0 bos.close();
+ 359 0 } catch (IOException ex) {
+ 360 0 LOGGER.log(Level.FINEST, null , ex);
+ 361 0 }
+ 362
}
- 372
+ 363
}
- 373
+ 364
}
- 374 0 }
- 375
+ 365 849 }
+ 366
}
- 376 0 } catch (IOException ex) {
- 377 0 throw new ArchiveExtractionException(ex);
- 378 0 } catch (Throwable ex) {
- 379 0 throw new ArchiveExtractionException(ex);
- 380
+ 367 0 } catch (IOException ex) {
+ 368 0 throw new ArchiveExtractionException(ex);
+ 369 0 } catch (Throwable ex) {
+ 370 0 throw new ArchiveExtractionException(ex);
+ 371
} finally {
- 381 0 if (input != null ) {
- 382
+ 372 2 if (input != null ) {
+ 373
try {
- 383 0 input.close();
- 384 0 } catch (IOException ex) {
- 385 0 LOGGER.log(Level.FINEST, null , ex);
- 386 0 }
- 387
+ 374 2 input.close();
+ 375 0 } catch (IOException ex) {
+ 376 0 LOGGER.log(Level.FINEST, null , ex);
+ 377 2 }
+ 378
}
- 388
+ 379
}
- 389 0 }
- 390
+ 380 2 }
+ 381
- 391
+ 382
- 392
+ 383
- 393
+ 384
- 394
+ 385
- 395
+ 386
- 396
+ 387
- 397
+ 388
- 398
+ 389
private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
- 399 0 FileOutputStream out = null ;
- 400
+ 390 0 FileOutputStream out = null ;
+ 391
try {
- 401 0 out = new FileOutputStream(outputFile);
- 402 0 final byte [] buffer = new byte [BUFFER_SIZE];
- 403 0 int n = 0;
- 404 0 while (-1 != (n = inputStream.read(buffer))) {
- 405 0 out.write(buffer, 0, n);
- 406
+ 392 0 out = new FileOutputStream(outputFile);
+ 393 0 final byte [] buffer = new byte [BUFFER_SIZE];
+ 394 0 int n = 0;
+ 395 0 while (-1 != (n = inputStream.read(buffer))) {
+ 396 0 out.write(buffer, 0, n);
+ 397
}
- 407 0 } catch (FileNotFoundException ex) {
- 408 0 LOGGER.log(Level.FINE, null , ex);
- 409 0 throw new ArchiveExtractionException(ex);
- 410 0 } catch (IOException ex) {
- 411 0 LOGGER.log(Level.FINE, null , ex);
- 412 0 throw new ArchiveExtractionException(ex);
- 413
+ 398 0 } catch (FileNotFoundException ex) {
+ 399 0 LOGGER.log(Level.FINE, null , ex);
+ 400 0 throw new ArchiveExtractionException(ex);
+ 401 0 } catch (IOException ex) {
+ 402 0 LOGGER.log(Level.FINE, null , ex);
+ 403 0 throw new ArchiveExtractionException(ex);
+ 404
} finally {
- 414 0 if (out != null ) {
- 415
+ 405 0 if (out != null ) {
+ 406
try {
- 416 0 out.close();
- 417 0 } catch (IOException ex) {
- 418 0 LOGGER.log(Level.FINEST, null , ex);
- 419 0 }
- 420
+ 407 0 out.close();
+ 408 0 } catch (IOException ex) {
+ 409 0 LOGGER.log(Level.FINEST, null , ex);
+ 410 0 }
+ 411
}
- 421
+ 412
}
- 422 0 }
- 423
+ 413 0 }
+ 414
}
-
+
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 16a6e1105..6f68ccb3d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
@@ -12,7 +12,7 @@
@@ -135,14 +135,14 @@
59
- 60 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 60 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
61
62
63
- 64 0 private static final Set<String> SUPORTED_EXTENSIONS = newHashSet("dll" , "exe" );
+ 64 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("dll" , "exe" );
65
66
@@ -165,7 +165,7 @@
75
- 76 0 private static final Logger LOG = Logger.getLogger(AssemblyAnalyzer.class .getName());
+ 76 1 private static final Logger LOGGER = Logger.getLogger(AssemblyAnalyzer.class .getName());
77
78
@@ -182,8 +182,8 @@
private List<String> buildArgumentList() {
84
- 85 0 final List<String> args = new ArrayList<String>();
- 86 0 if (!"\\" .equals(System.getProperty("file.separator" ))) {
+ 85 8 final List<String> args = new ArrayList<String>();
+ 86 8 if (!"\\" .equals(System.getProperty("file.separator" ))) {
87 0 if (Settings.getString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH) != null ) {
88 0 args.add(Settings.getString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH));
89
@@ -193,10 +193,10 @@
}
92
}
- 93 0 args.add(grokAssemblyExe.getPath());
+ 93 8 args.add(grokAssemblyExe.getPath());
94
- 95 0 return args;
+ 95 8 return args;
96
}
97
@@ -221,63 +221,63 @@
public void analyzeFileType(Dependency dependency, Engine engine)
107
throws AnalysisException {
- 108 0 if (grokAssemblyExe == null ) {
- 109 0 LOG.warning("GrokAssembly didn't get deployed" );
+ 108 3 if (grokAssemblyExe == null ) {
+ 109 0 LOGGER.warning("GrokAssembly didn't get deployed" );
110 0 return ;
111
}
112
- 113 0 final List<String> args = buildArgumentList();
- 114 0 args.add(dependency.getActualFilePath());
- 115 0 final ProcessBuilder pb = new ProcessBuilder(args);
- 116 0 BufferedReader rdr = null ;
+ 113 3 final List<String> args = buildArgumentList();
+ 114 3 args.add(dependency.getActualFilePath());
+ 115 3 final ProcessBuilder pb = new ProcessBuilder(args);
+ 116 3 BufferedReader rdr = null ;
117
try {
- 118 0 final Process proc = pb.start();
+ 118 3 final Process proc = pb.start();
119
- 120 0 rdr = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
- 121 0 String line = null ;
- 122 0 while (rdr.ready() && (line = rdr.readLine()) != null ) {
- 123 0 LOG.log(Level.WARNING, "Error from GrokAssembly: {0}" , line);
+ 120 3 rdr = new BufferedReader(new InputStreamReader(proc.getErrorStream(), "UTF-8" ));
+ 121 3 String line = null ;
+ 122 3 while (rdr.ready() && (line = rdr.readLine()) != null ) {
+ 123 0 LOGGER.log(Level.WARNING, "Error from GrokAssembly: {0}" , line);
124
}
- 125 0 int rc = 0;
- 126 0 final Document doc = builder.parse(proc.getInputStream());
- 127 0 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 125 3 int rc = 0;
+ 126 3 final Document doc = builder.parse(proc.getInputStream());
+ 127 3 final XPath xpath = XPathFactory.newInstance().newXPath();
128
129
- 130 0 final String error = xpath.evaluate("/assembly/error" , doc);
- 131 0 if (error != null && !"" .equals(error)) {
- 132 0 throw new AnalysisException(error);
+ 130 3 final String error = xpath.evaluate("/assembly/error" , doc);
+ 131 3 if (error != null && !"" .equals(error)) {
+ 132 1 throw new AnalysisException(error);
133
}
134
- 135 0 final String version = xpath.evaluate("/assembly/version" , doc);
- 136 0 if (version != null ) {
- 137 0 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
+ 135 2 final String version = xpath.evaluate("/assembly/version" , doc);
+ 136 2 if (version != null ) {
+ 137 2 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
138
version, Confidence.HIGHEST));
139
}
140
- 141 0 final String vendor = xpath.evaluate("/assembly/company" , doc);
- 142 0 if (vendor != null ) {
- 143 0 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
+ 141 2 final String vendor = xpath.evaluate("/assembly/company" , doc);
+ 142 2 if (vendor != null ) {
+ 143 2 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
144
vendor, Confidence.HIGH));
145
}
146
- 147 0 final String product = xpath.evaluate("/assembly/product" , doc);
- 148 0 if (product != null ) {
- 149 0 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
+ 147 2 final String product = xpath.evaluate("/assembly/product" , doc);
+ 148 2 if (product != null ) {
+ 149 2 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
150
product, Confidence.HIGH));
151
@@ -286,17 +286,17 @@
153
try {
- 154 0 rc = proc.waitFor();
+ 154 2 rc = proc.waitFor();
155 0 } catch (InterruptedException ie) {
156
return ;
- 157 0 }
- 158 0 if (rc == 3) {
- 159 0 LOG.log(Level.INFO, "{0} is not a valid assembly" , dependency.getActualFilePath());
+ 157 2 }
+ 158 2 if (rc == 3) {
+ 159 0 LOGGER.log(Level.INFO, "{0} is not a valid assembly" , dependency.getActualFilePath());
160
return ;
- 161 0 } else if (rc != 0) {
- 162 0 LOG.log(Level.WARNING, "Return code {0} from GrokAssembly" , rc);
+ 161 2 } else if (rc != 0) {
+ 162 0 LOGGER.log(Level.WARNING, "Return code {0} from GrokAssembly" , rc);
163
}
164
@@ -311,18 +311,18 @@
171 0 throw new AnalysisException(xpe);
172
} finally {
- 173 0 if (rdr != null ) {
+ 173 3 if (rdr != null ) {
174
try {
- 175 0 rdr.close();
+ 175 3 rdr.close();
176 0 } catch (IOException ex) {
- 177 0 Logger.getLogger(AssemblyAnalyzer.class .getName()).log(Level.FINEST, "ignore" , ex);
- 178 0 }
+ 177 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 178 4 }
179
}
180
}
- 181 0 }
+ 181 2 }
182
183
@@ -339,45 +339,45 @@
@Override
189
public void initializeFileTypeAnalyzer() throws Exception {
- 190 0 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
- 191 0 FileOutputStream fos = null ;
- 192 0 InputStream is = null ;
+ 190 5 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
+ 191 5 FileOutputStream fos = null ;
+ 192 5 InputStream is = null ;
193
try {
- 194 0 fos = new FileOutputStream(tempFile);
- 195 0 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
- 196 0 final byte [] buff = new byte [4096];
- 197 0 int bread = -1;
- 198 0 while ((bread = is.read(buff)) >= 0) {
- 199 0 fos.write(buff, 0, bread);
+ 194 5 fos = new FileOutputStream(tempFile);
+ 195 5 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
+ 196 5 final byte [] buff = new byte [4096];
+ 197 5 int bread = -1;
+ 198 15 while ((bread = is.read(buff)) >= 0) {
+ 199 10 fos.write(buff, 0, bread);
200
}
- 201 0 grokAssemblyExe = tempFile;
+ 201 5 grokAssemblyExe = tempFile;
202
- 203 0 grokAssemblyExe.deleteOnExit();
- 204 0 LOG.log(Level.FINE, "Extracted GrokAssembly.exe to {0}" , grokAssemblyExe.getPath());
+ 203 5 grokAssemblyExe.deleteOnExit();
+ 204 5 LOGGER.log(Level.FINE, "Extracted GrokAssembly.exe to {0}" , grokAssemblyExe.getPath());
205 0 } catch (IOException ioe) {
- 206 0 LOG.log(Level.WARNING, "Could not extract GrokAssembly.exe: {0}" , ioe.getMessage());
+ 206 0 LOGGER.log(Level.WARNING, "Could not extract GrokAssembly.exe: {0}" , ioe.getMessage());
207 0 throw new AnalysisException("Could not extract GrokAssembly.exe" , ioe);
208
} finally {
- 209 0 if (fos != null ) {
+ 209 5 if (fos != null ) {
210
try {
- 211 0 fos.close();
+ 211 5 fos.close();
212 0 } catch (Throwable e) {
- 213 0 LOG.fine("Error closing output stream" );
- 214 0 }
+ 213 0 LOGGER.fine("Error closing output stream" );
+ 214 5 }
215
}
- 216 0 if (is != null ) {
+ 216 5 if (is != null ) {
217
try {
- 218 0 is.close();
+ 218 5 is.close();
219 0 } catch (Throwable e) {
- 220 0 LOG.fine("Error closing input stream" );
- 221 0 }
+ 220 0 LOGGER.fine("Error closing input stream" );
+ 221 5 }
222
}
223
@@ -386,152 +386,156 @@
225
- 226 0 final List<String> args = buildArgumentList();
- 227 0 BufferedReader rdr = null ;
+ 226 5 final List<String> args = buildArgumentList();
+ 227 5 BufferedReader rdr = null ;
228
try {
- 229 0 final ProcessBuilder pb = new ProcessBuilder(args);
- 230 0 final Process p = pb.start();
+ 229 5 final ProcessBuilder pb = new ProcessBuilder(args);
+ 230 5 final Process p = pb.start();
231
- 232 0 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
- 233
- String line;
- 234 0 while (rdr.ready() && (line = rdr.readLine()) != null ) {
- 235
+ 232 5 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream(), "UTF-8" ));
+ 233 5 while (rdr.ready() && rdr.readLine() != null ) {
+ 234
- 236
+ 235
}
- 237 0 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
- 238 0 final XPath xpath = XPathFactory.newInstance().newXPath();
- 239 0 final String error = xpath.evaluate("/assembly/error" , doc);
- 240 0 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
- 241 0 LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details." );
- 242 0 LOG.fine("GrokAssembly.exe is not working properly" );
- 243 0 grokAssemblyExe = null ;
- 244 0 throw new AnalysisException("Could not execute .NET AssemblyAnalyzer" );
- 245
+ 236 5 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
+ 237 5 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 238 5 final String error = xpath.evaluate("/assembly/error" , doc);
+ 239 5 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
+ 240 0 LOGGER.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details." );
+ 241 0 LOGGER.fine("GrokAssembly.exe is not working properly" );
+ 242 0 grokAssemblyExe = null ;
+ 243 0 throw new AnalysisException("Could not execute .NET AssemblyAnalyzer" );
+ 244
}
- 246 0 } catch (Throwable e) {
- 247 0 LOG.warning("An error occured with the .NET AssemblyAnalyzer; "
+ 245 0 } catch (Throwable e) {
+ 246 0 if (e instanceof AnalysisException) {
+ 247 0 throw (AnalysisException) e;
248
- + "this can be ignored unless you are scanning .NET dlls. Please see the log for more details." );
- 249 0 LOG.log(Level.FINE, "Could not execute GrokAssembly {0}" , e.getMessage());
- 250 0 throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer" , e);
- 251
- } finally {
- 252 0 if (rdr != null ) {
+ } else {
+ 249 0 LOGGER.warning("An error occured with the .NET AssemblyAnalyzer; "
+ 250
+ + "this can be ignored unless you are scanning .NET DLLs. Please see the log for more details." );
+ 251 0 LOGGER.log(Level.FINE, "Could not execute GrokAssembly {0}" , e.getMessage());
+ 252 0 throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer" , e);
253
- try {
- 254 0 rdr.close();
- 255 0 } catch (IOException ex) {
- 256 0 Logger.getLogger(AssemblyAnalyzer.class .getName()).log(Level.FINEST, "ignore" , ex);
- 257 0 }
- 258
}
- 259
+ 254
+ } finally {
+ 255 5 if (rdr != null ) {
+ 256
+ try {
+ 257 5 rdr.close();
+ 258 0 } catch (IOException ex) {
+ 259 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 260 5 }
+ 261
+ }
+ 262
}
- 260
-
- 261 0 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- 262 0 }
263
- 264
- @Override
- 265
- public void close() throws Exception {
- 266 0 super .close();
+ 264 5 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ 265 5 }
+ 266
+
267
- try {
- 268 0 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
- 269 0 grokAssemblyExe.deleteOnExit();
+ @Override
+ 268
+ public void close() throws Exception {
+ 269 6 super .close();
270
+ try {
+ 271 6 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
+ 272 0 grokAssemblyExe.deleteOnExit();
+ 273
}
- 271 0 } catch (SecurityException se) {
- 272 0 LOG.fine("Can't delete temporary GrokAssembly.exe" );
- 273 0 }
- 274 0 }
- 275
-
- 276
-
- 277
-
+ 274 0 } catch (SecurityException se) {
+ 275 0 LOGGER.fine("Can't delete temporary GrokAssembly.exe" );
+ 276 6 }
+ 277 6 }
278
-
+
279
-
+
280
-
+
281
- @Override
+
282
- public Set<String> getSupportedExtensions() {
- 283 0 return SUPORTED_EXTENSIONS;
+
+ 283
+
284
- }
+ @Override
285
-
- 286
-
+ public Set<String> getSupportedExtensions() {
+ 286 853 return SUPPORTED_EXTENSIONS;
287
-
+ }
288
-
+
289
-
+
290
-
+
291
- @Override
+
292
- public String getName() {
- 293 0 return ANALYZER_NAME;
+
+ 293
+
294
- }
+ @Override
295
-
- 296
-
+ public String getName() {
+ 296 5 return ANALYZER_NAME;
297
-
+ }
298
-
- 299
-
- 300
-
- 301
- @Override
- 302
- public AnalysisPhase getAnalysisPhase() {
- 303 0 return ANALYSIS_PHASE;
- 304
- }
- 305
- 306
+ 299
- 307
-
- 308
+ 300
+
+ 301
- 309
-
- 310
+ 302
+
+ 303
- 311
+ 304
@Override
- 312
- protected String getAnalyzerEnabledSettingKey() {
- 313 0 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
- 314
+ 305
+ public AnalysisPhase getAnalysisPhase() {
+ 306 1 return ANALYSIS_PHASE;
+ 307
}
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
+ 313
+
+ 314
+ @Override
315
+ protected String getAnalyzerEnabledSettingKey() {
+ 316 7 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
+ 317
+ }
+ 318
}
-
+
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 0e027591c..ef5569a4c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
@@ -12,9 +12,9 @@
@@ -138,1161 +138,1166 @@
59
public class CPEAnalyzer implements Analyzer {
60
-
+
61
-
+
62
-
- 63
+ 63 1 private static final Logger LOGGER = Logger.getLogger(CPEAnalyzer.class .getName());
64
- static final int MAX_QUERY_RESULTS = 25;
+
65
-
+
66
-
+
67
-
+ static final int MAX_QUERY_RESULTS = 25;
68
- static final String WEIGHTING_BOOST = "^5" ;
+
69
-
+
70
-
+
71
-
+ static final String WEIGHTING_BOOST = "^5" ;
72
- static final String CLEANSE_CHARACTER_RX = "[^A-Za-z0-9 ._-]" ;
+
73
-
+
74
-
+
75
-
+ static final String CLEANSE_CHARACTER_RX = "[^A-Za-z0-9 ._-]" ;
76
- static final String CLEANSE_NONALPHA_RX = "[^A-Za-z]*" ;
+
77
-
+
78
-
+
79
-
+ static final String CLEANSE_NONALPHA_RX = "[^A-Za-z]*" ;
80
- static final int STRING_BUILDER_BUFFER = 20;
+
81
-
+
82
-
+
83
-
+ static final int STRING_BUILDER_BUFFER = 20;
84
- private CpeMemoryIndex cpe;
+
85
-
+
86
-
+
87
-
+ private CpeMemoryIndex cpe;
88
- private CveDB cve;
+
89
-
+
90
-
+
91
-
+ private CveDB cve;
92
-
+
93
-
+
94
-
+
95
- @Override
+
96
- public String getName() {
- 97 0 return "CPE Analyzer" ;
+
+ 97
+
98
- }
+ @Override
99
-
- 100
-
+ public String getName() {
+ 100 4 return "CPE Analyzer" ;
101
-
- 102
-
- 103
-
- 104
-
- 105
- @Override
- 106
- public AnalysisPhase getAnalysisPhase() {
- 107 0 return AnalysisPhase.IDENTIFIER_ANALYSIS;
- 108
}
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+ @Override
109
-
- 110
-
+ public AnalysisPhase getAnalysisPhase() {
+ 110 1 return AnalysisPhase.IDENTIFIER_ANALYSIS;
111
-
+ }
112
-
+
113
-
+
114
-
+
115
- @Override
- 116
- public void initialize() throws Exception {
- 117 0 this .open();
- 118 0 }
- 119
-
- 120
-
- 121
-
- 122
- 123
-
- 124
-
- 125
-
- 126
+ 116
+
+ 117
- 127
- public void open() throws IOException, DatabaseException {
- 128 0 Logger.getLogger(CPEAnalyzer.class .getName()).log(Level.FINE, "Opening the CVE Database" );
- 129 0 cve = new CveDB();
- 130 0 cve.open();
- 131 0 Logger.getLogger(CPEAnalyzer.class .getName()).log(Level.FINE, "Creating the Lucene CPE Index" );
- 132 0 cpe = CpeMemoryIndex.getInstance();
- 133
- try {
- 134 0 cpe.open(cve);
- 135 0 } catch (IndexException ex) {
- 136 0 Logger.getLogger(CPEAnalyzer.class .getName()).log(Level.FINE, "IndexException" , ex);
- 137 0 throw new DatabaseException(ex);
- 138 0 }
- 139 0 }
- 140
-
- 141
-
- 142
-
- 143
-
- 144
+ 118
@Override
+ 119
+ public void initialize() throws Exception {
+ 120 1 this .open();
+ 121 1 }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+ public void open() throws IOException, DatabaseException {
+ 131 1 LOGGER.log(Level.FINE, "Opening the CVE Database" );
+ 132 1 cve = new CveDB();
+ 133 1 cve.open();
+ 134 1 LOGGER.log(Level.FINE, "Creating the Lucene CPE Index" );
+ 135 1 cpe = CpeMemoryIndex.getInstance();
+ 136
+ try {
+ 137 1 cpe.open(cve);
+ 138 0 } catch (IndexException ex) {
+ 139 0 LOGGER.log(Level.FINE, "IndexException" , ex);
+ 140 0 throw new DatabaseException(ex);
+ 141 1 }
+ 142 1 }
+ 143
+
+ 144
+
145
- public void close() {
- 146 0 if (cpe != null ) {
- 147 0 cpe.close();
+
+ 146
+
+ 147
+ @Override
148
- }
- 149 0 if (cve != null ) {
- 150 0 cve.close();
+ public void close() {
+ 149 1 if (cpe != null ) {
+ 150 1 cpe.close();
151
}
- 152 0 }
- 153
-
+ 152 1 if (cve != null ) {
+ 153 1 cve.close();
154
-
- 155
-
+ }
+ 155 1 }
156
-
+
157
-
+
158
-
+
159
-
+
160
-
+
161
-
+
162
-
+
163
- protected void determineCPE(Dependency dependency) throws CorruptIndexException, IOException, ParseException {
- 164 0 Confidence confidence = Confidence.HIGHEST;
+
+ 164
+
165
-
- 166 0 String vendors = addEvidenceWithoutDuplicateTerms("" , dependency.getVendorEvidence(), confidence);
- 167 0 String products = addEvidenceWithoutDuplicateTerms("" , dependency.getProductEvidence(), confidence);
+
+ 166
+ protected void determineCPE(Dependency dependency) throws CorruptIndexException, IOException, ParseException {
+ 167 2 Confidence confidence = Confidence.HIGHEST;
168
-
- 169
-
- 170 0 addEvidenceWithoutDuplicateTerms("" , dependency.getVersionEvidence(), confidence);
+
+ 169 2 String vendors = addEvidenceWithoutDuplicateTerms("" , dependency.getVendorEvidence(), confidence);
+ 170 2 String products = addEvidenceWithoutDuplicateTerms("" , dependency.getProductEvidence(), confidence);
171
+
+ 172
+
+ 173 2 addEvidenceWithoutDuplicateTerms("" , dependency.getVersionEvidence(), confidence);
+ 174
- 172 0 int ctr = 0;
- 173
- do {
- 174 0 if (!vendors.isEmpty() && !products.isEmpty()) {
- 175 0 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
+ 175 2 int ctr = 0;
176
+ do {
+ 177 8 if (!vendors.isEmpty() && !products.isEmpty()) {
+ 178 8 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
+ 179
dependency.getVendorEvidence().getWeighting());
- 177
+ 180
- 178 0 for (IndexEntry e : entries) {
- 179 0 if (verifyEntry(e, dependency)) {
- 180 0 final String vendor = e.getVendor();
- 181 0 final String product = e.getProduct();
- 182 0 determineIdentifiers(dependency, vendor, product);
- 183
+ 181 8 for (IndexEntry e : entries) {
+ 182 54 if (verifyEntry(e, dependency)) {
+ 183 4 final String vendor = e.getVendor();
+ 184 4 final String product = e.getProduct();
+ 185 4 determineIdentifiers(dependency, vendor, product);
+ 186
}
- 184 0 }
- 185
+ 187 54 }
+ 188
}
- 186 0 confidence = reduceConfidence(confidence);
- 187 0 if (dependency.getVendorEvidence().contains(confidence)) {
- 188 0 vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), confidence);
- 189
- }
- 190 0 if (dependency.getProductEvidence().contains(confidence)) {
- 191 0 products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), confidence);
+ 189 8 confidence = reduceConfidence(confidence);
+ 190 8 if (dependency.getVendorEvidence().contains(confidence)) {
+ 191 8 vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), confidence);
192
}
- 193
+ 193 8 if (dependency.getProductEvidence().contains(confidence)) {
+ 194 7 products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), confidence);
+ 195
+ }
+ 196
- 194
-
- 195 0 if (dependency.getVersionEvidence().contains(confidence)) {
- 196 0 addEvidenceWithoutDuplicateTerms("" , dependency.getVersionEvidence(), confidence);
197
- }
- 198 0 } while ((++ctr) < 4);
- 199 0 }
+
+ 198 8 if (dependency.getVersionEvidence().contains(confidence)) {
+ 199 6 addEvidenceWithoutDuplicateTerms("" , dependency.getVersionEvidence(), confidence);
200
-
- 201
-
- 202
-
- 203
-
- 204
-
- 205
-
- 206
-
- 207
-
- 208
-
- 209
-
- 210
-
- 211
- private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
- 212 0 final String txt = (text == null ) ? "" : text;
- 213 0 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
- 214 0 sb.append(' ' ).append(txt).append(' ' );
- 215 0 for (Evidence e : ec.iterator(confidenceFilter)) {
- 216 0 String value = e.getValue();
- 217
-
- 218
-
- 219
-
- 220 0 if (value.startsWith("http://" )) {
- 221 0 value = value.substring(7).replaceAll("\\." , " " );
- 222
}
- 223 0 if (value.startsWith("https://" )) {
- 224 0 value = value.substring(8).replaceAll("\\." , " " );
+ 201 8 } while ((++ctr) < 4);
+ 202 2 }
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+ private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
+ 215 27 final String txt = (text == null ) ? "" : text;
+ 216 27 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
+ 217 27 sb.append(' ' ).append(txt).append(' ' );
+ 218 27 for (Evidence e : ec.iterator(confidenceFilter)) {
+ 219 76 String value = e.getValue();
+ 220
+
+ 221
+
+ 222
+
+ 223 76 if (value.startsWith("http://" )) {
+ 224 4 value = value.substring(7).replaceAll("\\." , " " );
225
}
- 226 0 if (sb.indexOf(" " + value + " " ) < 0) {
- 227 0 sb.append(value).append(' ' );
+ 226 76 if (value.startsWith("https://" )) {
+ 227 0 value = value.substring(8).replaceAll("\\." , " " );
228
}
- 229 0 }
- 230 0 return sb.toString().trim();
+ 229 76 if (sb.indexOf(" " + value + " " ) < 0) {
+ 230 48 sb.append(value).append(' ' );
231
- }
- 232
-
- 233
-
- 234
-
- 235
-
- 236
-
- 237
-
- 238
-
- 239
- private Confidence reduceConfidence(final Confidence c) {
- 240 0 if (c == Confidence.HIGHEST) {
- 241 0 return Confidence.HIGH;
- 242 0 } else if (c == Confidence.HIGH) {
- 243 0 return Confidence.MEDIUM;
- 244
- } else {
- 245 0 return Confidence.LOW;
- 246
- }
- 247
- }
- 248
-
- 249
-
- 250
-
- 251
-
- 252
-
- 253
-
- 254
-
- 255
-
- 256
-
- 257
-
- 258
-
- 259
-
- 260
-
- 261
-
- 262
-
- 263
-
- 264
-
- 265
-
- 266
-
- 267
- protected List<IndexEntry> searchCPE(String vendor, String product,
- 268
- Set<String> vendorWeightings, Set<String> productWeightings)
- 269
- throws CorruptIndexException, IOException, ParseException {
- 270 0 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
- 271
-
- 272 0 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
- 273 0 if (searchString == null ) {
- 274 0 return ret;
- 275
- }
- 276
-
- 277 0 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
- 278 0 for (ScoreDoc d : docs.scoreDocs) {
- 279 0 if (d.score >= 0.08) {
- 280 0 final Document doc = cpe.getDocument(d.doc);
- 281 0 final IndexEntry entry = new IndexEntry();
- 282 0 entry.setVendor(doc.get(Fields.VENDOR));
- 283 0 entry.setProduct(doc.get(Fields.PRODUCT));
- 284
-
- 285
-
- 286
-
- 287
-
- 288
-
- 289
-
- 290
-
- 291 0 entry.setSearchScore(d.score);
- 292 0 if (!ret.contains(entry)) {
- 293 0 ret.add(entry);
- 294
- }
- 295
}
- 296
- }
- 297 0 return ret;
- 298
+ 232 76 }
+ 233 27 return sb.toString().trim();
+ 234
}
- 299
+ 235
- 300
+ 236
- 301
-
- 302
-
- 303
+ 237
+
+ 238
+ 239
+
+ 240
+
+ 241
+
+ 242
+ private Confidence reduceConfidence(final Confidence c) {
+ 243 8 if (c == Confidence.HIGHEST) {
+ 244 2 return Confidence.HIGH;
+ 245 6 } else if (c == Confidence.HIGH) {
+ 246 2 return Confidence.MEDIUM;
+ 247
+ } else {
+ 248 4 return Confidence.LOW;
+ 249
+ }
+ 250
+ }
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+ protected List<IndexEntry> searchCPE(String vendor, String product,
+ 271
+ Set<String> vendorWeightings, Set<String> productWeightings)
+ 272
+ throws CorruptIndexException, IOException, ParseException {
+ 273 8 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
+ 274
+
+ 275 8 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
+ 276 8 if (searchString == null ) {
+ 277 0 return ret;
+ 278
+ }
+ 279
+
+ 280 8 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
+ 281 208 for (ScoreDoc d : docs.scoreDocs) {
+ 282 200 if (d.score >= 0.08) {
+ 283 54 final Document doc = cpe.getDocument(d.doc);
+ 284 54 final IndexEntry entry = new IndexEntry();
+ 285 54 entry.setVendor(doc.get(Fields.VENDOR));
+ 286 54 entry.setProduct(doc.get(Fields.PRODUCT));
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294 54 entry.setSearchScore(d.score);
+ 295 54 if (!ret.contains(entry)) {
+ 296 54 ret.add(entry);
+ 297
+ }
+ 298
+ }
+ 299
+ }
+ 300 8 return ret;
+ 301
+ }
+ 302
+
+ 303
+
304
305
-
+
306
-
+
307
-
+
308
-
+
309
-
+
310
-
+
311
-
+
312
-
+
313
-
+
314
- protected String buildSearch(String vendor, String product,
+
315
+
+ 316
+
+ 317
+ protected String buildSearch(String vendor, String product,
+ 318
Set<String> vendorWeighting, Set<String> productWeightings) {
- 316 0 final String v = vendor;
- 317 0 final String p = product;
- 318 0 final StringBuilder sb = new StringBuilder(v.length() + p.length()
- 319
+ 319 8 final String v = vendor;
+ 320 8 final String p = product;
+ 321 8 final StringBuilder sb = new StringBuilder(v.length() + p.length()
+ 322
+ Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
- 320
-
- 321 0 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
- 322 0 return null ;
323
+
+ 324 8 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
+ 325 0 return null ;
+ 326
}
- 324 0 sb.append(" AND " );
- 325 0 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
- 326 0 return null ;
- 327
- }
- 328 0 return sb.toString();
- 329
- }
+ 327 8 sb.append(" AND " );
+ 328 8 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
+ 329 0 return null ;
330
-
- 331
-
+ }
+ 331 8 return sb.toString();
332
-
+ }
333
-
+
334
-
+
335
-
+
336
-
+
337
-
+
338
-
+
339
-
+
340
-
+
341
-
+
342
- private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
- 343 0 sb.append(" " ).append(field).append(":( " );
+
+ 343
+
344
+
+ 345
+ private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
+ 346 16 sb.append(" " ).append(field).append(":( " );
+ 347
- 345 0 final String cleanText = cleanseText(searchText);
- 346
-
- 347 0 if ("" .equals(cleanText)) {
- 348 0 return false ;
+ 348 16 final String cleanText = cleanseText(searchText);
349
- }
- 350
- 351 0 if (weightedText == null || weightedText.isEmpty()) {
- 352 0 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+ 350 16 if ("" .equals(cleanText)) {
+ 351 0 return false ;
+ 352
+ }
353
+
+ 354 16 if (weightedText == null || weightedText.isEmpty()) {
+ 355 0 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+ 356
} else {
- 354 0 final StringTokenizer tokens = new StringTokenizer(cleanText);
- 355 0 while (tokens.hasMoreElements()) {
- 356 0 final String word = tokens.nextToken();
- 357 0 String temp = null ;
- 358 0 for (String weighted : weightedText) {
- 359 0 final String weightedStr = cleanseText(weighted);
- 360 0 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
- 361 0 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
- 362 0 if (!word.equalsIgnoreCase(weightedStr)) {
- 363 0 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
- 364
+ 357 16 final StringTokenizer tokens = new StringTokenizer(cleanText);
+ 358 240 while (tokens.hasMoreElements()) {
+ 359 224 final String word = tokens.nextToken();
+ 360 224 String temp = null ;
+ 361 224 for (String weighted : weightedText) {
+ 362 408 final String weightedStr = cleanseText(weighted);
+ 363 408 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
+ 364 30 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
+ 365 30 if (!word.equalsIgnoreCase(weightedStr)) {
+ 366 0 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
+ 367
}
- 365
+ 368
}
- 366 0 }
- 367 0 if (temp == null ) {
- 368 0 temp = LuceneUtils.escapeLuceneQuery(word);
- 369
- }
- 370 0 sb.append(" " ).append(temp);
- 371 0 }
+ 369 408 }
+ 370 224 if (temp == null ) {
+ 371 194 temp = LuceneUtils.escapeLuceneQuery(word);
372
- }
- 373 0 sb.append(" ) " );
- 374 0 return true ;
+ }
+ 373 224 sb.append(" " ).append(temp);
+ 374 224 }
375
- }
- 376
-
- 377
-
+ }
+ 376 16 sb.append(" ) " );
+ 377 16 return true ;
378
-
+ }
379
-
+
380
-
+
381
-
+
382
-
+
383
- private String cleanseText(String text) {
- 384 0 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
+
+ 384
+
385
- }
+
386
-
- 387
-
+ private String cleanseText(String text) {
+ 387 424 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
388
-
+ }
389
-
+
390
-
+
391
-
+
392
-
+
393
-
+
394
- private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
- 395 0 if (l == null || r == null ) {
- 396 0 return false ;
+
+ 395
+
+ 396
+
397
+ private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
+ 398 408 if (l == null || r == null ) {
+ 399 0 return false ;
+ 400
}
- 398
+ 401
- 399 0 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 400 0 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 401 0 return left.equalsIgnoreCase(right);
- 402
- }
- 403
-
- 404
-
+ 402 408 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 403 408 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 404 408 return left.equalsIgnoreCase(right);
405
-
+ }
406
-
+
407
-
+
408
-
+
409
-
+
410
-
+
411
-
+
412
- private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
- 413 0 boolean isValid = false ;
+
+ 413
+
414
-
- 415 0 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
- 416
- && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
+
+ 415
+ private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
+ 416 54 boolean isValid = false ;
417
-
- 418 0 isValid = true ;
+
+ 418 54 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
419
- }
- 420 0 return isValid;
- 421
- }
+ && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
+ 420
+
+ 421 4 isValid = true ;
422
-
- 423
-
+ }
+ 423 54 return isValid;
424
-
+ }
425
-
+
426
-
+
427
-
+
428
-
+
429
-
+
430
- private boolean collectionContainsString(EvidenceCollection ec, String text) {
+
431
-
+
432
-
+
433
-
+ private boolean collectionContainsString(EvidenceCollection ec, String text) {
434
-
+
435
-
+
436
-
+
437
-
+
438
-
+
439
-
+
440
-
+
441
-
+
442
-
- 443 0 if (text == null ) {
- 444 0 return false ;
- 445
- }
- 446 0 final String[] words = text.split("[\\s_-]" );
- 447 0 final List<String> list = new ArrayList<String>();
- 448 0 String tempWord = null ;
- 449 0 for (String word : words) {
- 450
-
- 451
-
- 452
-
- 453
-
- 454 0 if (tempWord != null ) {
- 455 0 list.add(tempWord + word);
- 456 0 tempWord = null ;
- 457 0 } else if (word.length() <= 2) {
- 458 0 tempWord = word;
- 459
- } else {
- 460 0 list.add(word);
- 461
- }
- 462
- }
- 463 0 if (tempWord != null && !list.isEmpty()) {
- 464 0 final String tmp = list.get(list.size() - 1) + tempWord;
- 465 0 list.add(tmp);
- 466
- }
- 467 0 boolean contains = true ;
- 468 0 for (String word : list) {
- 469 0 contains &= ec.containsUsedString(word);
- 470 0 }
- 471 0 return contains;
- 472
- }
- 473
-
- 474
-
- 475
-
- 476
-
- 477
-
- 478
-
- 479
-
- 480
-
- 481
- @Override
- 482
- public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 483
- try {
- 484 0 determineCPE(dependency);
- 485 0 } catch (CorruptIndexException ex) {
- 486 0 throw new AnalysisException("CPE Index is corrupt." , ex);
- 487 0 } catch (IOException ex) {
- 488 0 throw new AnalysisException("Failure opening the CPE Index." , ex);
- 489 0 } catch (ParseException ex) {
- 490 0 throw new AnalysisException("Unable to parse the generated Lucene query for this dependency." , ex);
- 491 0 }
- 492 0 }
- 493
-
- 494
-
- 495
-
- 496
-
- 497
-
- 498
-
- 499
-
- 500
-
- 501
-
- 502
-
- 503
-
- 504
- private void determineIdentifiers(Dependency dependency, String vendor, String product) throws UnsupportedEncodingException {
- 505 0 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
- 506 0 DependencyVersion bestGuess = new DependencyVersion("-" );
- 507 0 Confidence bestGuessConf = null ;
- 508 0 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
- 509 0 for (Confidence conf : Confidence.values()) {
- 510 0 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
- 511 0 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
- 512 0 if (evVer == null ) {
- 513 0 continue ;
- 514
- }
- 515 0 for (VulnerableSoftware vs : cpes) {
- 516
- DependencyVersion dbVer;
- 517 0 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
- 518 0 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
- 519
- } else {
- 520 0 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
- 521
- }
- 522 0 if (dbVer == null
- 523
- || evVer.equals(dbVer)) {
- 524 0 final String url = String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(vs.getName(), "UTF-8" ));
- 525 0 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
- 526 0 collected.add(match);
- 527 0 } else {
- 528
-
- 529 0 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
- 530
- && evVer.matchesAtLeastThreeLevels(dbVer)) {
- 531 0 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
- 532 0 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
- 533 0 bestGuess = dbVer;
- 534 0 bestGuessConf = conf;
- 535
- }
- 536
- }
- 537
- }
- 538
- }
- 539 0 }
- 540 0 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
- 541 0 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
- 542 0 bestGuess = evVer;
- 543 0 bestGuessConf = conf;
- 544
- }
- 545
- }
- 546 0 }
- 547
- }
- 548 0 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
- 549 0 final String url = null ;
- 550 0 if (bestGuessConf == null ) {
- 551 0 bestGuessConf = Confidence.LOW;
- 552
- }
- 553 0 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
- 554 0 collected.add(match);
- 555
-
- 556 0 Collections.sort(collected);
- 557 0 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
- 558 0 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
- 559 0 for (IdentifierMatch m : collected) {
- 560 0 if (bestIdentifierQuality.equals(m.getConfidence())
- 561
- && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
- 562 0 final Identifier i = m.getIdentifier();
- 563 0 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
- 564 0 i.setConfidence(Confidence.LOW);
- 565
- } else {
- 566 0 i.setConfidence(bestEvidenceQuality);
- 567
- }
- 568 0 dependency.addIdentifier(i);
- 569
- }
- 570 0 }
- 571 0 }
- 572
-
- 573
-
- 574
-
- 575
-
- 576 0 private enum IdentifierConfidence {
- 577
-
- 578
-
- 579
-
- 580
-
- 581 0 EXACT_MATCH,
- 582
-
- 583
-
- 584
-
- 585 0 BEST_GUESS
- 586
- }
- 587
-
- 588
-
- 589
-
- 590
-
- 591 0 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
- 592
-
- 593
-
- 594
-
- 595
-
- 596
-
- 597
-
- 598
-
- 599
-
- 600
-
- 601
-
- 602 0 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
- 603 0 this .identifier = new Identifier(type, value, url);
- 604 0 this .confidence = identifierConfidence;
- 605 0 this .evidenceConfidence = evidenceConfidence;
- 606 0 }
- 607
-
- 608
-
- 609
-
- 610
-
- 611
- private Confidence evidenceConfidence;
- 612
-
- 613
-
- 614
-
- 615
-
- 616
-
- 617
-
- 618
- public Confidence getEvidenceConfidence() {
- 619
- return evidenceConfidence;
- 620
- }
- 621
-
- 622
-
- 623
-
- 624
-
- 625
-
- 626
-
- 627
- public void setEvidenceConfidence(Confidence evidenceConfidence) {
- 628
- this .evidenceConfidence = evidenceConfidence;
- 629
- }
- 630
-
- 631
-
- 632
-
- 633
- private IdentifierConfidence confidence;
- 634
-
- 635
-
- 636
-
- 637
-
- 638
-
- 639
-
- 640
- public IdentifierConfidence getConfidence() {
- 641
- return confidence;
- 642
- }
- 643
-
- 644
-
- 645
-
- 646
-
- 647
-
- 648
-
- 649
- public void setConfidence(IdentifierConfidence confidence) {
- 650
- this .confidence = confidence;
- 651
- }
- 652
-
- 653
-
- 654
-
- 655
- private Identifier identifier;
- 656
-
- 657
-
- 658
-
- 659
-
- 660
-
- 661
-
- 662
- public Identifier getIdentifier() {
- 663
- return identifier;
- 664
- }
- 665
-
- 666
-
- 667
-
- 668
-
- 669
-
- 670
-
- 671
- public void setIdentifier(Identifier identifier) {
- 672
- this .identifier = identifier;
- 673
- }
- 674
+
+ 443
+
+ 444
- 675
-
- 676
-
- 677
-
- 678
-
- 679
-
- 680
-
- 681
-
- 682
- @Override
- 683
- public String toString() {
- 684 0 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
- 685
- + ", confidence=" + confidence + ", identifier=" + identifier + '}' ;
- 686
+ 445
+
+ 446 59 if (text == null ) {
+ 447 0 return false ;
+ 448
}
- 687
-
- 688
-
- 689
-
- 690
-
- 691
-
- 692
-
- 693
- @Override
- 694
- public int hashCode() {
- 695 0 int hash = 5;
- 696 0 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
- 697 0 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
- 698 0 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
- 699 0 return hash;
- 700
- }
- 701
-
- 702
-
- 703
-
- 704
-
- 705
-
- 706
-
- 707
-
- 708
- @Override
- 709
- public boolean equals(Object obj) {
- 710 0 if (obj == null ) {
- 711 0 return false ;
- 712
+ 449 59 final String[] words = text.split("[\\s_-]" );
+ 450 59 final List<String> list = new ArrayList<String>();
+ 451 59 String tempWord = null ;
+ 452 174 for (String word : words) {
+ 453
+
+ 454
+
+ 455
+
+ 456
+
+ 457 115 if (tempWord != null ) {
+ 458 4 list.add(tempWord + word);
+ 459 4 tempWord = null ;
+ 460 111 } else if (word.length() <= 2) {
+ 461 4 tempWord = word;
+ 462
+ } else {
+ 463 107 list.add(word);
+ 464
}
- 713 0 if (getClass() != obj.getClass()) {
+ 465
+ }
+ 466 59 if (tempWord != null && !list.isEmpty()) {
+ 467 0 final String tmp = list.get(list.size() - 1) + tempWord;
+ 468 0 list.add(tmp);
+ 469
+ }
+ 470 59 boolean contains = true ;
+ 471 59 for (String word : list) {
+ 472 111 contains &= ec.containsUsedString(word);
+ 473 111 }
+ 474 59 return contains;
+ 475
+ }
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+ @Override
+ 485
+ public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+ 486
+ try {
+ 487 2 determineCPE(dependency);
+ 488 0 } catch (CorruptIndexException ex) {
+ 489 0 throw new AnalysisException("CPE Index is corrupt." , ex);
+ 490 0 } catch (IOException ex) {
+ 491 0 throw new AnalysisException("Failure opening the CPE Index." , ex);
+ 492 0 } catch (ParseException ex) {
+ 493 0 throw new AnalysisException("Unable to parse the generated Lucene query for this dependency." , ex);
+ 494 2 }
+ 495 2 }
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+
+ 501
+
+ 502
+
+ 503
+
+ 504
+
+ 505
+
+ 506
+
+ 507
+ private void determineIdentifiers(Dependency dependency, String vendor, String product) throws UnsupportedEncodingException {
+ 508 4 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
+ 509 4 DependencyVersion bestGuess = new DependencyVersion("-" );
+ 510 4 Confidence bestGuessConf = null ;
+ 511 4 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
+ 512 20 for (Confidence conf : Confidence.values()) {
+ 513 16 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
+ 514 16 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
+ 515 16 if (evVer == null ) {
+ 516 0 continue ;
+ 517
+ }
+ 518 16 for (VulnerableSoftware vs : cpes) {
+ 519
+ DependencyVersion dbVer;
+ 520 240 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
+ 521 72 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
+ 522
+ } else {
+ 523 168 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
+ 524
+ }
+ 525 240 if (dbVer == null
+ 526
+ || evVer.equals(dbVer)) {
+ 527 16 final String url = String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(vs.getName(), "UTF-8" ));
+ 528 16 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
+ 529 16 collected.add(match);
+ 530 16 } else {
+ 531
+
+ 532 224 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
+ 533
+ && evVer.matchesAtLeastThreeLevels(dbVer)) {
+ 534 56 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+ 535 2 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
+ 536 2 bestGuess = dbVer;
+ 537 2 bestGuessConf = conf;
+ 538
+ }
+ 539
+ }
+ 540
+ }
+ 541
+ }
+ 542 240 }
+ 543 16 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+ 544 2 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
+ 545 2 bestGuess = evVer;
+ 546 2 bestGuessConf = conf;
+ 547
+ }
+ 548
+ }
+ 549 16 }
+ 550
+ }
+ 551 4 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
+ 552 4 final String url = null ;
+ 553 4 if (bestGuessConf == null ) {
+ 554 0 bestGuessConf = Confidence.LOW;
+ 555
+ }
+ 556 4 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
+ 557 4 collected.add(match);
+ 558
+
+ 559 4 Collections.sort(collected);
+ 560 4 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
+ 561 4 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
+ 562 4 for (IdentifierMatch m : collected) {
+ 563 20 if (bestIdentifierQuality.equals(m.getConfidence())
+ 564
+ && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
+ 565 4 final Identifier i = m.getIdentifier();
+ 566 4 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
+ 567 0 i.setConfidence(Confidence.LOW);
+ 568
+ } else {
+ 569 4 i.setConfidence(bestEvidenceQuality);
+ 570
+ }
+ 571 4 dependency.addIdentifier(i);
+ 572
+ }
+ 573 20 }
+ 574 4 }
+ 575
+
+ 576
+
+ 577
+
+ 578
+
+ 579 1 private enum IdentifierConfidence {
+ 580
+
+ 581
+
+ 582
+
+ 583
+
+ 584 1 EXACT_MATCH,
+ 585
+
+ 586
+
+ 587
+
+ 588 1 BEST_GUESS
+ 589
+ }
+ 590
+
+ 591
+
+ 592
+
+ 593
+
+ 594 16 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
+ 595
+
+ 596
+
+ 597
+
+ 598
+
+ 599
+
+ 600
+
+ 601
+
+ 602
+
+ 603
+
+ 604
+
+ 605 20 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
+ 606 20 this .identifier = new Identifier(type, value, url);
+ 607 20 this .confidence = identifierConfidence;
+ 608 20 this .evidenceConfidence = evidenceConfidence;
+ 609 20 }
+ 610
+
+ 611
+
+ 612
+
+ 613
+
+ 614
+ private Confidence evidenceConfidence;
+ 615
+
+ 616
+
+ 617
+
+ 618
+
+ 619
+
+ 620
+
+ 621
+ public Confidence getEvidenceConfidence() {
+ 622
+ return evidenceConfidence;
+ 623
+ }
+ 624
+
+ 625
+
+ 626
+
+ 627
+
+ 628
+
+ 629
+
+ 630
+ public void setEvidenceConfidence(Confidence evidenceConfidence) {
+ 631
+ this .evidenceConfidence = evidenceConfidence;
+ 632
+ }
+ 633
+
+ 634
+
+ 635
+
+ 636
+ private IdentifierConfidence confidence;
+ 637
+
+ 638
+
+ 639
+
+ 640
+
+ 641
+
+ 642
+
+ 643
+ public IdentifierConfidence getConfidence() {
+ 644
+ return confidence;
+ 645
+ }
+ 646
+
+ 647
+
+ 648
+
+ 649
+
+ 650
+
+ 651
+
+ 652
+ public void setConfidence(IdentifierConfidence confidence) {
+ 653
+ this .confidence = confidence;
+ 654
+ }
+ 655
+
+ 656
+
+ 657
+
+ 658
+ private Identifier identifier;
+ 659
+
+ 660
+
+ 661
+
+ 662
+
+ 663
+
+ 664
+
+ 665
+ public Identifier getIdentifier() {
+ 666
+ return identifier;
+ 667
+ }
+ 668
+
+ 669
+
+ 670
+
+ 671
+
+ 672
+
+ 673
+
+ 674
+ public void setIdentifier(Identifier identifier) {
+ 675
+ this .identifier = identifier;
+ 676
+ }
+ 677
+
+ 678
+
+ 679
+
+ 680
+
+ 681
+
+ 682
+
+ 683
+
+ 684
+
+ 685
+ @Override
+ 686
+ public String toString() {
+ 687 0 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
+ 688
+ + ", confidence=" + confidence + ", identifier=" + identifier + '}' ;
+ 689
+ }
+ 690
+
+ 691
+
+ 692
+
+ 693
+
+ 694
+
+ 695
+
+ 696
+ @Override
+ 697
+ public int hashCode() {
+ 698 0 int hash = 5;
+ 699 0 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
+ 700 0 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
+ 701 0 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
+ 702 0 return hash;
+ 703
+ }
+ 704
+
+ 705
+
+ 706
+
+ 707
+
+ 708
+
+ 709
+
+ 710
+
+ 711
+ @Override
+ 712
+ public boolean equals(Object obj) {
+ 713 0 if (obj == null ) {
714 0 return false ;
715
}
- 716 0 final IdentifierMatch other = (IdentifierMatch) obj;
- 717 0 if (this .evidenceConfidence != other.evidenceConfidence) {
- 718 0 return false ;
- 719
+ 716 0 if (getClass() != obj.getClass()) {
+ 717 0 return false ;
+ 718
}
- 720 0 if (this .confidence != other.confidence) {
+ 719 0 final IdentifierMatch other = (IdentifierMatch) obj;
+ 720 0 if (this .evidenceConfidence != other.evidenceConfidence) {
721 0 return false ;
722
}
- 723 0 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
+ 723 0 if (this .confidence != other.confidence) {
724 0 return false ;
725
}
- 726 0 return true ;
- 727
- }
+ 726 0 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
+ 727 0 return false ;
728
-
- 729
-
- 730
-
- 731
-
- 732
-
- 733
-
- 734
-
- 735
-
- 736
-
- 737
- @Override
- 738
- public int compareTo(IdentifierMatch o) {
- 739 0 int conf = this .confidence.compareTo(o.confidence);
- 740 0 if (conf == 0) {
- 741 0 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
- 742 0 if (conf == 0) {
- 743 0 conf = identifier.compareTo(o.identifier);
- 744
- }
- 745
}
- 746 0 return conf;
- 747
+ 729 0 return true ;
+ 730
}
+ 731
+
+ 732
+
+ 733
+
+ 734
+
+ 735
+
+ 736
+
+ 737
+
+ 738
+
+ 739
+
+ 740
+ @Override
+ 741
+ public int compareTo(IdentifierMatch o) {
+ 742 16 int conf = this .confidence.compareTo(o.confidence);
+ 743 16 if (conf == 0) {
+ 744 12 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
+ 745 12 if (conf == 0) {
+ 746 4 conf = identifier.compareTo(o.identifier);
+ 747
+ }
748
+ }
+ 749 16 return conf;
+ 750
+ }
+ 751
}
- 749
+ 752
}
-
+
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 925a9fffa..75638cf46 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
@@ -12,7 +12,7 @@
@@ -82,7 +82,7 @@
32
33
-
+
34
35
@@ -97,7 +97,7 @@
40
- 41 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
+ 41 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
42
43
@@ -114,7 +114,7 @@
@Override
49
public String getName() {
- 50 0 return ANALYZER_NAME;
+ 50 4 return ANALYZER_NAME;
51
}
52
@@ -133,7 +133,7 @@
@Override
59
public AnalysisPhase getAnalysisPhase() {
- 60 0 return ANALYSIS_PHASE;
+ 60 1 return ANALYSIS_PHASE;
61
}
62
@@ -146,8 +146,8 @@
public void analyze(final Dependency dependency, final Engine engine) throws AnalysisException {
66
- 67 0 if (getRules() == null || getRules().size() <= 0) {
- 68 0 return ;
+ 67 2 if (getRules() == null || getRules().size() <= 0) {
+ 68 2 return ;
69
}
70
@@ -160,6 +160,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 621375cf9..c07299c85 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
@@ -12,7 +12,7 @@
@@ -114,547 +114,556 @@
48
49
-
+
50
-
+
51
-
- 52
- 53 0 private static final Pattern STARTING_TEXT_PATTERN = Pattern.compile("^[a-zA-Z]*" );
- 54
-
- 55
-
- 56
-
- 57
- private boolean analyzed = false ;
- 58
-
- 59
-
- 60
-
- 61
-
- 62
-
- 63
- private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
- 64
-
- 65
-
- 66
-
- 67 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
- 68
+ 52 1 private static final Logger LOGGER = Logger.getLogger(DependencyBundlingAnalyzer.class .getName());
+ 53
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58 1 private static final Pattern STARTING_TEXT_PATTERN = Pattern.compile("^[a-zA-Z]*" );
+ 59
+
+ 60
+
+ 61
+
+ 62
+ private boolean analyzed = false ;
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+ private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
69
70
-
+
71
-
- 72
-
+
+ 72 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
73
-
+
74
- public String getName() {
- 75 0 return ANALYZER_NAME;
+
+ 75
+
76
- }
+
77
-
+
78
-
+
79
-
- 80
-
+ public String getName() {
+ 80 5 return ANALYZER_NAME;
81
-
+ }
82
-
+
83
- public AnalysisPhase getAnalysisPhase() {
- 84 0 return ANALYSIS_PHASE;
+
+ 84
+
85
- }
+
86
-
+
87
-
+
88
-
- 89
-
+ public AnalysisPhase getAnalysisPhase() {
+ 89 2 return ANALYSIS_PHASE;
90
-
+ }
91
-
+
92
-
+
93
-
+
94
-
+
95
-
+
96
- @Override
+
97
- public void analyze(Dependency ignore, Engine engine) throws AnalysisException {
- 98 0 if (!analyzed) {
- 99 0 analyzed = true ;
- 100 0 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
- 101 0 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+ @Override
102
+ public void analyze(Dependency ignore, Engine engine) throws AnalysisException {
+ 103 2 if (!analyzed) {
+ 104 1 analyzed = true ;
+ 105 1 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
+ 106 1 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
+ 107
- 103 0 while (mainIterator.hasNext()) {
- 104 0 final Dependency dependency = mainIterator.next();
- 105 0 if (mainIterator.hasNext()) {
- 106 0 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
- 107 0 while (subIterator.hasNext()) {
- 108 0 final Dependency nextDependency = subIterator.next();
- 109 0 if (isShadedJar(dependency, nextDependency)) {
- 110 0 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )) {
- 111 0 dependenciesToRemove.add(dependency);
- 112
+ 108 3 while (mainIterator.hasNext()) {
+ 109 2 final Dependency dependency = mainIterator.next();
+ 110 2 if (mainIterator.hasNext()) {
+ 111 1 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
+ 112 2 while (subIterator.hasNext()) {
+ 113 1 final Dependency nextDependency = subIterator.next();
+ 114 1 if (hashesMatch(dependency, nextDependency)) {
+ 115 0 if (isCore(dependency, nextDependency)) {
+ 116 0 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
+ 117
} else {
- 113 0 dependenciesToRemove.add(nextDependency);
- 114
+ 118 0 mergeDependencies(nextDependency, dependency, dependenciesToRemove);
+ 119
}
- 115 0 } else if (hashesMatch(dependency, nextDependency)) {
- 116 0 if (isCore(dependency, nextDependency)) {
- 117 0 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
- 118
- } else {
- 119 0 mergeDependencies(nextDependency, dependency, dependenciesToRemove);
- 120
- }
- 121 0 } else if (cpeIdentifiersMatch(dependency, nextDependency)
- 122
- && hasSameBasePath(dependency, nextDependency)
+ 120 1 } else if (isShadedJar(dependency, nextDependency)) {
+ 121 0 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )) {
+ 122 0 dependenciesToRemove.add(dependency);
123
- && fileNameMatch(dependency, nextDependency)) {
- 124
-
- 125 0 if (isCore(dependency, nextDependency)) {
- 126 0 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
- 127
} else {
- 128 0 mergeDependencies(nextDependency, dependency, dependenciesToRemove);
- 129
+ 124 0 dependenciesToRemove.add(nextDependency);
+ 125
}
- 130
- }
- 131 0 }
+ 126 1 } else if (cpeIdentifiersMatch(dependency, nextDependency)
+ 127
+ && hasSameBasePath(dependency, nextDependency)
+ 128
+ && fileNameMatch(dependency, nextDependency)) {
+ 129
+
+ 130 0 if (isCore(dependency, nextDependency)) {
+ 131 0 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
132
- }
- 133 0 }
+ } else {
+ 133 0 mergeDependencies(nextDependency, dependency, dependenciesToRemove);
134
-
+ }
135
-
- 136 0 for (Dependency d : dependenciesToRemove) {
- 137 0 engine.getDependencies().remove(d);
- 138 0 }
+ }
+ 136 1 }
+ 137
+ }
+ 138 2 }
139
- }
- 140 0 }
- 141
-
- 142
-
- 143
-
+
+ 140
+
+ 141 1 for (Dependency d : dependenciesToRemove) {
+ 142 0 engine.getDependencies().remove(d);
+ 143 0 }
144
-
- 145
-
+ }
+ 145 2 }
146
-
+
147
-
+
148
-
+
149
-
+
150
-
+
151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
private void mergeDependencies(final Dependency dependency, final Dependency relatedDependency, final Set<Dependency> dependenciesToRemove) {
- 152 0 dependency.addRelatedDependency(relatedDependency);
- 153 0 final Iterator<Dependency> i = relatedDependency.getRelatedDependencies().iterator();
- 154 0 while (i.hasNext()) {
- 155 0 dependency.addRelatedDependency(i.next());
- 156 0 i.remove();
- 157
- }
- 158 0 dependenciesToRemove.add(relatedDependency);
- 159 0 }
- 160
-
- 161
-
+ 157 0 dependency.addRelatedDependency(relatedDependency);
+ 158 0 final Iterator<Dependency> i = relatedDependency.getRelatedDependencies().iterator();
+ 159 0 while (i.hasNext()) {
+ 160 0 dependency.addRelatedDependency(i.next());
+ 161 0 i.remove();
162
-
- 163
-
- 164
-
+ }
+ 163 0 dependenciesToRemove.add(relatedDependency);
+ 164 0 }
165
-
+
166
-
+
167
-
+
168
- private String getBaseRepoPath(final String path) {
- 169 0 int pos = path.indexOf("repository" + File.separator) + 11;
- 170 0 if (pos < 0) {
- 171 0 return path;
+
+ 169
+
+ 170
+
+ 171
+
172
+
+ 173
+ private String getBaseRepoPath(final String path) {
+ 174 0 int pos = path.indexOf("repository" + File.separator) + 11;
+ 175 0 if (pos < 0) {
+ 176 0 return path;
+ 177
}
- 173 0 int tmp = path.indexOf(File.separator, pos);
- 174 0 if (tmp <= 0) {
- 175 0 return path;
- 176
+ 178 0 int tmp = path.indexOf(File.separator, pos);
+ 179 0 if (tmp <= 0) {
+ 180 0 return path;
+ 181
}
- 177 0 if (tmp > 0) {
- 178 0 pos = tmp + 1;
- 179
+ 182 0 if (tmp > 0) {
+ 183 0 pos = tmp + 1;
+ 184
}
- 180 0 tmp = path.indexOf(File.separator, pos);
- 181 0 if (tmp > 0) {
- 182 0 pos = tmp + 1;
- 183
- }
- 184 0 return path.substring(0, pos);
- 185
- }
- 186
-
- 187
-
+ 185 0 tmp = path.indexOf(File.separator, pos);
+ 186 0 if (tmp > 0) {
+ 187 0 pos = tmp + 1;
188
-
- 189
-
+ }
+ 189 0 return path.substring(0, pos);
190
-
- 191
-
- 192
-
- 193
-
- 194
- private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
- 195 0 if (dependency1 == null || dependency1.getFileName() == null
- 196
- || dependency2 == null || dependency2.getFileName() == null ) {
- 197 0 return false ;
- 198
- }
- 199 0 String fileName1 = dependency1.getFileName();
- 200 0 String fileName2 = dependency2.getFileName();
- 201
-
- 202
-
- 203
-
- 204 0 final File one = new File(fileName1);
- 205 0 final File two = new File(fileName2);
- 206 0 final String oneParent = one.getParent();
- 207 0 final String twoParent = two.getParent();
- 208 0 if (oneParent != null ) {
- 209 0 if (oneParent.equals(twoParent)) {
- 210 0 fileName1 = one.getName();
- 211 0 fileName2 = two.getName();
- 212
- } else {
- 213 0 return false ;
- 214
- }
- 215 0 } else if (twoParent != null ) {
- 216 0 return false ;
- 217
- }
- 218
-
- 219
-
- 220 0 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
- 221 0 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
- 222 0 if (version1 != null && version2 != null ) {
- 223 0 if (!version1.equals(version2)) {
- 224 0 return false ;
- 225
- }
- 226
- }
- 227
-
- 228
-
- 229 0 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
- 230 0 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
- 231 0 if (match1.find() && match2.find()) {
- 232 0 return match1.group().equals(match2.group());
- 233
- }
- 234
-
- 235 0 return false ;
- 236
}
- 237
+ 191
- 238
+ 192
- 239
-
- 240
+ 193
+
+ 194
- 241
+ 195
- 242
+ 196
- 243
+ 197
- 244
+ 198
- 245
- private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) {
- 246 0 if (dependency1 == null || dependency1.getIdentifiers() == null
- 247
- || dependency2 == null || dependency2.getIdentifiers() == null ) {
- 248 0 return false ;
- 249
+ 199
+ private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
+ 200 0 if (dependency1 == null || dependency1.getFileName() == null
+ 201
+ || dependency2 == null || dependency2.getFileName() == null ) {
+ 202 0 return false ;
+ 203
}
- 250 0 boolean matches = false ;
- 251 0 int cpeCount1 = 0;
- 252 0 int cpeCount2 = 0;
- 253 0 for (Identifier i : dependency1.getIdentifiers()) {
- 254 0 if ("cpe" .equals(i.getType())) {
- 255 0 cpeCount1 += 1;
- 256
+ 204 0 String fileName1 = dependency1.getFileName();
+ 205 0 String fileName2 = dependency2.getFileName();
+ 206
+
+ 207
+
+ 208
+
+ 209 0 final File one = new File(fileName1);
+ 210 0 final File two = new File(fileName2);
+ 211 0 final String oneParent = one.getParent();
+ 212 0 final String twoParent = two.getParent();
+ 213 0 if (oneParent != null ) {
+ 214 0 if (oneParent.equals(twoParent)) {
+ 215 0 fileName1 = one.getName();
+ 216 0 fileName2 = two.getName();
+ 217
+ } else {
+ 218 0 return false ;
+ 219
}
- 257 0 }
- 258 0 for (Identifier i : dependency2.getIdentifiers()) {
+ 220 0 } else if (twoParent != null ) {
+ 221 0 return false ;
+ 222
+ }
+ 223
+
+ 224
+
+ 225 0 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
+ 226 0 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
+ 227 0 if (version1 != null && version2 != null ) {
+ 228 0 if (!version1.equals(version2)) {
+ 229 0 return false ;
+ 230
+ }
+ 231
+ }
+ 232
+
+ 233
+
+ 234 0 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
+ 235 0 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
+ 236 0 if (match1.find() && match2.find()) {
+ 237 0 return match1.group().equals(match2.group());
+ 238
+ }
+ 239
+
+ 240 0 return false ;
+ 241
+ }
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+ private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) {
+ 251 1 if (dependency1 == null || dependency1.getIdentifiers() == null
+ 252
+ || dependency2 == null || dependency2.getIdentifiers() == null ) {
+ 253 0 return false ;
+ 254
+ }
+ 255 1 boolean matches = false ;
+ 256 1 int cpeCount1 = 0;
+ 257 1 int cpeCount2 = 0;
+ 258 1 for (Identifier i : dependency1.getIdentifiers()) {
259 0 if ("cpe" .equals(i.getType())) {
- 260 0 cpeCount2 += 1;
+ 260 0 cpeCount1 += 1;
261
}
262 0 }
- 263 0 if (cpeCount1 > 0 && cpeCount1 == cpeCount2) {
- 264 0 for (Identifier i : dependency1.getIdentifiers()) {
- 265 0 matches |= dependency2.getIdentifiers().contains(i);
- 266 0 if (!matches) {
- 267 0 break ;
- 268
- }
- 269 0 }
- 270
- }
- 271 0 if (LogUtils.isVerboseLoggingEnabled()) {
- 272 0 final String msg = String.format("IdentifiersMatch=%s (%s, %s)" , matches, dependency1.getFileName(), dependency2.getFileName());
- 273 0 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
- 274
- }
- 275 0 return matches;
- 276
- }
- 277
-
- 278
-
- 279
-
- 280
-
- 281
-
- 282
-
- 283
-
- 284
-
- 285
- private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
- 286 0 if (dependency1 == null || dependency2 == null ) {
- 287 0 return false ;
- 288
- }
- 289 0 final File lFile = new File(dependency1.getFilePath());
- 290 0 String left = lFile.getParent();
- 291 0 final File rFile = new File(dependency2.getFilePath());
- 292 0 String right = rFile.getParent();
- 293 0 if (left == null ) {
- 294 0 return right == null ;
- 295
- }
- 296 0 if (left.equalsIgnoreCase(right)) {
- 297 0 return true ;
- 298
- }
- 299 0 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
- 300 0 left = getBaseRepoPath(left);
- 301 0 right = getBaseRepoPath(right);
- 302
- }
- 303 0 if (left.equalsIgnoreCase(right)) {
- 304 0 return true ;
- 305
- }
- 306
-
- 307 0 for (Dependency child : dependency2.getRelatedDependencies()) {
- 308 0 if (hasSameBasePath(dependency1, child)) {
- 309 0 return true ;
- 310
+ 263 1 for (Identifier i : dependency2.getIdentifiers()) {
+ 264 2 if ("cpe" .equals(i.getType())) {
+ 265 2 cpeCount2 += 1;
+ 266
}
- 311 0 }
- 312 0 return false ;
- 313
+ 267 2 }
+ 268 1 if (cpeCount1 > 0 && cpeCount1 == cpeCount2) {
+ 269 0 for (Identifier i : dependency1.getIdentifiers()) {
+ 270 0 matches |= dependency2.getIdentifiers().contains(i);
+ 271 0 if (!matches) {
+ 272 0 break ;
+ 273
+ }
+ 274 0 }
+ 275
+ }
+ 276 1 if (LogUtils.isVerboseLoggingEnabled()) {
+ 277 0 final String msg = String.format("IdentifiersMatch=%s (%s, %s)" , matches, dependency1.getFileName(), dependency2.getFileName());
+ 278 0 LOGGER.log(Level.FINE, msg);
+ 279
+ }
+ 280 1 return matches;
+ 281
}
- 314
+ 282
+ 283
+
+ 284
+
+ 285
+
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+ private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
+ 291 0 if (dependency1 == null || dependency2 == null ) {
+ 292 0 return false ;
+ 293
+ }
+ 294 0 final File lFile = new File(dependency1.getFilePath());
+ 295 0 String left = lFile.getParent();
+ 296 0 final File rFile = new File(dependency2.getFilePath());
+ 297 0 String right = rFile.getParent();
+ 298 0 if (left == null ) {
+ 299 0 return right == null ;
+ 300
+ }
+ 301 0 if (left.equalsIgnoreCase(right)) {
+ 302 0 return true ;
+ 303
+ }
+ 304 0 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
+ 305 0 left = getBaseRepoPath(left);
+ 306 0 right = getBaseRepoPath(right);
+ 307
+ }
+ 308 0 if (left.equalsIgnoreCase(right)) {
+ 309 0 return true ;
+ 310
+ }
+ 311
+
+ 312 0 for (Dependency child : dependency2.getRelatedDependencies()) {
+ 313 0 if (hasSameBasePath(dependency1, child)) {
+ 314 0 return true ;
315
-
- 316
-
- 317
-
+ }
+ 316 0 }
+ 317 0 return false ;
318
-
+ }
319
-
+
320
-
+
321
-
+
322
-
+
323
- boolean isCore(Dependency left, Dependency right) {
- 324 0 final String leftName = left.getFileName().toLowerCase();
- 325 0 final String rightName = right.getFileName().toLowerCase();
+
+ 324
+
+ 325
+
326
-
+
327
+
+ 328
+ boolean isCore(Dependency left, Dependency right) {
+ 329 2 final String leftName = left.getFileName().toLowerCase();
+ 330 2 final String rightName = right.getFileName().toLowerCase();
+ 331
+
+ 332
final boolean returnVal;
- 328 0 if (!rightName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" ) && leftName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" )
- 329
- || rightName.contains("core" ) && !leftName.contains("core" )
- 330
- || rightName.contains("kernel" ) && !leftName.contains("kernel" )) {
- 331 0 returnVal = false ;
- 332 0 } else if (rightName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" ) && !leftName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" )
- 333
- || !rightName.contains("core" ) && leftName.contains("core" )
+ 333 2 if (!rightName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" ) && leftName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" )
334
- || !rightName.contains("kernel" ) && leftName.contains("kernel" )) {
- 335 0 returnVal = true ;
- 336
- } else {
- 337
-
+ || rightName.contains("core" ) && !leftName.contains("core" )
+ 335
+ || rightName.contains("kernel" ) && !leftName.contains("kernel" )) {
+ 336 0 returnVal = false ;
+ 337 2 } else if (rightName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" ) && !leftName.matches(".*\\.(tar|tgz|gz|zip|ear|war).+" )
338
-
+ || !rightName.contains("core" ) && leftName.contains("core" )
339
-
- 340
-
+ || !rightName.contains("kernel" ) && leftName.contains("kernel" )) {
+ 340 2 returnVal = true ;
341
-
+ } else {
342
-
+
343
-
+
344
-
+
345
-
- 346 0 returnVal = leftName.length() <= rightName.length();
+
+ 346
+
347
+
+ 348
+
+ 349
+
+ 350
+
+ 351 0 returnVal = leftName.length() <= rightName.length();
+ 352
}
- 348 0 if (LogUtils.isVerboseLoggingEnabled()) {
- 349 0 final String msg = String.format("IsCore=%s (%s, %s)" , returnVal, left.getFileName(), right.getFileName());
- 350 0 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
- 351
- }
- 352 0 return returnVal;
- 353
- }
- 354
-
- 355
-
+ 353 2 if (LogUtils.isVerboseLoggingEnabled()) {
+ 354 0 final String msg = String.format("IsCore=%s (%s, %s)" , returnVal, left.getFileName(), right.getFileName());
+ 355 0 LOGGER.log(Level.FINE, msg);
356
-
- 357
-
+ }
+ 357 2 return returnVal;
358
-
+ }
359
-
- 360
-
- 361
-
- 362
- private boolean hashesMatch(Dependency dependency1, Dependency dependency2) {
- 363 0 if (dependency1 == null || dependency2 == null || dependency1.getSha1sum() == null || dependency2.getSha1sum() == null ) {
- 364 0 return false ;
- 365
- }
- 366 0 return dependency1.getSha1sum().equals(dependency2.getSha1sum());
- 367
- }
- 368
- 369
+ 360
- 370
-
- 371
-
- 372
+ 361
+
+ 362
- 373
-
- 374
-
- 375
-
- 376
-
- 377
+ 363
+
+ 364
+
+ 365
+
+ 366
- 378
- private boolean isShadedJar(Dependency dependency, Dependency nextDependency) {
- 379 0 final String mainName = dependency.getFileName().toLowerCase();
- 380 0 final String nextName = nextDependency.getFileName().toLowerCase();
- 381 0 if (mainName.endsWith(".jar" ) && nextName.endsWith("pom.xml" )) {
- 382 0 return dependency.getIdentifiers().containsAll(nextDependency.getIdentifiers());
- 383 0 } else if (nextName.endsWith(".jar" ) && mainName.endsWith("pom.xml" )) {
- 384 0 return nextDependency.getIdentifiers().containsAll(dependency.getIdentifiers());
- 385
+ 367
+ private boolean hashesMatch(Dependency dependency1, Dependency dependency2) {
+ 368 1 if (dependency1 == null || dependency2 == null || dependency1.getSha1sum() == null || dependency2.getSha1sum() == null ) {
+ 369 0 return false ;
+ 370
}
- 386 0 return false ;
- 387
+ 371 1 return dependency1.getSha1sum().equals(dependency2.getSha1sum());
+ 372
}
- 388
+ 373
+
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379
+
+ 380
+
+ 381
+
+ 382
+
+ 383
+ private boolean isShadedJar(Dependency dependency, Dependency nextDependency) {
+ 384 1 final String mainName = dependency.getFileName().toLowerCase();
+ 385 1 final String nextName = nextDependency.getFileName().toLowerCase();
+ 386 1 if (mainName.endsWith(".jar" ) && nextName.endsWith("pom.xml" )) {
+ 387 0 return dependency.getIdentifiers().containsAll(nextDependency.getIdentifiers());
+ 388 1 } else if (nextName.endsWith(".jar" ) && mainName.endsWith("pom.xml" )) {
+ 389 0 return nextDependency.getIdentifiers().containsAll(dependency.getIdentifiers());
+ 390
+ }
+ 391 1 return false ;
+ 392
+ }
+ 393
}
-
+
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 7c78e7965..10f3d3e4f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -106,496 +106,499 @@
44
45
-
- 46
+ 46
+
47
-
- 48
+ 48 1 private static final Logger LOGGER = Logger.getLogger(FalsePositiveAnalyzer.class .getName());
49
- private static final String ANALYZER_NAME = "False Positive Analyzer" ;
+
50
51
-
+
52
- 53 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
+ 53
+ private static final String ANALYZER_NAME = "False Positive Analyzer" ;
54
-
+
55
-
+
56
-
- 57
-
+
+ 57 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
58
-
+
59
-
+
60
- public String getName() {
- 61 0 return ANALYZER_NAME;
+
+ 61
+
62
- }
+
63
-
+
64
-
- 65
-
+ public String getName() {
+ 65 5 return ANALYZER_NAME;
66
-
+ }
67
-
+
68
-
+
69
- public AnalysisPhase getAnalysisPhase() {
- 70 0 return ANALYSIS_PHASE;
+
+ 70
+
71
- }
+
72
-
+
73
-
- 74
-
+ public AnalysisPhase getAnalysisPhase() {
+ 74 2 return ANALYSIS_PHASE;
75
-
- 76
-
- 77
-
- 78
-
- 79
-
- 80
-
- 81
- @Override
- 82
- public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 83 0 removeJreEntries(dependency);
- 84 0 removeBadMatches(dependency);
- 85 0 removeWrongVersionMatches(dependency);
- 86 0 removeSpuriousCPE(dependency);
- 87 0 addFalseNegativeCPEs(dependency);
- 88 0 }
- 89
-
- 90
-
- 91
-
- 92
-
- 93
-
- 94
-
- 95
-
- 96
-
- 97
-
- 98
-
- 99
-
- 100
-
- 101
-
- 102
-
- 103
-
- 104
-
- 105
-
- 106
-
- 107
-
- 108
- @SuppressWarnings("null" )
- 109
- private void removeSpuriousCPE(Dependency dependency) {
- 110 0 final List<Identifier> ids = new ArrayList<Identifier>();
- 111 0 ids.addAll(dependency.getIdentifiers());
- 112 0 Collections.sort(ids);
- 113 0 final ListIterator<Identifier> mainItr = ids.listIterator();
- 114 0 while (mainItr.hasNext()) {
- 115 0 final Identifier currentId = mainItr.next();
- 116 0 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
- 117 0 if (currentCpe == null ) {
- 118 0 continue ;
- 119
- }
- 120 0 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
- 121 0 while (subItr.hasNext()) {
- 122 0 final Identifier nextId = subItr.next();
- 123 0 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
- 124 0 if (nextCpe == null ) {
- 125 0 continue ;
- 126
- }
- 127
-
- 128 0 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
- 129 0 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
- 130
-
- 131 0 final String currentVersion = currentCpe.getVersion();
- 132 0 final String nextVersion = nextCpe.getVersion();
- 133 0 if (currentVersion == null && nextVersion == null ) {
- 134
-
- 135 0 Logger.getLogger(FalsePositiveAnalyzer.class
- 136
- .getName()).log(Level.FINE, "currentVersion and nextVersion are both null?" );
- 137 0 } else if (currentVersion == null && nextVersion != null ) {
- 138 0 dependency.getIdentifiers().remove(currentId);
- 139 0 } else if (nextVersion == null && currentVersion != null ) {
- 140 0 dependency.getIdentifiers().remove(nextId);
- 141 0 } else if (currentVersion.length() < nextVersion.length()) {
- 142 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
- 143 0 dependency.getIdentifiers().remove(currentId);
- 144
- }
- 145
- } else {
- 146 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
- 147 0 dependency.getIdentifiers().remove(nextId);
- 148
- }
- 149
- }
- 150
- }
- 151
- }
- 152 0 }
- 153 0 }
- 154 0 }
- 155
-
- 156
-
- 157
-
- 158 0 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
- 159
- + "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
- 160
- + "jdk|jre|jsf|jsse)($|:.*)" );
- 161
-
- 162
-
- 163
-
- 164 0 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
- 165
-
- 166
-
- 167
-
- 168
-
- 169
-
- 170
-
- 171
- private void removeJreEntries(Dependency dependency) {
- 172 0 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 173 0 final Iterator<Identifier> itr = identifiers.iterator();
- 174 0 while (itr.hasNext()) {
- 175 0 final Identifier i = itr.next();
- 176 0 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
- 177 0 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
- 178 0 if (coreCPE.matches() && !coreFiles.matches()) {
- 179 0 itr.remove();
- 180
- }
- 181
-
- 182
-
- 183
-
- 184
-
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
-
- 191
-
- 192
-
- 193
-
- 194
-
- 195
-
- 196
-
- 197
-
- 198
-
- 199
-
- 200
-
- 201
-
- 202 0 }
- 203 0 }
- 204
-
- 205
-
- 206
-
- 207
-
- 208
-
- 209
-
- 210
-
- 211
-
- 212
- private VulnerableSoftware parseCpe(String type, String value) {
- 213 0 if (!"cpe" .equals(type)) {
- 214 0 return null ;
- 215
- }
- 216 0 final VulnerableSoftware cpe = new VulnerableSoftware();
- 217
- try {
- 218 0 cpe.parseName(value);
- 219 0 } catch (UnsupportedEncodingException ex) {
- 220 0 Logger.getLogger(FalsePositiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
- 221 0 return null ;
- 222 0 }
- 223 0 return cpe;
- 224
}
- 225
+ 76
+
+ 77
- 226
+ 78
- 227
-
- 228
-
- 229
+ 79
+
+ 80
- 230
-
- 231
+ 81
+
+ 82
+
+ 83
+
+ 84
- 232
- private void removeBadMatches(Dependency dependency) {
- 233 0 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 234 0 final Iterator<Identifier> itr = identifiers.iterator();
- 235
+ 85
+ @Override
+ 86
+ public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+ 87 3 removeJreEntries(dependency);
+ 88 3 removeBadMatches(dependency);
+ 89 3 removeWrongVersionMatches(dependency);
+ 90 3 removeSpuriousCPE(dependency);
+ 91 3 addFalseNegativeCPEs(dependency);
+ 92 3 }
+ 93
- 236
-
- 237
-
- 238
-
- 239
-
- 240
-
- 241
-
- 242
-
- 243 0 while (itr.hasNext()) {
- 244 0 final Identifier i = itr.next();
- 245
-
- 246 0 if ("cpe" .equals(i.getType())) {
- 247 0 if ((i.getValue().matches(".*c\\+\\+.*" )
- 248
- || i.getValue().startsWith("cpe:/a:jquery:jquery" )
- 249
- || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
- 250
- || i.getValue().startsWith("cpe:/a:yahoo:yui" )
- 251
- || i.getValue().startsWith("cpe:/a:file:file" )
- 252
- || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
- 253
- || i.getValue().startsWith("cpe:/a:cvs:cvs" )
- 254
- || i.getValue().startsWith("cpe:/a:ftp:ftp" )
- 255
- || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
- 256
- && (dependency.getFileName().toLowerCase().endsWith(".jar" )
- 257
- || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
- 258 0 itr.remove();
- 259 0 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
- 260
- && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
- 261 0 itr.remove();
- 262 0 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
- 263
- && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
- 264 0 itr.remove();
- 265 0 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
- 266
- && !dependency.getFileName().toLowerCase().matches("jboss-[\\d\\.]+(GA)?\\.jar" )) {
- 267 0 itr.remove();
- 268
- }
- 269
- }
- 270 0 }
- 271 0 }
- 272
-
- 273
+ 94
- 274
-
- 275
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
- 276
-
- 277
-
- 278
- private void removeWrongVersionMatches(Dependency dependency) {
- 279 0 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 280 0 final Iterator<Identifier> itr = identifiers.iterator();
- 281
-
- 282 0 final String fileName = dependency.getFileName();
- 283 0 if (fileName != null && fileName.contains("axis2" )) {
- 284 0 while (itr.hasNext()) {
- 285 0 final Identifier i = itr.next();
- 286 0 if ("cpe" .equals(i.getType())) {
- 287 0 final String cpe = i.getValue();
- 288 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
- 289 0 itr.remove();
- 290
- }
- 291
- }
- 292 0 }
- 293 0 } else if (fileName != null && fileName.contains("axis" )) {
- 294 0 while (itr.hasNext()) {
- 295 0 final Identifier i = itr.next();
- 296 0 if ("cpe" .equals(i.getType())) {
- 297 0 final String cpe = i.getValue();
- 298 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
- 299 0 itr.remove();
- 300
- }
- 301
- }
- 302 0 }
- 303
- }
- 304 0 }
- 305
-
- 306
-
- 307
-
- 308
-
- 309
-
- 310
-
- 311
+ 110
- 312
+ 111
+ 112
+ @SuppressWarnings("null" )
+ 113
+ private void removeSpuriousCPE(Dependency dependency) {
+ 114 3 final List<Identifier> ids = new ArrayList<Identifier>();
+ 115 3 ids.addAll(dependency.getIdentifiers());
+ 116 3 Collections.sort(ids);
+ 117 3 final ListIterator<Identifier> mainItr = ids.listIterator();
+ 118 5 while (mainItr.hasNext()) {
+ 119 2 final Identifier currentId = mainItr.next();
+ 120 2 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
+ 121 2 if (currentCpe == null ) {
+ 122 0 continue ;
+ 123
+ }
+ 124 2 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
+ 125 3 while (subItr.hasNext()) {
+ 126 1 final Identifier nextId = subItr.next();
+ 127 1 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
+ 128 1 if (nextCpe == null ) {
+ 129 0 continue ;
+ 130
+ }
+ 131
+
+ 132 1 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
+ 133 0 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
+ 134
+
+ 135 0 final String currentVersion = currentCpe.getVersion();
+ 136 0 final String nextVersion = nextCpe.getVersion();
+ 137 0 if (currentVersion == null && nextVersion == null ) {
+ 138
+
+ 139 0 LOGGER.log(Level.FINE, "currentVersion and nextVersion are both null?" );
+ 140 0 } else if (currentVersion == null && nextVersion != null ) {
+ 141 0 dependency.getIdentifiers().remove(currentId);
+ 142 0 } else if (nextVersion == null && currentVersion != null ) {
+ 143 0 dependency.getIdentifiers().remove(nextId);
+ 144 0 } else if (currentVersion.length() < nextVersion.length()) {
+ 145 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
+ 146 0 dependency.getIdentifiers().remove(currentId);
+ 147
+ }
+ 148
+ } else {
+ 149 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
+ 150 0 dependency.getIdentifiers().remove(nextId);
+ 151
+ }
+ 152
+ }
+ 153
+ }
+ 154
+ }
+ 155 1 }
+ 156 2 }
+ 157 3 }
+ 158
+
+ 159
+
+ 160
+
+ 161 1 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+ 162
+ + "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
+ 163
+ + "jdk|jre|jsf|jsse)($|:.*)" );
+ 164
+
+ 165
+
+ 166
+
+ 167 1 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+ 168
+
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+ private void removeJreEntries(Dependency dependency) {
+ 175 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 176 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 177 6 while (itr.hasNext()) {
+ 178 3 final Identifier i = itr.next();
+ 179 3 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
+ 180 3 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
+ 181 3 if (coreCPE.matches() && !coreFiles.matches()) {
+ 182 0 itr.remove();
+ 183
+ }
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205 3 }
+ 206 3 }
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+ private VulnerableSoftware parseCpe(String type, String value) {
+ 216 3 if (!"cpe" .equals(type)) {
+ 217 0 return null ;
+ 218
+ }
+ 219 3 final VulnerableSoftware cpe = new VulnerableSoftware();
+ 220
+ try {
+ 221 3 cpe.parseName(value);
+ 222 0 } catch (UnsupportedEncodingException ex) {
+ 223 0 LOGGER.log(Level.FINEST, null , ex);
+ 224 0 return null ;
+ 225 3 }
+ 226 3 return cpe;
+ 227
+ }
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+
+ 234
+
+ 235
+ private void removeBadMatches(Dependency dependency) {
+ 236 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 237 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246 6 while (itr.hasNext()) {
+ 247 3 final Identifier i = itr.next();
+ 248
+
+ 249 3 if ("cpe" .equals(i.getType())) {
+ 250 3 if ((i.getValue().matches(".*c\\+\\+.*" )
+ 251
+ || i.getValue().startsWith("cpe:/a:jquery:jquery" )
+ 252
+ || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
+ 253
+ || i.getValue().startsWith("cpe:/a:yahoo:yui" )
+ 254
+ || i.getValue().startsWith("cpe:/a:file:file" )
+ 255
+ || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
+ 256
+ || i.getValue().startsWith("cpe:/a:cvs:cvs" )
+ 257
+ || i.getValue().startsWith("cpe:/a:ftp:ftp" )
+ 258
+ || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
+ 259
+ && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+ 260
+ || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
+ 261 1 itr.remove();
+ 262 2 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
+ 263
+ && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
+ 264 0 itr.remove();
+ 265 2 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
+ 266
+ && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
+ 267 0 itr.remove();
+ 268 2 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
+ 269
+ && !dependency.getFileName().toLowerCase().matches("jboss-[\\d\\.]+(GA)?\\.jar" )) {
+ 270 0 itr.remove();
+ 271
+ }
+ 272
+ }
+ 273 3 }
+ 274 3 }
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+ private void removeWrongVersionMatches(Dependency dependency) {
+ 282 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 283 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 284
+
+ 285 3 final String fileName = dependency.getFileName();
+ 286 3 if (fileName != null && fileName.contains("axis2" )) {
+ 287 0 while (itr.hasNext()) {
+ 288 0 final Identifier i = itr.next();
+ 289 0 if ("cpe" .equals(i.getType())) {
+ 290 0 final String cpe = i.getValue();
+ 291 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
+ 292 0 itr.remove();
+ 293
+ }
+ 294
+ }
+ 295 0 }
+ 296 3 } else if (fileName != null && fileName.contains("axis" )) {
+ 297 0 while (itr.hasNext()) {
+ 298 0 final Identifier i = itr.next();
+ 299 0 if ("cpe" .equals(i.getType())) {
+ 300 0 final String cpe = i.getValue();
+ 301 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
+ 302 0 itr.remove();
+ 303
+ }
+ 304
+ }
+ 305 0 }
+ 306
+ }
+ 307 3 }
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
313
+
+ 314
+
+ 315
+
+ 316
private void addFalseNegativeCPEs(Dependency dependency) {
- 314 0 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 315 0 while (itr.hasNext()) {
- 316 0 final Identifier i = itr.next();
- 317 0 if ("cpe" .equals(i.getType()) && i.getValue() != null
- 318
- && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
- 319
- || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
- 320
- || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+ 317 3 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 318 5 while (itr.hasNext()) {
+ 319 2 final Identifier i = itr.next();
+ 320 2 if ("cpe" .equals(i.getType()) && i.getValue() != null
321
+ && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
+ 322
+ || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
+ 323
+ || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+ 324
|| i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
- 322 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
- 323 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
- 324 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
- 325 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
- 326
- try {
- 327 0 dependency.addIdentifier("cpe" ,
- 328
- newCpe,
+ 325 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
+ 326 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
+ 327 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
+ 328 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
329
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
+ try {
330 0 dependency.addIdentifier("cpe" ,
331
- newCpe2,
+ newCpe,
332
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
333 0 dependency.addIdentifier("cpe" ,
334
- newCpe3,
+ newCpe2,
335
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
336 0 dependency.addIdentifier("cpe" ,
337
- newCpe4,
+ newCpe3,
338
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
- 339 0 } catch (UnsupportedEncodingException ex) {
- 340 0 Logger.getLogger(FalsePositiveAnalyzer.class
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
+ 339 0 dependency.addIdentifier("cpe" ,
+ 340
+ newCpe4,
341
- .getName()).log(Level.FINE, null , ex);
- 342 0 }
- 343
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
+ 342 0 } catch (UnsupportedEncodingException ex) {
+ 343 0 LOGGER.log(Level.FINE, null , ex);
+ 344 0 }
+ 345
}
- 344 0 }
- 345 0 }
- 346
+ 346 2 }
+ 347 3 }
+ 348
}
-
+
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 1e15aba88..e793b9c56 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
@@ -12,7 +12,7 @@
@@ -88,7 +88,7 @@
35
36
-
+
37
38
@@ -103,7 +103,7 @@
43
- 44 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 44 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
45
46
@@ -118,7 +118,7 @@
51
public String getName() {
- 52 0 return ANALYZER_NAME;
+ 52 5 return ANALYZER_NAME;
53
}
54
@@ -135,7 +135,7 @@
60
public AnalysisPhase getAnalysisPhase() {
- 61 0 return ANALYSIS_PHASE;
+ 61 2 return ANALYSIS_PHASE;
62
}
63
@@ -164,41 +164,41 @@
75
- 76 0 final File f = new File(dependency.getFileName());
- 77 0 String fileName = f.getName();
+ 76 4 final File f = new File(dependency.getFileName());
+ 77 4 String fileName = f.getName();
78
79
- 80 0 final int pos = fileName.lastIndexOf("." );
- 81 0 if (pos > 0) {
- 82 0 fileName = fileName.substring(0, pos);
+ 80 4 final int pos = fileName.lastIndexOf("." );
+ 81 4 if (pos > 0) {
+ 82 4 fileName = fileName.substring(0, pos);
83
}
84
85
- 86 0 final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName);
- 87 0 if (version != null ) {
+ 86 4 final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName);
+ 87 4 if (version != null ) {
88
89
90
- 91 0 if (version.getVersionParts() == null || version.getVersionParts().size() < 2) {
+ 91 4 if (version.getVersionParts() == null || version.getVersionParts().size() < 2) {
92 0 dependency.getVersionEvidence().addEvidence("file" , "name" ,
93
version.toString(), Confidence.MEDIUM);
94
} else {
- 95 0 dependency.getVersionEvidence().addEvidence("file" , "name" ,
+ 95 4 dependency.getVersionEvidence().addEvidence("file" , "name" ,
96
version.toString(), Confidence.HIGHEST);
97
}
- 98 0 dependency.getVersionEvidence().addEvidence("file" , "name" ,
+ 98 4 dependency.getVersionEvidence().addEvidence("file" , "name" ,
99
fileName, Confidence.MEDIUM);
100
@@ -207,11 +207,11 @@
102
- 103 0 if (fileName.contains("-" )) {
- 104 0 dependency.getProductEvidence().addEvidence("file" , "name" ,
+ 103 4 if (fileName.contains("-" )) {
+ 104 4 dependency.getProductEvidence().addEvidence("file" , "name" ,
105
fileName, Confidence.HIGHEST);
- 106 0 dependency.getVendorEvidence().addEvidence("file" , "name" ,
+ 106 4 dependency.getVendorEvidence().addEvidence("file" , "name" ,
107
fileName, Confidence.HIGHEST);
108
@@ -224,11 +224,11 @@
fileName, Confidence.HIGH);
113
}
- 114 0 }
+ 114 4 }
115
}
-
+
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 e20f51fb7..0f19986a5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
@@ -87,6 +87,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 01a322b07..c52a38243 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
@@ -12,7 +12,7 @@
@@ -86,7 +86,7 @@
34
35
-
+
36
37
@@ -101,7 +101,7 @@
42
- 43 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_IDENTIFIER_ANALYSIS;
+ 43 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_IDENTIFIER_ANALYSIS;
44
45
@@ -118,7 +118,7 @@
@Override
51
public String getName() {
- 52 0 return ANALYZER_NAME;
+ 52 5 return ANALYZER_NAME;
53
}
54
@@ -137,7 +137,7 @@
@Override
61
public AnalysisPhase getAnalysisPhase() {
- 62 0 return ANALYSIS_PHASE;
+ 62 2 return ANALYSIS_PHASE;
63
}
64
@@ -164,7 +164,7 @@
@Override
75
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 76 0 final Evidence springTest1 = new Evidence("Manifest" ,
+ 76 2 final Evidence springTest1 = new Evidence("Manifest" ,
77
"Implementation-Title" ,
78
@@ -173,7 +173,7 @@
Confidence.HIGH);
80
- 81 0 final Evidence springTest2 = new Evidence("Manifest" ,
+ 81 2 final Evidence springTest2 = new Evidence("Manifest" ,
82
"Implementation-Title" ,
83
@@ -182,7 +182,7 @@
Confidence.HIGH);
85
- 86 0 final Evidence springTest3 = new Evidence("Manifest" ,
+ 86 2 final Evidence springTest3 = new Evidence("Manifest" ,
87
"Bundle-Vendor" ,
88
@@ -191,44 +191,44 @@
Confidence.HIGH);
90
- 91 0 Set<Evidence> evidence = dependency.getProductEvidence().getEvidence();
- 92 0 if (evidence.contains(springTest1) || evidence.contains(springTest2)) {
- 93 0 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Confidence.HIGH);
- 94 0 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "SpringSource" , Confidence.HIGH);
- 95 0 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Confidence.HIGH);
+ 91 2 Set<Evidence> evidence = dependency.getProductEvidence().getEvidence();
+ 92 2 if (evidence.contains(springTest1) || evidence.contains(springTest2)) {
+ 93 1 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Confidence.HIGH);
+ 94 1 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "SpringSource" , Confidence.HIGH);
+ 95 1 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Confidence.HIGH);
96
}
97
- 98 0 evidence = dependency.getVendorEvidence().getEvidence();
- 99 0 if (evidence.contains(springTest3)) {
- 100 0 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Confidence.HIGH);
- 101 0 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Confidence.HIGH);
+ 98 2 evidence = dependency.getVendorEvidence().getEvidence();
+ 99 2 if (evidence.contains(springTest3)) {
+ 100 1 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Confidence.HIGH);
+ 101 1 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Confidence.HIGH);
102
}
- 103 0 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
- 104 0 final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
- 105 0 while (itr.hasNext()) {
- 106 0 final Evidence e = itr.next();
- 107 0 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
+ 103 2 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
+ 104 2 final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
+ 105 27 while (itr.hasNext()) {
+ 106 25 final Evidence e = itr.next();
+ 107 25 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
108 0 final Evidence newEvidence = new Evidence(e.getSource() + " (hint)" , e.getName(), "oracle" , e.getConfidence());
109 0 newEntries.add(newEvidence);
- 110 0 } else if ("oracle" .equalsIgnoreCase(e.getValue(false ))) {
+ 110 0 } else if ("oracle" .equalsIgnoreCase(e.getValue(false ))) {
111 0 final Evidence newEvidence = new Evidence(e.getSource() + " (hint)" , e.getName(), "sun" , e.getConfidence());
112 0 newEntries.add(newEvidence);
113
}
- 114 0 }
- 115 0 for (Evidence e : newEntries) {
+ 114 25 }
+ 115 2 for (Evidence e : newEntries) {
116 0 dependency.getVendorEvidence().addEvidence(e);
117 0 }
118
- 119 0 }
+ 119 2 }
120
}
-
+
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 b465acffe..00d4eef9e 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 @@
@@ -192,7 +192,7 @@
87
- 88 0 private static final Logger LOGGER = Logger.getLogger(JarAnalyzer.class .getName());
+ 88 1 private static final Logger LOGGER = Logger.getLogger(JarAnalyzer.class .getName());
89
90
@@ -207,21 +207,21 @@
95
- 96 0 private static int dirCount = 0;
+ 96 1 private static int dirCount = 0;
97
98
99
- 100 0 private static final String NEWLINE = System.getProperty("line.separator" );
+ 100 1 private static final String NEWLINE = System.getProperty("line.separator" );
101
102
103
- 104 0 private static final Set<String> IGNORE_VALUES = newHashSet(
+ 104 1 private static final Set<String> IGNORE_VALUES = newHashSet(
105
"Sun Java System Application Server" );
106
@@ -230,7 +230,7 @@
108
- 109 0 private static final Set<String> IGNORE_KEYS = newHashSet(
+ 109 1 private static final Set<String> IGNORE_KEYS = newHashSet(
110
"built-by" ,
111
@@ -333,7 +333,7 @@
160
- 161 0 private static final Pattern HTML_DETECTION_PATTERN = Pattern.compile("\\<[a-z]+.*/?\\>" , Pattern.CASE_INSENSITIVE);
+ 161 1 private static final Pattern HTML_DETECTION_PATTERN = Pattern.compile("\\<[a-z]+.*/?\\>" , Pattern.CASE_INSENSITIVE);
162
163
@@ -352,16 +352,16 @@
170
- 171 0 public JarAnalyzer() {
+ 171 7 public JarAnalyzer() {
172
try {
- 173 0 final JAXBContext jaxbContext = JAXBContext.newInstance("org.owasp.dependencycheck.jaxb.pom.generated" );
- 174 0 pomUnmarshaller = jaxbContext.createUnmarshaller();
+ 173 7 final JAXBContext jaxbContext = JAXBContext.newInstance("org.owasp.dependencycheck.jaxb.pom.generated" );
+ 174 7 pomUnmarshaller = jaxbContext.createUnmarshaller();
175 0 } catch (JAXBException ex) {
176 0 LOGGER.log(Level.SEVERE, "Unable to load parser. See the log for more details." );
177 0 LOGGER.log(Level.FINE, null , ex);
- 178 0 }
- 179 0 }
+ 178 7 }
+ 179 7 }
180
181
@@ -380,14 +380,14 @@
188
- 189 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 189 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
190
191
192
- 193 0 private static final Set<String> EXTENSIONS = newHashSet("jar" , "war" );
+ 193 1 private static final Set<String> EXTENSIONS = newHashSet("jar" , "war" );
194
195
@@ -404,7 +404,7 @@
@Override
201
public Set<String> getSupportedExtensions() {
- 202 0 return EXTENSIONS;
+ 202 852 return EXTENSIONS;
203
}
204
@@ -423,7 +423,7 @@
@Override
211
public String getName() {
- 212 0 return ANALYZER_NAME;
+ 212 5 return ANALYZER_NAME;
213
}
214
@@ -440,7 +440,7 @@
220
public AnalysisPhase getAnalysisPhase() {
- 221 0 return ANALYSIS_PHASE;
+ 221 1 return ANALYSIS_PHASE;
222
}
223
@@ -461,7 +461,7 @@
@Override
231
protected String getAnalyzerEnabledSettingKey() {
- 232 0 return Settings.KEYS.ANALYZER_JAR_ENABLED;
+ 232 7 return Settings.KEYS.ANALYZER_JAR_ENABLED;
233
}
234
@@ -488,9 +488,9 @@
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
245
try {
- 246 0 final ArrayList<ClassNameInformation> classNames = collectClassNames(dependency);
- 247 0 final String fileName = dependency.getFileName().toLowerCase();
- 248 0 if (classNames.isEmpty()
+ 246 5 final ArrayList<ClassNameInformation> classNames = collectClassNames(dependency);
+ 247 5 final String fileName = dependency.getFileName().toLowerCase();
+ 248 5 if (classNames.isEmpty()
249
&& (fileName.endsWith("-sources.jar" )
250
@@ -502,14 +502,14 @@
253 0 engine.getDependencies().remove(dependency);
254
}
- 255 0 final boolean hasManifest = parseManifest(dependency, classNames);
- 256 0 final boolean hasPOM = analyzePOM(dependency, classNames, engine);
- 257 0 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
- 258 0 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
+ 255 5 final boolean hasManifest = parseManifest(dependency, classNames);
+ 256 5 final boolean hasPOM = analyzePOM(dependency, classNames, engine);
+ 257 5 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
+ 258 5 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
259 0 } catch (IOException ex) {
260 0 throw new AnalysisException("Exception occurred reading the JAR file." , ex);
- 261 0 }
- 262 0 }
+ 261 5 }
+ 262 5 }
263
264
@@ -534,12 +534,12 @@
274
protected boolean analyzePOM(Dependency dependency, ArrayList<ClassNameInformation> classes, Engine engine) throws AnalysisException {
- 275 0 boolean foundSomething = false ;
+ 275 5 boolean foundSomething = false ;
276
final JarFile jar;
277
try {
- 278 0 jar = new JarFile(dependency.getActualFilePath());
+ 278 5 jar = new JarFile(dependency.getActualFilePath());
279 0 } catch (IOException ex) {
280 0 final String msg = String.format("Unable to read JarFile '%s'." , dependency.getActualFilePath());
281
@@ -547,12 +547,12 @@
282 0 LOGGER.log(Level.WARNING, msg);
283 0 LOGGER.log(Level.FINE, "" , ex);
284 0 return false ;
- 285 0 }
+ 285 5 }
286
List<String> pomEntries;
287
try {
- 288 0 pomEntries = retrievePomListing(jar);
+ 288 5 pomEntries = retrievePomListing(jar);
289 0 } catch (IOException ex) {
290 0 final String msg = String.format("Unable to read Jar file entries in '%s'." , dependency.getActualFilePath());
291
@@ -560,23 +560,23 @@
292 0 LOGGER.log(Level.WARNING, msg);
293 0 LOGGER.log(Level.FINE, msg, ex);
294 0 return false ;
- 295 0 }
- 296 0 if (pomEntries.isEmpty()) {
- 297 0 return false ;
+ 295 5 }
+ 296 5 if (pomEntries.isEmpty()) {
+ 297 4 return false ;
298
}
- 299 0 for (String path : pomEntries) {
- 300 0 Properties pomProperties = null ;
+ 299 1 for (String path : pomEntries) {
+ 300 1 Properties pomProperties = null ;
301
try {
- 302 0 pomProperties = retrievePomProperties(path, jar);
+ 302 1 pomProperties = retrievePomProperties(path, jar);
303 0 } catch (IOException ex) {
304 0 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
- 305 0 }
- 306 0 Model pom = null ;
+ 305 1 }
+ 306 1 Model pom = null ;
307
try {
- 308 0 if (pomEntries.size() > 1) {
+ 308 1 if (pomEntries.size() > 1) {
309
310 0 final Dependency newDependency = new Dependency();
@@ -605,17 +605,17 @@
325 0 engine.getDependencies().add(newDependency);
326 0 Collections.sort(engine.getDependencies());
327 0 } else {
- 328 0 pom = retrievePom(path, jar);
- 329 0 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
+ 328 1 pom = retrievePom(path, jar);
+ 329 1 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
330
}
331 0 } catch (AnalysisException ex) {
332 0 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
333 0 LOGGER.log(Level.WARNING, msg);
334 0 LOGGER.log(Level.FINE, "" , ex);
- 335 0 }
- 336 0 }
- 337 0 return foundSomething;
+ 335 1 }
+ 336 1 }
+ 337 1 return foundSomething;
338
}
339
@@ -642,16 +642,16 @@
justification = "The reader is closed by closing the zipEntry" )
350
private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
- 351 0 Properties pomProperties = null ;
- 352 0 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
- 353 0 final ZipEntry propEntry = jar.getEntry(propPath);
- 354 0 if (propEntry != null ) {
+ 351 1 Properties pomProperties = null ;
+ 352 1 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
+ 353 1 final ZipEntry propEntry = jar.getEntry(propPath);
+ 354 1 if (propEntry != null ) {
355 0 final Reader reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
356 0 pomProperties = new Properties();
357 0 pomProperties.load(reader);
358
}
- 359 0 return pomProperties;
+ 359 1 return pomProperties;
360
}
361
@@ -667,22 +667,22 @@
366
367
-
+
368
369
private List<String> retrievePomListing(final JarFile jar) throws IOException {
- 370 0 final List<String> pomEntries = new ArrayList<String>();
- 371 0 final Enumeration<JarEntry> entries = jar.entries();
- 372 0 while (entries.hasMoreElements()) {
- 373 0 final JarEntry entry = entries.nextElement();
- 374 0 final String entryName = (new File(entry.getName())).getName().toLowerCase();
- 375 0 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
- 376 0 pomEntries.add(entry.getName());
+ 370 5 final List<String> pomEntries = new ArrayList<String>();
+ 371 5 final Enumeration<JarEntry> entries = jar.entries();
+ 372 1848 while (entries.hasMoreElements()) {
+ 373 1843 final JarEntry entry = entries.nextElement();
+ 374 1843 final String entryName = (new File(entry.getName())).getName().toLowerCase();
+ 375 1843 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
+ 376 1 pomEntries.add(entry.getName());
377
}
- 378 0 }
- 379 0 return pomEntries;
+ 378 1843 }
+ 379 5 return pomEntries;
380
}
381
@@ -730,7 +730,7 @@
408 0 bos.flush();
409 0 dependency.setActualFilePath(file.getAbsolutePath());
410 0 } catch (IOException ex) {
- 411 0 final String msg = String.format("An error occured reading '%s' from '%s'." , path, dependency.getFilePath());
+ 411 0 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
412 0 LOGGER.warning(msg);
413 0 LOGGER.log(Level.SEVERE, "" , ex);
414
@@ -840,1355 +840,1333 @@
487
private Model retrievePom(String path, JarFile jar) throws AnalysisException {
- 488 0 final ZipEntry entry = jar.getEntry(path);
- 489 0 Model model = null ;
- 490 0 if (entry != null ) {
+ 488 1 final ZipEntry entry = jar.getEntry(path);
+ 489 1 Model model = null ;
+ 490 1 if (entry != null ) {
491
try {
- 492 0 final NonClosingStream stream = new NonClosingStream(jar.getInputStream(entry));
- 493 0 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
- 494 0 final InputSource xml = new InputSource(reader);
- 495 0 final SAXSource source = new SAXSource(xml);
- 496 0 model = readPom(source);
+ 492 1 final NonClosingStream stream = new NonClosingStream(jar.getInputStream(entry));
+ 493 1 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
+ 494 1 final InputSource xml = new InputSource(reader);
+ 495 1 final SAXSource source = new SAXSource(xml);
+ 496 1 model = readPom(source);
497 0 } catch (SecurityException ex) {
498 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
- 499 0 Logger
- 500
- .getLogger(JarAnalyzer.class
- 501
- .getName()).log(Level.WARNING, msg);
- 502 0 Logger.getLogger(JarAnalyzer.class
- 503
- .getName()).log(Level.FINE, null , ex);
- 504 0 throw new AnalysisException(ex);
- 505 0 } catch (IOException ex) {
- 506 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
- 507 0 LOGGER.log(Level.WARNING, msg);
- 508 0 LOGGER.log(Level.FINE, "" , ex);
- 509 0 throw new AnalysisException(ex);
- 510 0 } catch (Throwable ex) {
- 511 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
- 512 0 LOGGER.log(Level.WARNING, msg);
- 513 0 LOGGER.log(Level.FINE, "" , ex);
- 514 0 throw new AnalysisException(ex);
- 515 0 }
+ 499 0 LOGGER.log(Level.WARNING, msg);
+ 500 0 LOGGER.log(Level.FINE, null , ex);
+ 501 0 throw new AnalysisException(ex);
+ 502 0 } catch (IOException ex) {
+ 503 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+ 504 0 LOGGER.log(Level.WARNING, msg);
+ 505 0 LOGGER.log(Level.FINE, "" , ex);
+ 506 0 throw new AnalysisException(ex);
+ 507 0 } catch (Throwable ex) {
+ 508 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
+ 509 0 LOGGER.log(Level.WARNING, msg);
+ 510 0 LOGGER.log(Level.FINE, "" , ex);
+ 511 0 throw new AnalysisException(ex);
+ 512 1 }
+ 513
+ }
+ 514 1 return model;
+ 515
+ }
516
- }
- 517 0 return model;
+
+ 517
+
518
- }
- 519
-
- 520
-
- 521
- 522
+ 519
- 523
+ 520
- 524
+ 521
- 525
+ 522
- 526
+ 523
- 527
+ 524
- 528
+ 525
private Model readPom(SAXSource source) throws AnalysisException {
- 529 0 Model model = null ;
- 530
+ 526 1 Model model = null ;
+ 527
try {
- 531 0 final XMLFilter filter = new MavenNamespaceFilter();
- 532 0 final SAXParserFactory spf = SAXParserFactory.newInstance();
- 533 0 final SAXParser sp = spf.newSAXParser();
- 534 0 final XMLReader xr = sp.getXMLReader();
- 535 0 filter.setParent(xr);
- 536 0 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
- 537 0 model = el.getValue();
- 538 0 } catch (SecurityException ex) {
- 539 0 throw new AnalysisException(ex);
- 540 0 } catch (ParserConfigurationException ex) {
- 541 0 throw new AnalysisException(ex);
- 542 0 } catch (SAXException ex) {
- 543 0 throw new AnalysisException(ex);
- 544 0 } catch (JAXBException ex) {
- 545 0 throw new AnalysisException(ex);
- 546 0 } catch (Throwable ex) {
- 547 0 throw new AnalysisException(ex);
- 548 0 }
- 549 0 return model;
+ 528 1 final XMLFilter filter = new MavenNamespaceFilter();
+ 529 1 final SAXParserFactory spf = SAXParserFactory.newInstance();
+ 530 1 final SAXParser sp = spf.newSAXParser();
+ 531 1 final XMLReader xr = sp.getXMLReader();
+ 532 1 filter.setParent(xr);
+ 533 1 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
+ 534 1 model = el.getValue();
+ 535 0 } catch (SecurityException ex) {
+ 536 0 throw new AnalysisException(ex);
+ 537 0 } catch (ParserConfigurationException ex) {
+ 538 0 throw new AnalysisException(ex);
+ 539 0 } catch (SAXException ex) {
+ 540 0 throw new AnalysisException(ex);
+ 541 0 } catch (JAXBException ex) {
+ 542 0 throw new AnalysisException(ex);
+ 543 0 } catch (Throwable ex) {
+ 544 0 throw new AnalysisException(ex);
+ 545 1 }
+ 546 1 return model;
+ 547
+ }
+ 548
+
+ 549
+
550
- }
- 551
-
- 552
-
- 553
- 554
+ 551
- 555
+ 552
- 556
+ 553
- 557
+ 554
- 558
+ 555
- 559
+ 556
- 560
+ 557
- 561
+ 558
- 562
+ 559
private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, ArrayList<ClassNameInformation> classes) {
- 563 0 boolean foundSomething = false ;
- 564 0 if (pom == null ) {
- 565 0 return foundSomething;
- 566
+ 560 1 boolean foundSomething = false ;
+ 561 1 if (pom == null ) {
+ 562 0 return foundSomething;
+ 563
}
- 567 0 String groupid = interpolateString(pom.getGroupId(), pomProperties);
- 568 0 if (groupid != null && !groupid.isEmpty()) {
- 569 0 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
- 570 0 groupid = groupid.substring(4);
- 571
+ 564 1 String groupid = interpolateString(pom.getGroupId(), pomProperties);
+ 565 1 if (groupid != null && !groupid.isEmpty()) {
+ 566 1 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
+ 567 1 groupid = groupid.substring(4);
+ 568
}
- 572 0 foundSomething = true ;
- 573 0 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGH);
- 574 0 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
- 575 0 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
- 576 0 addMatchingValues(classes, groupid, dependency.getProductEvidence());
- 577
+ 569 1 foundSomething = true ;
+ 570 1 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGH);
+ 571 1 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 572 1 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
+ 573 1 addMatchingValues(classes, groupid, dependency.getProductEvidence());
+ 574
}
- 578 0 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
- 579 0 if (artifactid != null && !artifactid.isEmpty()) {
- 580 0 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
- 581 0 artifactid = artifactid.substring(4);
- 582
+ 575 1 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
+ 576 1 if (artifactid != null && !artifactid.isEmpty()) {
+ 577 1 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+ 578 0 artifactid = artifactid.substring(4);
+ 579
}
- 583 0 foundSomething = true ;
- 584 0 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGH);
- 585 0 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
- 586 0 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
- 587 0 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
- 588
+ 580 1 foundSomething = true ;
+ 581 1 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGH);
+ 582 1 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+ 583 1 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
+ 584 1 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
+ 585
}
- 589
+ 586
- 590 0 final String version = interpolateString(pom.getVersion(), pomProperties);
- 591 0 if (version != null && !version.isEmpty()) {
- 592 0 foundSomething = true ;
- 593 0 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
- 594
+ 587 1 final String version = interpolateString(pom.getVersion(), pomProperties);
+ 588 1 if (version != null && !version.isEmpty()) {
+ 589 0 foundSomething = true ;
+ 590 0 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+ 591
}
- 595
+ 592
- 596 0 final Organization org = pom.getOrganization();
- 597 0 if (org != null && org.getName() != null ) {
- 598 0 foundSomething = true ;
- 599 0 final String orgName = interpolateString(org.getName(), pomProperties);
- 600 0 if (orgName != null && !orgName.isEmpty()) {
- 601 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
- 602 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
- 603
+ 593 1 final Organization org = pom.getOrganization();
+ 594 1 if (org != null && org.getName() != null ) {
+ 595 0 foundSomething = true ;
+ 596 0 final String orgName = interpolateString(org.getName(), pomProperties);
+ 597 0 if (orgName != null && !orgName.isEmpty()) {
+ 598 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+ 599 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
+ 600
}
- 604
+ 601
}
- 605
+ 602
- 606 0 final String pomName = interpolateString(pom.getName(), pomProperties);
- 607 0 if (pomName != null && !pomName.isEmpty()) {
- 608 0 foundSomething = true ;
- 609 0 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 610 0 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 611 0 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
- 612 0 addMatchingValues(classes, pomName, dependency.getProductEvidence());
- 613
+ 603 1 final String pomName = interpolateString(pom.getName(), pomProperties);
+ 604 1 if (pomName != null && !pomName.isEmpty()) {
+ 605 1 foundSomething = true ;
+ 606 1 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 607 1 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 608 1 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
+ 609 1 addMatchingValues(classes, pomName, dependency.getProductEvidence());
+ 610
}
- 614
+ 611
- 615
+ 612
- 616 0 if (pom.getDescription() != null ) {
- 617 0 foundSomething = true ;
- 618 0 final String description = interpolateString(pom.getDescription(), pomProperties);
- 619 0 if (description != null && !description.isEmpty()) {
- 620 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
- 621 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
- 622 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
- 623
+ 613 1 if (pom.getDescription() != null ) {
+ 614 0 foundSomething = true ;
+ 615 0 final String description = interpolateString(pom.getDescription(), pomProperties);
+ 616 0 if (description != null && !description.isEmpty()) {
+ 617 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
+ 618 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
+ 619 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
+ 620
}
- 624
+ 621
}
- 625 0 extractLicense(pom, pomProperties, dependency);
- 626 0 return foundSomething;
- 627
+ 622 1 extractLicense(pom, pomProperties, dependency);
+ 623 1 return foundSomething;
+ 624
}
- 628
+ 625
- 629
+ 626
- 630
+ 627
- 631
+ 628
- 632
+ 629
- 633
+ 630
- 634
+ 631
- 635
+ 632
- 636
+ 633
- 637
+ 634
protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
- 638
+ 635
Dependency dependency, boolean addPackagesAsEvidence) {
- 639 0 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
- 640 0 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
- 641 0 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
- 642
+ 636 5 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
+ 637 5 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
+ 638 5 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+ 639
- 643 0 final int classCount = classNames.size();
- 644 0 final EvidenceCollection vendor = dependency.getVendorEvidence();
- 645 0 final EvidenceCollection product = dependency.getProductEvidence();
- 646
+ 640 5 final int classCount = classNames.size();
+ 641 5 final EvidenceCollection vendor = dependency.getVendorEvidence();
+ 642 5 final EvidenceCollection product = dependency.getProductEvidence();
+ 643
- 647 0 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
- 648 0 final float ratio = entry.getValue() / (float ) classCount;
- 649 0 if (ratio > 0.5) {
- 650
+ 644 5 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
+ 645 48 final float ratio = entry.getValue() / (float ) classCount;
+ 646 48 if (ratio > 0.5) {
+ 647
- 651 0 vendor.addWeighting(entry.getKey());
- 652 0 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 653 0 vendor.addEvidence("jar" , "package" , entry.getKey(), Confidence.LOW);
- 654
+ 648 10 vendor.addWeighting(entry.getKey());
+ 649 10 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 650 8 vendor.addEvidence("jar" , "package" , entry.getKey(), Confidence.LOW);
+ 651
}
- 655
+ 652
}
- 656 0 }
- 657 0 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
- 658 0 final float ratio = entry.getValue() / (float ) classCount;
- 659 0 if (ratio > 0.5) {
- 660 0 product.addWeighting(entry.getKey());
- 661 0 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 662 0 product.addEvidence("jar" , "package" , entry.getKey(), Confidence.LOW);
- 663
+ 653 48 }
+ 654 5 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
+ 655 985 final float ratio = entry.getValue() / (float ) classCount;
+ 656 985 if (ratio > 0.5) {
+ 657 5 product.addWeighting(entry.getKey());
+ 658 5 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 659 4 product.addEvidence("jar" , "package" , entry.getKey(), Confidence.LOW);
+ 660
}
+ 661
+ }
+ 662 985 }
+ 663 5 }
664
- }
- 665 0 }
- 666 0 }
- 667
- 668
+ 665
- 669
+ 666
- 670
+ 667
- 671
+ 668
- 672
+ 669
- 673
+ 670
- 674
+ 671
- 675
+ 672
- 676
+ 673
- 677
+ 674
- 678
+ 675
- 679
+ 676
- 680
+ 677
- 681
+ 678
- 682
+ 679
protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
- 683 0 boolean foundSomething = false ;
- 684 0 JarFile jar = null ;
- 685
+ 680 5 boolean foundSomething = false ;
+ 681 5 JarFile jar = null ;
+ 682
try {
- 686 0 jar = new JarFile(dependency.getActualFilePath());
- 687
+ 683 5 jar = new JarFile(dependency.getActualFilePath());
+ 684
- 688 0 final Manifest manifest = jar.getManifest();
- 689
+ 685 5 final Manifest manifest = jar.getManifest();
+ 686
- 690 0 if (manifest == null ) {
- 691
+ 687 5 if (manifest == null ) {
+ 688
- 692 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
- 693
+ 689 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
+ 690
&& !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
- 694
+ 691
&& !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
- 695
+ 692
&& !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
- 696 0 Logger.getLogger(JarAnalyzer.class
- 697
- .getName()).log(Level.INFO,
- 698
- String.format("Jar file '%s' does not contain a manifest." ,
- 699
- dependency.getFileName()));
- 700
+ 693 0 LOGGER.log(Level.INFO,
+ 694
+ String.format("Jar file '%s' does not contain a manifest." ,
+ 695
+ dependency.getFileName()));
+ 696
}
- 701 0 return false ;
- 702
+ 697 0 return false ;
+ 698
}
- 703 0 final Attributes atts = manifest.getMainAttributes();
+ 699 5 final Attributes atts = manifest.getMainAttributes();
+ 700
+
+ 701 5 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
+ 702 5 final EvidenceCollection productEvidence = dependency.getProductEvidence();
+ 703 5 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
704
- 705 0 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
- 706 0 final EvidenceCollection productEvidence = dependency.getProductEvidence();
- 707 0 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
- 708
+ 705 5 final String source = "Manifest" ;
+ 706
- 709 0 final String source = "Manifest" ;
- 710
-
- 711 0 for (Entry<Object, Object> entry : atts.entrySet()) {
- 712 0 String key = entry.getKey().toString();
- 713 0 String value = atts.getValue(key);
- 714 0 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
- 715 0 value = Jsoup.parse(value).text();
- 716
+ 707 5 for (Entry<Object, Object> entry : atts.entrySet()) {
+ 708 65 String key = entry.getKey().toString();
+ 709 65 String value = atts.getValue(key);
+ 710 65 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
+ 711 0 value = Jsoup.parse(value).text();
+ 712
}
- 717 0 if (IGNORE_VALUES.contains(value)) {
- 718 0 continue ;
- 719 0 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
- 720 0 foundSomething = true ;
- 721 0 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 722 0 addMatchingValues(classInformation, value, productEvidence);
- 723 0 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
- 724 0 foundSomething = true ;
- 725 0 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 726 0 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+ 713 65 if (IGNORE_VALUES.contains(value)) {
+ 714 0 continue ;
+ 715 65 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
+ 716 1 foundSomething = true ;
+ 717 1 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 718 1 addMatchingValues(classInformation, value, productEvidence);
+ 719 64 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
+ 720 2 foundSomething = true ;
+ 721 2 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 722 62 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+ 723 1 foundSomething = true ;
+ 724 1 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 725 1 addMatchingValues(classInformation, value, vendorEvidence);
+ 726 61 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
727 0 foundSomething = true ;
- 728 0 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 728 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
729 0 addMatchingValues(classInformation, value, vendorEvidence);
- 730 0 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
- 731 0 foundSomething = true ;
- 732 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 733 0 addMatchingValues(classInformation, value, vendorEvidence);
- 734 0 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
- 735 0 foundSomething = true ;
- 736 0 addDescription(dependency, value, "manifest" , key);
- 737
+ 730 61 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
+ 731 2 foundSomething = true ;
+ 732 2 addDescription(dependency, value, "manifest" , key);
+ 733
- 738 0 addMatchingValues(classInformation, value, productEvidence);
- 739 0 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
- 740 0 foundSomething = true ;
- 741 0 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 742 0 addMatchingValues(classInformation, value, productEvidence);
- 743 0 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
- 744 0 foundSomething = true ;
- 745 0 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 746 0 addMatchingValues(classInformation, value, vendorEvidence);
- 747 0 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
- 748 0 foundSomething = true ;
- 749 0 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 750 0 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
- 751 0 continue ;
- 752
+ 734 2 addMatchingValues(classInformation, value, productEvidence);
+ 735 59 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
+ 736 3 foundSomething = true ;
+ 737 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 738 3 addMatchingValues(classInformation, value, productEvidence);
+ 739 56 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
+ 740 3 foundSomething = true ;
+ 741 3 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 742 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 743 53 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
+ 744 3 foundSomething = true ;
+ 745 3 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 746 50 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
+ 747 2 continue ;
+ 748
- 753
+ 749
- 754
+ 750
- 755
+ 751
- 756
+ 752
- 757
+ 753
- 758
+ 754
- 759
+ 755
- 760
+ 756
} else {
- 761 0 key = key.toLowerCase();
- 762
+ 757 48 key = key.toLowerCase();
+ 758
- 763 0 if (!IGNORE_KEYS.contains(key)
- 764
+ 759 48 if (!IGNORE_KEYS.contains(key)
+ 760
&& !key.endsWith("jdk" )
- 765
+ 761
&& !key.contains("lastmodified" )
- 766
+ 762
&& !key.endsWith("package" )
- 767
+ 763
&& !key.endsWith("classpath" )
- 768
+ 764
&& !key.endsWith("class-path" )
- 769
+ 765
&& !key.endsWith("-scm" )
- 770
+ 766
&& !key.startsWith("scm-" )
- 771
+ 767
&& !isImportPackage(key, value)
- 772
+ 768
&& !isPackage(key, value)) {
- 773
+ 769
- 774 0 foundSomething = true ;
- 775 0 if (key.contains("version" )) {
- 776 0 if (key.contains("specification" )) {
- 777 0 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
- 778
+ 770 14 foundSomething = true ;
+ 771 14 if (key.contains("version" )) {
+ 772 1 if (key.contains("specification" )) {
+ 773 1 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 774
} else {
- 779 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 780
+ 775 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 776
}
- 781 0 } else if ("build-id" .equals(key)) {
- 782 0 int pos = value.indexOf('(' );
+ 777 13 } else if ("build-id" .equals(key)) {
+ 778 0 int pos = value.indexOf('(' );
+ 779 0 if (pos >= 0) {
+ 780 0 value = value.substring(0, pos - 1);
+ 781
+ }
+ 782 0 pos = value.indexOf('[' );
783 0 if (pos >= 0) {
784 0 value = value.substring(0, pos - 1);
785
}
- 786 0 pos = value.indexOf('[' );
- 787 0 if (pos >= 0) {
- 788 0 value = value.substring(0, pos - 1);
- 789
- }
- 790 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 791 0 } else if (key.contains("title" )) {
- 792 0 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 793 0 addMatchingValues(classInformation, value, productEvidence);
- 794 0 } else if (key.contains("vendor" )) {
- 795 0 if (key.contains("specification" )) {
- 796 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 797
+ 786 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 787 0 } else if (key.contains("title" )) {
+ 788 1 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 789 1 addMatchingValues(classInformation, value, productEvidence);
+ 790 12 } else if (key.contains("vendor" )) {
+ 791 0 if (key.contains("specification" )) {
+ 792 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 793
} else {
- 798 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 799 0 addMatchingValues(classInformation, value, vendorEvidence);
- 800
+ 794 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 795 0 addMatchingValues(classInformation, value, vendorEvidence);
+ 796
}
- 801 0 } else if (key.contains("name" )) {
- 802 0 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 803 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 804 0 addMatchingValues(classInformation, value, vendorEvidence);
- 805 0 addMatchingValues(classInformation, value, productEvidence);
- 806 0 } else if (key.contains("license" )) {
- 807 0 addLicense(dependency, value);
- 808
+ 797 12 } else if (key.contains("name" )) {
+ 798 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 799 3 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 800 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 801 3 addMatchingValues(classInformation, value, productEvidence);
+ 802 9 } else if (key.contains("license" )) {
+ 803 2 addLicense(dependency, value);
+ 804
} else {
- 809 0 if (key.contains("description" )) {
- 810 0 addDescription(dependency, value, "manifest" , key);
- 811
+ 805 7 if (key.contains("description" )) {
+ 806 0 addDescription(dependency, value, "manifest" , key);
+ 807
} else {
- 812 0 productEvidence.addEvidence(source, key, value, Confidence.LOW);
- 813 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 814 0 addMatchingValues(classInformation, value, vendorEvidence);
- 815 0 addMatchingValues(classInformation, value, productEvidence);
- 816 0 if (value.matches(".*\\d.*" )) {
- 817 0 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
- 818 0 while (tokenizer.hasMoreElements()) {
- 819 0 final String s = tokenizer.nextToken();
- 820 0 if (s.matches("^[0-9.]+$" )) {
- 821 0 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
- 822
+ 808 7 productEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 809 7 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 810 7 addMatchingValues(classInformation, value, vendorEvidence);
+ 811 7 addMatchingValues(classInformation, value, productEvidence);
+ 812 7 if (value.matches(".*\\d.*" )) {
+ 813 3 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
+ 814 15 while (tokenizer.hasMoreElements()) {
+ 815 12 final String s = tokenizer.nextToken();
+ 816 12 if (s.matches("^[0-9.]+$" )) {
+ 817 1 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
+ 818
}
- 823 0 }
- 824
+ 819 12 }
+ 820
}
- 825
+ 821
}
- 826
+ 822
}
- 827
+ 823
}
- 828
+ 824
}
- 829 0 }
- 830
+ 825 63 }
+ 826
} finally {
- 831 0 if (jar != null ) {
- 832 0 jar.close();
+ 827 5 if (jar != null ) {
+ 828 5 jar.close();
+ 829
+ }
+ 830
+ }
+ 831 5 return foundSomething;
+ 832
+ }
833
- }
+
834
- }
- 835 0 return foundSomething;
- 836
- }
- 837
-
- 838
- 839
+ 835
- 840
+ 836
- 841
+ 837
- 842
+ 838
- 843
+ 839
- 844
+ 840
- 845
+ 841
- 846
+ 842
- 847
+ 843
- 848
+ 844
- 849
+ 845
- 850
+ 846
private String addDescription(Dependency dependency, String description, String source, String key) {
- 851 0 if (dependency.getDescription() == null ) {
- 852 0 dependency.setDescription(description);
- 853
+ 847 2 if (dependency.getDescription() == null ) {
+ 848 2 dependency.setDescription(description);
+ 849
}
- 854
+ 850
String desc;
- 855 0 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
- 856 0 desc = Jsoup.parse(description).text();
- 857
+ 851 2 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
+ 852 0 desc = Jsoup.parse(description).text();
+ 853
} else {
- 858 0 desc = description;
- 859
+ 854 2 desc = description;
+ 855
}
- 860 0 dependency.setDescription(desc);
- 861 0 if (desc.length() > 100) {
- 862 0 desc = desc.replaceAll("\\s\\s+" , " " );
- 863 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
- 864 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
- 865 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
- 866 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
- 867 0 int pos = -1;
- 868 0 pos = Math.max(pos, posSuchAs);
- 869 0 if (pos >= 0 && posLike >= 0) {
- 870 0 pos = Math.min(pos, posLike);
- 871
+ 856 2 dependency.setDescription(desc);
+ 857 2 if (desc.length() > 100) {
+ 858 0 desc = desc.replaceAll("\\s\\s+" , " " );
+ 859 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
+ 860 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
+ 861 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
+ 862 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
+ 863 0 int pos = -1;
+ 864 0 pos = Math.max(pos, posSuchAs);
+ 865 0 if (pos >= 0 && posLike >= 0) {
+ 866 0 pos = Math.min(pos, posLike);
+ 867
} else {
- 872 0 pos = Math.max(pos, posLike);
- 873
+ 868 0 pos = Math.max(pos, posLike);
+ 869
}
- 874 0 if (pos >= 0 && posWillUse >= 0) {
- 875 0 pos = Math.min(pos, posWillUse);
- 876
+ 870 0 if (pos >= 0 && posWillUse >= 0) {
+ 871 0 pos = Math.min(pos, posWillUse);
+ 872
} else {
- 877 0 pos = Math.max(pos, posWillUse);
- 878
+ 873 0 pos = Math.max(pos, posWillUse);
+ 874
}
- 879 0 if (pos >= 0 && posUses >= 0) {
- 880 0 pos = Math.min(pos, posUses);
- 881
+ 875 0 if (pos >= 0 && posUses >= 0) {
+ 876 0 pos = Math.min(pos, posUses);
+ 877
} else {
- 882 0 pos = Math.max(pos, posUses);
- 883
+ 878 0 pos = Math.max(pos, posUses);
+ 879
}
- 884
+ 880
- 885 0 if (pos > 0) {
- 886 0 final StringBuilder sb = new StringBuilder(pos + 3);
- 887 0 sb.append(desc.substring(0, pos));
- 888 0 sb.append("..." );
- 889 0 desc = sb.toString();
- 890
+ 881 0 if (pos > 0) {
+ 882 0 final StringBuilder sb = new StringBuilder(pos + 3);
+ 883 0 sb.append(desc.substring(0, pos));
+ 884 0 sb.append("..." );
+ 885 0 desc = sb.toString();
+ 886
}
- 891 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 892 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 893 0 } else {
- 894 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
- 895 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
- 896
+ 887 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 888 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 889 0 } else {
+ 890 2 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 891 2 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 892
}
- 897 0 return desc;
- 898
+ 893 2 return desc;
+ 894
}
- 899
+ 895
- 900
+ 896
- 901
+ 897
- 902
+ 898
- 903
+ 899
- 904
+ 900
- 905
+ 901
- 906
+ 902
private void addLicense(Dependency d, String license) {
- 907 0 if (d.getLicense() == null ) {
- 908 0 d.setLicense(license);
- 909 0 } else if (!d.getLicense().contains(license)) {
- 910 0 d.setLicense(d.getLicense() + NEWLINE + license);
+ 903 2 if (d.getLicense() == null ) {
+ 904 2 d.setLicense(license);
+ 905 0 } else if (!d.getLicense().contains(license)) {
+ 906 0 d.setLicense(d.getLicense() + NEWLINE + license);
+ 907
+ }
+ 908 2 }
+ 909
+
+ 910
+
911
- }
- 912 0 }
- 913
-
- 914
-
- 915
+ 912
+
+ 913 7 private File tempFileLocation = null ;
+ 914
+
+ 915
+
916
-
- 917 0 private File tempFileLocation = null ;
- 918
-
- 919
-
- 920
- 921
+ 917
- 922
+ 918
- 923
+ 919
- 924
+ 920
@Override
- 925
+ 921
public void initializeFileTypeAnalyzer() throws Exception {
- 926 0 final File baseDir = Settings.getTempDirectory();
- 927 0 if (!baseDir.exists()) {
- 928 0 if (!baseDir.mkdirs()) {
- 929 0 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
- 930 0 throw new AnalysisException(msg);
+ 922 1 final File baseDir = Settings.getTempDirectory();
+ 923 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+ 924 1 if (!tempFileLocation.delete()) {
+ 925 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+ 926 0 throw new AnalysisException(msg);
+ 927
+ }
+ 928 1 if (!tempFileLocation.mkdirs()) {
+ 929 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+ 930 0 throw new AnalysisException(msg);
931
- }
- 932
}
- 933 0 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
- 934 0 if (!tempFileLocation.delete()) {
- 935 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
- 936 0 throw new AnalysisException(msg);
- 937
- }
- 938 0 if (!tempFileLocation.mkdirs()) {
- 939 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
- 940 0 throw new AnalysisException(msg);
- 941
- }
- 942 0 }
- 943
+ 932 1 }
+ 933
- 944
+ 934
- 945
+ 935
- 946
+ 936
- 947
+ 937
@Override
- 948
+ 938
public void close() {
- 949 0 if (tempFileLocation != null && tempFileLocation.exists()) {
- 950 0 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
- 951 0 final boolean success = FileUtils.delete(tempFileLocation);
- 952 0 if (!success) {
- 953 0 LOGGER.log(Level.WARNING,
- 954
+ 939 1 if (tempFileLocation != null && tempFileLocation.exists()) {
+ 940 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
+ 941 1 final boolean success = FileUtils.delete(tempFileLocation);
+ 942 1 if (!success) {
+ 943 0 LOGGER.log(Level.WARNING,
+ 944
"Failed to delete some temporary files, see the log for more details" );
- 955
+ 945
}
- 956
+ 946
}
- 957 0 }
- 958
+ 947 1 }
+ 948
- 959
+ 949
- 960
+ 950
- 961
+ 951
- 962
+ 952
- 963
+ 953
- 964
+ 954
- 965
+ 955
- 966
+ 956
- 967
+ 957
- 968
+ 958
- 969
+ 959
- 970
+ 960
- 971
+ 961
- 972
+ 962
- 973
+ 963
- 974
+ 964
- 975
+ 965
- 976
+ 966
- 977
+ 967
- 978
+ 968
- 979
+ 969
- 980
+ 970
- 981
+ 971
- 982
+ 972
- 983
+ 973
- 984
+ 974
- 985
+ 975
- 986
+ 976
protected String interpolateString(String text, Properties properties) {
- 987 0 Properties props = properties;
- 988 0 if (text == null ) {
- 989 0 return text;
- 990
+ 977 11 Properties props = properties;
+ 978 11 if (text == null ) {
+ 979 1 return text;
+ 980
}
- 991 0 if (props == null ) {
- 992 0 props = new Properties();
- 993
+ 981 10 if (props == null ) {
+ 982 3 props = new Properties();
+ 983
}
- 994
+ 984
- 995 0 final int pos = text.indexOf("${" );
- 996 0 if (pos < 0) {
- 997 0 return text;
+ 985 10 final int pos = text.indexOf("${" );
+ 986 10 if (pos < 0) {
+ 987 7 return text;
+ 988
+ }
+ 989 3 final int end = text.indexOf("}" );
+ 990 3 if (end < pos) {
+ 991 0 return text;
+ 992
+ }
+ 993
+
+ 994 3 final String propName = text.substring(pos + 2, end);
+ 995 3 String propValue = interpolateString(props.getProperty(propName), props);
+ 996 3 if (propValue == null ) {
+ 997 0 propValue = "" ;
998
}
- 999 0 final int end = text.indexOf("}" );
- 1000 0 if (end < pos) {
- 1001 0 return text;
- 1002
- }
- 1003
-
- 1004 0 final String propName = text.substring(pos + 2, end);
- 1005 0 String propValue = interpolateString(props.getProperty(propName), props);
- 1006 0 if (propValue == null ) {
- 1007 0 propValue = "" ;
- 1008
- }
- 1009 0 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
- 1010 0 sb.append(text.subSequence(0, pos));
- 1011 0 sb.append(propValue);
- 1012 0 sb.append(text.substring(end + 1));
- 1013 0 return interpolateString(sb.toString(), props);
- 1014
+ 999 3 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
+ 1000 3 sb.append(text.subSequence(0, pos));
+ 1001 3 sb.append(propValue);
+ 1002 3 sb.append(text.substring(end + 1));
+ 1003 3 return interpolateString(sb.toString(), props);
+ 1004
}
- 1015
+ 1005
- 1016
+ 1006
- 1017
+ 1007
- 1018
+ 1008
- 1019
+ 1009
- 1020
+ 1010
- 1021
+ 1011
- 1022
+ 1012
- 1023
+ 1013
private boolean isImportPackage(String key, String value) {
- 1024 0 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
- 1025 0 final boolean matches = packageRx.matcher(value).matches();
- 1026 0 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
- 1027
+ 1014 15 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
+ 1015 15 final boolean matches = packageRx.matcher(value).matches();
+ 1016 15 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
+ 1017
}
- 1028
+ 1018
- 1029
+ 1019
- 1030
+ 1020
- 1031
+ 1021
- 1032
+ 1022
- 1033
+ 1023
- 1034
+ 1024
- 1035
+ 1025
- 1036
+ 1026
private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
- 1037 0 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
- 1038 0 JarFile jar = null ;
- 1039
+ 1027 5 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
+ 1028 5 JarFile jar = null ;
+ 1029
try {
- 1040 0 jar = new JarFile(dependency.getActualFilePath());
- 1041 0 final Enumeration entries = jar.entries();
- 1042 0 while (entries.hasMoreElements()) {
- 1043 0 final JarEntry entry = (JarEntry) entries.nextElement();
- 1044 0 final String name = entry.getName().toLowerCase();
- 1045
+ 1030 5 jar = new JarFile(dependency.getActualFilePath());
+ 1031 5 final Enumeration entries = jar.entries();
+ 1032 1848 while (entries.hasMoreElements()) {
+ 1033 1843 final JarEntry entry = (JarEntry) entries.nextElement();
+ 1034 1843 final String name = entry.getName().toLowerCase();
+ 1035
- 1046 0 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
- 1047 0 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
- 1048 0 classNames.add(className);
- 1049
+ 1036 1843 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
+ 1037 1535 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
+ 1038 1535 classNames.add(className);
+ 1039
}
- 1050 0 }
- 1051 0 } catch (IOException ex) {
- 1052 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
- 1053 0 Logger
- 1054
- .getLogger(JarAnalyzer.class
- 1055
- .getName()).log(Level.WARNING, msg);
- 1056 0 Logger.getLogger(JarAnalyzer.class
- 1057
- .getName()).log(Level.FINE, null , ex);
- 1058
+ 1040 1843 }
+ 1041 0 } catch (IOException ex) {
+ 1042 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
+ 1043 0 LOGGER.log(Level.WARNING, msg);
+ 1044 0 LOGGER.log(Level.FINE, null , ex);
+ 1045
} finally {
- 1059 0 if (jar != null ) {
- 1060
+ 1046 5 if (jar != null ) {
+ 1047
try {
- 1061 0 jar.close();
- 1062 0 } catch (IOException ex) {
- 1063 0 LOGGER.log(Level.FINEST, null , ex);
- 1064 0 }
- 1065
+ 1048 5 jar.close();
+ 1049 0 } catch (IOException ex) {
+ 1050 0 LOGGER.log(Level.FINEST, null , ex);
+ 1051 5 }
+ 1052
}
- 1066
+ 1053
}
- 1067 0 return classNames;
- 1068
+ 1054 5 return classNames;
+ 1055
}
- 1069
+ 1056
- 1070
+ 1057
- 1071
+ 1058
- 1072
+ 1059
- 1073
+ 1060
- 1074
+ 1061
- 1075
+ 1062
- 1076
+ 1063
- 1077
+ 1064
- 1078
+ 1065
private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
- 1079
+ 1066
HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
- 1080 0 for (ClassNameInformation entry : classNames) {
- 1081 0 final ArrayList<String> list = entry.getPackageStructure();
- 1082 0 addEntry(vendor, list.get(0));
- 1083
+ 1067 5 for (ClassNameInformation entry : classNames) {
+ 1068 1535 final ArrayList<String> list = entry.getPackageStructure();
+ 1069 1535 addEntry(vendor, list.get(0));
+ 1070
- 1084 0 if (list.size() == 2) {
- 1085 0 addEntry(product, list.get(1));
- 1086
+ 1071 1535 if (list.size() == 2) {
+ 1072 0 addEntry(product, list.get(1));
+ 1073
}
- 1087 0 if (list.size() == 3) {
- 1088 0 addEntry(vendor, list.get(1));
- 1089 0 addEntry(product, list.get(1));
- 1090 0 addEntry(product, list.get(2));
- 1091
+ 1074 1535 if (list.size() == 3) {
+ 1075 345 addEntry(vendor, list.get(1));
+ 1076 345 addEntry(product, list.get(1));
+ 1077 345 addEntry(product, list.get(2));
+ 1078
}
- 1092 0 if (list.size() >= 4) {
- 1093 0 addEntry(vendor, list.get(1));
- 1094 0 addEntry(vendor, list.get(2));
- 1095 0 addEntry(product, list.get(1));
- 1096 0 addEntry(product, list.get(2));
- 1097 0 addEntry(product, list.get(3));
- 1098
+ 1079 1535 if (list.size() >= 4) {
+ 1080 1190 addEntry(vendor, list.get(1));
+ 1081 1190 addEntry(vendor, list.get(2));
+ 1082 1190 addEntry(product, list.get(1));
+ 1083 1190 addEntry(product, list.get(2));
+ 1084 1190 addEntry(product, list.get(3));
+ 1085
}
- 1099 0 }
- 1100 0 }
- 1101
+ 1086 1535 }
+ 1087 5 }
+ 1088
- 1102
+ 1089
- 1103
+ 1090
- 1104
+ 1091
- 1105
+ 1092
- 1106
+ 1093
- 1107
+ 1094
- 1108
+ 1095
- 1109
+ 1096
private void addEntry(HashMap<String, Integer> collection, String key) {
- 1110 0 if (collection.containsKey(key)) {
- 1111 0 collection.put(key, collection.get(key) + 1);
- 1112
+ 1097 8520 if (collection.containsKey(key)) {
+ 1098 7487 collection.put(key, collection.get(key) + 1);
+ 1099
} else {
- 1113 0 collection.put(key, 1);
- 1114
+ 1100 1033 collection.put(key, 1);
+ 1101
}
- 1115 0 }
- 1116
+ 1102 8520 }
+ 1103
- 1117
+ 1104
- 1118
+ 1105
- 1119
+ 1106
- 1120
+ 1107
- 1121
+ 1108
- 1122
+ 1109
- 1123
+ 1110
- 1124
+ 1111
- 1125
+ 1112
- 1126
+ 1113
private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
- 1127 0 if (value == null || value.isEmpty()) {
- 1128 0 return ;
- 1129
+ 1114 37 if (value == null || value.isEmpty()) {
+ 1115 0 return ;
+ 1116
}
- 1130 0 final String text = value.toLowerCase();
- 1131 0 for (ClassNameInformation cni : classes) {
- 1132 0 for (String key : cni.getPackageStructure()) {
- 1133 0 if (text.contains(key)) {
- 1134 0 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
- 1135
+ 1117 37 final String text = value.toLowerCase();
+ 1118 37 for (ClassNameInformation cni : classes) {
+ 1119 14916 for (String key : cni.getPackageStructure()) {
+ 1120 57504 if (text.contains(key)) {
+ 1121 13816 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
+ 1122
}
- 1136 0 }
- 1137 0 }
- 1138 0 }
- 1139
+ 1123 57504 }
+ 1124 14916 }
+ 1125 37 }
+ 1126
- 1140
+ 1127
- 1141
+ 1128
- 1142
+ 1129
- 1143
+ 1130
- 1144
+ 1131
- 1145
+ 1132
- 1146
+ 1133
- 1147
+ 1134
private boolean isPackage(String key, String value) {
- 1148
+ 1135
- 1149 0 return !key.matches(".*(version|title|vendor|name|license|description).*" )
- 1150
+ 1136 15 return !key.matches(".*(version|title|vendor|name|license|description).*" )
+ 1137
&& value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
- 1151
+ 1138
- 1152
+ 1139
}
- 1153
+ 1140
- 1154
+ 1141
- 1155
+ 1142
- 1156
+ 1143
- 1157
+ 1144
- 1158
+ 1145
- 1159
+ 1146
- 1160
+ 1147
- 1161
+ 1148
- 1162
+ 1149
private void addPomEvidence(Dependency dependency, Model pom, Properties pomProperties) {
- 1163 0 if (pom == null ) {
- 1164 0 return ;
+ 1150 0 if (pom == null ) {
+ 1151 0 return ;
+ 1152
+ }
+ 1153 0 String groupid = interpolateString(pom.getGroupId(), pomProperties);
+ 1154 0 if (groupid != null && !groupid.isEmpty()) {
+ 1155 0 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
+ 1156 0 groupid = groupid.substring(4);
+ 1157
+ }
+ 1158 0 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGH);
+ 1159 0 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 1160
+ }
+ 1161 0 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
+ 1162 0 if (artifactid != null && !artifactid.isEmpty()) {
+ 1163 0 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+ 1164 0 artifactid = artifactid.substring(4);
1165
- }
- 1166 0 String groupid = interpolateString(pom.getGroupId(), pomProperties);
- 1167 0 if (groupid != null && !groupid.isEmpty()) {
- 1168 0 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
- 1169 0 groupid = groupid.substring(4);
- 1170
}
- 1171 0 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGH);
- 1172 0 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 1166 0 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGH);
+ 1167 0 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+ 1168
+ }
+ 1169 0 final String version = interpolateString(pom.getVersion(), pomProperties);
+ 1170 0 if (version != null && !version.isEmpty()) {
+ 1171 0 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+ 1172
+ }
1173
- }
- 1174 0 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
- 1175 0 if (artifactid != null && !artifactid.isEmpty()) {
- 1176 0 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
- 1177 0 artifactid = artifactid.substring(4);
- 1178
- }
- 1179 0 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGH);
- 1180 0 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
- 1181
- }
- 1182 0 final String version = interpolateString(pom.getVersion(), pomProperties);
- 1183 0 if (version != null && !version.isEmpty()) {
- 1184 0 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
- 1185
- }
- 1186
- 1187 0 final Parent parent = pom.getParent();
- 1188 0 if (parent != null ) {
- 1189 0 final String parentGroupId = interpolateString(parent.getGroupId(), pomProperties);
- 1190 0 if (parentGroupId != null && !parentGroupId.isEmpty()) {
- 1191 0 if (groupid == null || groupid.isEmpty()) {
- 1192 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.HIGH);
+ 1174 0 final Parent parent = pom.getParent();
+ 1175 0 if (parent != null ) {
+ 1176 0 final String parentGroupId = interpolateString(parent.getGroupId(), pomProperties);
+ 1177 0 if (parentGroupId != null && !parentGroupId.isEmpty()) {
+ 1178 0 if (groupid == null || groupid.isEmpty()) {
+ 1179 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.HIGH);
+ 1180
+ } else {
+ 1181 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.MEDIUM);
+ 1182
+ }
+ 1183 0 dependency.getProductEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.LOW);
+ 1184
+ }
+ 1185 0 final String parentArtifactId = interpolateString(parent.getArtifactId(), pomProperties);
+ 1186 0 if (parentArtifactId != null && !parentArtifactId.isEmpty()) {
+ 1187 0 if (artifactid == null || artifactid.isEmpty()) {
+ 1188 0 dependency.getProductEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.HIGH);
+ 1189
+ } else {
+ 1190 0 dependency.getProductEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.MEDIUM);
+ 1191
+ }
+ 1192 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.LOW);
1193
- } else {
- 1194 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.MEDIUM);
- 1195
- }
- 1196 0 dependency.getProductEvidence().addEvidence("pom" , "parent.groupid" , parentGroupId, Confidence.LOW);
- 1197
}
- 1198 0 final String parentArtifactId = interpolateString(parent.getArtifactId(), pomProperties);
- 1199 0 if (parentArtifactId != null && !parentArtifactId.isEmpty()) {
- 1200 0 if (artifactid == null || artifactid.isEmpty()) {
- 1201 0 dependency.getProductEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.HIGH);
+ 1194 0 final String parentVersion = interpolateString(parent.getVersion(), pomProperties);
+ 1195 0 if (parentVersion != null && !parentVersion.isEmpty()) {
+ 1196 0 if (version == null || version.isEmpty()) {
+ 1197 0 dependency.getVersionEvidence().addEvidence("pom" , "parent.version" , parentVersion, Confidence.HIGH);
+ 1198
+ } else {
+ 1199 0 dependency.getVersionEvidence().addEvidence("pom" , "parent.version" , parentVersion, Confidence.LOW);
+ 1200
+ }
+ 1201
+ }
1202
- } else {
- 1203 0 dependency.getProductEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.MEDIUM);
- 1204
- }
- 1205 0 dependency.getVendorEvidence().addEvidence("pom" , "parent.artifactid" , parentArtifactId, Confidence.LOW);
- 1206
- }
- 1207 0 final String parentVersion = interpolateString(parent.getVersion(), pomProperties);
- 1208 0 if (parentVersion != null && !parentVersion.isEmpty()) {
- 1209 0 if (version == null || version.isEmpty()) {
- 1210 0 dependency.getVersionEvidence().addEvidence("pom" , "parent.version" , parentVersion, Confidence.HIGH);
- 1211
- } else {
- 1212 0 dependency.getVersionEvidence().addEvidence("pom" , "parent.version" , parentVersion, Confidence.LOW);
- 1213
- }
- 1214
- }
- 1215
}
- 1216
+ 1203
- 1217 0 final Organization org = pom.getOrganization();
- 1218 0 if (org != null && org.getName() != null ) {
- 1219 0 final String orgName = interpolateString(org.getName(), pomProperties);
- 1220 0 if (orgName != null && !orgName.isEmpty()) {
- 1221 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
- 1222
+ 1204 0 final Organization org = pom.getOrganization();
+ 1205 0 if (org != null && org.getName() != null ) {
+ 1206 0 final String orgName = interpolateString(org.getName(), pomProperties);
+ 1207 0 if (orgName != null && !orgName.isEmpty()) {
+ 1208 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+ 1209
}
- 1223
+ 1210
}
- 1224
+ 1211
- 1225 0 final String pomName = interpolateString(pom.getName(), pomProperties);
- 1226 0 if (pomName != null && !pomName.isEmpty()) {
- 1227 0 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 1228 0 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 1229
+ 1212 0 final String pomName = interpolateString(pom.getName(), pomProperties);
+ 1213 0 if (pomName != null && !pomName.isEmpty()) {
+ 1214 0 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 1215 0 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 1216
}
- 1230
+ 1217
- 1231
+ 1218
- 1232 0 if (pom.getDescription() != null ) {
- 1233 0 final String description = interpolateString(pom.getDescription(), pomProperties);
- 1234 0 if (description != null && !description.isEmpty()) {
- 1235 0 addDescription(dependency, description, "pom" , "description" );
- 1236
+ 1219 0 if (pom.getDescription() != null ) {
+ 1220 0 final String description = interpolateString(pom.getDescription(), pomProperties);
+ 1221 0 if (description != null && !description.isEmpty()) {
+ 1222 0 addDescription(dependency, description, "pom" , "description" );
+ 1223
}
- 1237
+ 1224
}
- 1238 0 extractLicense(pom, pomProperties, dependency);
- 1239 0 }
- 1240
+ 1225 0 extractLicense(pom, pomProperties, dependency);
+ 1226 0 }
+ 1227
- 1241
+ 1228
- 1242
+ 1229
- 1243
+ 1230
- 1244
+ 1231
- 1245
+ 1232
- 1246
+ 1233
- 1247
+ 1234
- 1248
+ 1235
private void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
- 1249
+ 1236
- 1250 0 if (pom.getLicenses() != null ) {
- 1251 0 String license = null ;
- 1252 0 for (License lic : pom.getLicenses().getLicense()) {
- 1253 0 String tmp = null ;
- 1254 0 if (lic.getName() != null ) {
- 1255 0 tmp = interpolateString(lic.getName(), pomProperties);
+ 1237 1 if (pom.getLicenses() != null ) {
+ 1238 0 String license = null ;
+ 1239 0 for (License lic : pom.getLicenses().getLicense()) {
+ 1240 0 String tmp = null ;
+ 1241 0 if (lic.getName() != null ) {
+ 1242 0 tmp = interpolateString(lic.getName(), pomProperties);
+ 1243
+ }
+ 1244 0 if (lic.getUrl() != null ) {
+ 1245 0 if (tmp == null ) {
+ 1246 0 tmp = interpolateString(lic.getUrl(), pomProperties);
+ 1247
+ } else {
+ 1248 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
+ 1249
+ }
+ 1250
+ }
+ 1251 0 if (tmp == null ) {
+ 1252 0 continue ;
+ 1253
+ }
+ 1254 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
+ 1255 0 tmp = Jsoup.parse(tmp).text();
1256
}
- 1257 0 if (lic.getUrl() != null ) {
- 1258 0 if (tmp == null ) {
- 1259 0 tmp = interpolateString(lic.getUrl(), pomProperties);
- 1260
- } else {
- 1261 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
- 1262
- }
- 1263
- }
- 1264 0 if (tmp == null ) {
- 1265 0 continue ;
- 1266
- }
- 1267 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
- 1268 0 tmp = Jsoup.parse(tmp).text();
- 1269
- }
- 1270 0 if (license == null ) {
- 1271 0 license = tmp;
- 1272
+ 1257 0 if (license == null ) {
+ 1258 0 license = tmp;
+ 1259
} else {
- 1273 0 license += "\n" + tmp;
- 1274
+ 1260 0 license += "\n" + tmp;
+ 1261
}
- 1275 0 }
- 1276 0 if (license != null ) {
- 1277 0 dependency.setLicense(license);
- 1278
+ 1262 0 }
+ 1263 0 if (license != null ) {
+ 1264 0 dependency.setLicense(license);
+ 1265
}
- 1279
+ 1266
}
- 1280 0 }
- 1281
+ 1267 1 }
+ 1268
- 1282
+ 1269
- 1283
+ 1270
- 1284
+ 1271
- 1285
+ 1272
protected static class ClassNameInformation {
- 1286
+ 1273
- 1287
+ 1274
- 1288
+ 1275
- 1289
+ 1276
- 1290
+ 1277
- 1291
+ 1278
- 1292
+ 1279
- 1293
+ 1280
- 1294
+ 1281
- 1295
+ 1282
- 1296
+ 1283
- 1297
+ 1284
- 1298
+ 1285
- 1299
+ 1286
- 1300
+ 1287
- 1301
+ 1288
- 1302
+ 1289
- 1303
+ 1290
- 1304
+ 1291
- 1305
+ 1292
+ 1293
+
+ 1294 1535 ClassNameInformation(String className) {
+ 1295 1535 name = className;
+ 1296 1535 if (name.contains("/" )) {
+ 1297 1535 final String[] tmp = className.toLowerCase().split("/" );
+ 1298 1535 int start = 0;
+ 1299 1535 int end = 3;
+ 1300 1535 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
+ 1301 1535 start = 1;
+ 1302 1535 end = 4;
+ 1303
+ }
+ 1304 1535 if (tmp.length <= end) {
+ 1305 345 end = tmp.length - 1;
1306
-
- 1307 0 ClassNameInformation(String className) {
- 1308 0 name = className;
- 1309 0 if (name.contains("/" )) {
- 1310 0 final String[] tmp = className.toLowerCase().split("/" );
- 1311 0 int start = 0;
- 1312 0 int end = 3;
- 1313 0 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
- 1314 0 start = 1;
- 1315 0 end = 4;
- 1316
}
- 1317 0 if (tmp.length <= end) {
- 1318 0 end = tmp.length - 1;
- 1319
+ 1307 7330 for (int i = start; i <= end; i++) {
+ 1308 5795 packageStructure.add(tmp[i]);
+ 1309
}
- 1320 0 for (int i = start; i <= end; i++) {
- 1321 0 packageStructure.add(tmp[i]);
- 1322
- }
- 1323 0 } else {
- 1324 0 packageStructure.add(name);
- 1325
+ 1310 1535 } else {
+ 1311 0 packageStructure.add(name);
+ 1312
}
- 1326 0 }
- 1327
+ 1313 1535 }
+ 1314
- 1328
+ 1315
- 1329
+ 1316
- 1330
+ 1317
private String name;
- 1331
+ 1318
- 1332
+ 1319
- 1333
+ 1320
- 1334
+ 1321
- 1335
+ 1322
- 1336
+ 1323
- 1337
+ 1324
public String getName() {
- 1338
+ 1325
return name;
- 1339
+ 1326
}
+ 1327
+
+ 1328
+
+ 1329
+
+ 1330
+
+ 1331
+
+ 1332
+
+ 1333
+ public void setName(String name) {
+ 1334
+ this .name = name;
+ 1335
+ }
+ 1336
+
+ 1337
+
+ 1338
+
+ 1339 1535 private final ArrayList<String> packageStructure = new ArrayList<String>();
1340
1341
1342
-
+
1343
1344
-
+
1345
1346
- public void setName(String name) {
+ public ArrayList<String> getPackageStructure() {
1347
- this .name = name;
+ return packageStructure;
1348
}
1349
-
+ }
1350
-
+
1351
-
- 1352 0 private final ArrayList<String> packageStructure = new ArrayList<String>();
- 1353
-
- 1354
-
- 1355
-
- 1356
-
- 1357
-
- 1358
-
- 1359
- public ArrayList<String> getPackageStructure() {
- 1360
- return packageStructure;
- 1361
- }
- 1362
- }
- 1363
-
- 1364
- 1365
+ 1352
- 1366
+ 1353
- 1367
+ 1354
- 1368
+ 1355
- 1369
+ 1356
- 1370
+ 1357
private File getNextTempDirectory() throws AnalysisException {
- 1371 0 dirCount += 1;
- 1372 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 1373
+ 1358 0 dirCount += 1;
+ 1359 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 1360
- 1374 0 if (directory.exists()) {
- 1375 0 return getNextTempDirectory();
- 1376
+ 1361 0 if (directory.exists()) {
+ 1362 0 return getNextTempDirectory();
+ 1363
}
- 1377 0 if (!directory.mkdirs()) {
- 1378 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
- 1379 0 throw new AnalysisException(msg);
- 1380
+ 1364 0 if (!directory.mkdirs()) {
+ 1365 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 1366 0 throw new AnalysisException(msg);
+ 1367
}
- 1381 0 return directory;
- 1382
+ 1368 0 return directory;
+ 1369
}
- 1383
+ 1370
}
-
+
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 1edd35ebd..ec86df6eb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
@@ -12,7 +12,7 @@
@@ -105,11 +105,11 @@
44
- 45 0 private static final Logger LOGGER = Logger.getLogger(JavaScriptAnalyzer.class .getName());
+ 45 1 private static final Logger LOGGER = Logger.getLogger(JavaScriptAnalyzer.class .getName());
46
47
-
+
48
49
@@ -124,14 +124,14 @@
54
- 55 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 55 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
56
57
58
- 59 0 private static final Set<String> EXTENSIONS = newHashSet("js" );
+ 59 1 private static final Set<String> EXTENSIONS = newHashSet("js" );
60
61
@@ -148,7 +148,7 @@
@Override
67
public Set<String> getSupportedExtensions() {
- 68 0 return EXTENSIONS;
+ 68 2 return EXTENSIONS;
69
}
70
@@ -167,7 +167,7 @@
@Override
77
public String getName() {
- 78 0 return ANALYZER_NAME;
+ 78 1 return ANALYZER_NAME;
79
}
80
@@ -186,7 +186,7 @@
@Override
87
public AnalysisPhase getAnalysisPhase() {
- 88 0 return ANALYSIS_PHASE;
+ 88 1 return ANALYSIS_PHASE;
89
}
90
@@ -205,7 +205,7 @@
@Override
97
protected String getAnalyzerEnabledSettingKey() {
- 98 0 return Settings.KEYS.ANALYZER_JAVASCRIPT_ENABLED;
+ 98 5 return Settings.KEYS.ANALYZER_JAVASCRIPT_ENABLED;
99
}
100
@@ -228,7 +228,7 @@
@Override
109
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 110 0 BufferedReader fin = null ;;
+ 110 0 BufferedReader fin = null ;
111
try {
112
@@ -275,6 +275,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 e4d6a49c9..bb4c86232 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 @@
@@ -123,7 +123,7 @@
53
- 54 0 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
+ 54 1 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
55
56
@@ -142,7 +142,7 @@
63
- 64 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 64 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
65
66
@@ -151,7 +151,7 @@
68
- 69 0 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
+ 69 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
70
71
@@ -218,7 +218,7 @@
@Override
109
public String getName() {
- 110 0 return ANALYZER_NAME;
+ 110 4 return ANALYZER_NAME;
111
}
112
@@ -237,7 +237,7 @@
@Override
119
protected String getAnalyzerEnabledSettingKey() {
- 120 0 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
+ 120 2 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
121
}
122
@@ -256,7 +256,7 @@
@Override
129
public AnalysisPhase getAnalysisPhase() {
- 130 0 return ANALYSIS_PHASE;
+ 130 1 return ANALYSIS_PHASE;
131
}
132
@@ -324,7 +324,7 @@
169 0 } catch (FileNotFoundException fnfe) {
170
- 171 0 LOGGER.fine(String.format("Artificat not found in repository '%s'" , dependency.getFileName()));
+ 171 0 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
172 0 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
173 0 } catch (IOException ioe) {
174
@@ -336,6 +336,6 @@
}
-
+
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 d99a93961..a457598dc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
@@ -12,7 +12,7 @@
@@ -107,7 +107,7 @@
45
- 46 0 private static final Logger LOGGER = Logger.getLogger(NuspecAnalyzer.class .getName());
+ 46 1 private static final Logger LOGGER = Logger.getLogger(NuspecAnalyzer.class .getName());
47
48
@@ -126,7 +126,7 @@
55
- 56 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 56 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
57
58
@@ -135,7 +135,7 @@
60
- 61 0 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("nuspec" );
+ 61 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("nuspec" );
62
63
@@ -169,7 +169,7 @@
@Override
78
public String getName() {
- 79 0 return ANALYZER_NAME;
+ 79 5 return ANALYZER_NAME;
80
}
81
@@ -188,7 +188,7 @@
@Override
88
protected String getAnalyzerEnabledSettingKey() {
- 89 0 return Settings.KEYS.ANALYZER_NUSPEC_ENABLED;
+ 89 6 return Settings.KEYS.ANALYZER_NUSPEC_ENABLED;
90
}
91
@@ -207,7 +207,7 @@
@Override
98
public AnalysisPhase getAnalysisPhase() {
- 99 0 return ANALYSIS_PHASE;
+ 99 2 return ANALYSIS_PHASE;
100
}
101
@@ -226,7 +226,7 @@
@Override
108
public Set<String> getSupportedExtensions() {
- 109 0 return SUPPORTED_EXTENSIONS;
+ 109 852 return SUPPORTED_EXTENSIONS;
110
}
111
@@ -297,6 +297,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 d603489da..014d9e860 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -129,9 +129,9 @@
56
public void open() throws SQLException, IOException, DatabaseException, ClassNotFoundException {
- 57 0 cveDB = new CveDB();
- 58 0 cveDB.open();
- 59 0 }
+ 57 1 cveDB = new CveDB();
+ 58 1 cveDB.open();
+ 59 1 }
60
61
@@ -144,9 +144,9 @@
@Override
65
public void close() {
- 66 0 cveDB.close();
- 67 0 cveDB = null ;
- 68 0 }
+ 66 1 cveDB.close();
+ 67 1 cveDB = null ;
+ 68 1 }
69
70
@@ -161,7 +161,7 @@
75
public boolean isOpen() {
- 76 0 return (cveDB != null );
+ 76 1 return (cveDB != null );
77
}
78
@@ -180,12 +180,12 @@
@Override
85
protected void finalize() throws Throwable {
- 86 0 super .finalize();
- 87 0 if (isOpen()) {
+ 86 1 super .finalize();
+ 87 1 if (isOpen()) {
88 0 close();
89
}
- 90 0 }
+ 90 1 }
91
92
@@ -206,80 +206,93 @@
@Override
100
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 101 0 for (Identifier id : dependency.getIdentifiers()) {
- 102 0 if ("cpe" .equals(id.getType())) {
+ 101 2 for (Identifier id : dependency.getIdentifiers()) {
+ 102 2 if ("cpe" .equals(id.getType())) {
103
try {
- 104 0 final String value = id.getValue();
- 105 0 final List<Vulnerability> vulns = cveDB.getVulnerabilities(value);
- 106 0 dependency.getVulnerabilities().addAll(vulns);
+ 104 2 final String value = id.getValue();
+ 105 2 final List<Vulnerability> vulns = cveDB.getVulnerabilities(value);
+ 106 2 dependency.getVulnerabilities().addAll(vulns);
107 0 } catch (DatabaseException ex) {
108 0 throw new AnalysisException(ex);
- 109 0 }
+ 109 2 }
110
}
- 111 0 }
- 112 0 }
- 113
-
+ 111 2 }
+ 112 2 for (Identifier id : dependency.getSuppressedIdentifiers()) {
+ 113 0 if ("cpe" .equals(id.getType())) {
114
-
- 115
-
- 116
-
- 117
-
- 118
-
- 119
- @Override
- 120
- public String getName() {
- 121 0 return "NVD CVE Analyzer" ;
- 122
- }
- 123
-
+ try {
+ 115 0 final String value = id.getValue();
+ 116 0 final List<Vulnerability> vulns = cveDB.getVulnerabilities(value);
+ 117 0 dependency.getSuppressedVulnerabilities().addAll(vulns);
+ 118 0 } catch (DatabaseException ex) {
+ 119 0 throw new AnalysisException(ex);
+ 120 0 }
+ 121
+ }
+ 122 0 }
+ 123 2 }
124
-
- 125
-
- 126
-
- 127
-
- 128
-
- 129
- @Override
- 130
- public AnalysisPhase getAnalysisPhase() {
- 131 0 return AnalysisPhase.FINDING_ANALYSIS;
- 132
- }
- 133
- 134
+ 125
- 135
-
- 136
+ 126
+
+ 127
- 137
-
- 138
+ 128
+
+ 129
- 139
+ 130
@Override
+ 131
+ public String getName() {
+ 132 4 return "NVD CVE Analyzer" ;
+ 133
+ }
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
140
- public void initialize() throws Exception {
- 141 0 this .open();
- 142 0 }
+ @Override
+ 141
+ public AnalysisPhase getAnalysisPhase() {
+ 142 1 return AnalysisPhase.FINDING_ANALYSIS;
143
+ }
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+
+ 150
+ @Override
+ 151
+ public void initialize() throws Exception {
+ 152 1 this .open();
+ 153 1 }
+ 154
}
-
+
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 50bb1b6e8..7d0324b97 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
@@ -12,7 +12,7 @@
@@ -97,7 +97,7 @@
40
- 41 0 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_FINDING_ANALYSIS;
+ 41 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.POST_FINDING_ANALYSIS;
42
43
@@ -114,7 +114,7 @@
@Override
49
public String getName() {
- 50 0 return ANALYZER_NAME;
+ 50 4 return ANALYZER_NAME;
51
}
52
@@ -133,7 +133,7 @@
@Override
59
public AnalysisPhase getAnalysisPhase() {
- 60 0 return ANALYSIS_PHASE;
+ 60 1 return ANALYSIS_PHASE;
61
}
62
@@ -146,8 +146,8 @@
public void analyze(final Dependency dependency, final Engine engine) throws AnalysisException {
66
- 67 0 if (getRules() == null || getRules().size() <= 0) {
- 68 0 return ;
+ 67 2 if (getRules() == null || getRules().size() <= 0) {
+ 68 2 return ;
69
}
70
@@ -160,6 +160,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 f8f753d57..8aa19cf3c 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
@@ -151,6 +151,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 3d6ca0d9d..544cf52bd 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
@@ -151,6 +151,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 d6761bac5..7fa294788 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
@@ -12,7 +12,7 @@
@@ -130,452 +130,457 @@
56
public final class CpeMemoryIndex {
57
-
+
58
-
+
59
-
- 60
- 61 0 private static CpeMemoryIndex instance = new CpeMemoryIndex();
+ 60 1 private static final Logger LOGGER = Logger.getLogger(CpeMemoryIndex.class .getName());
+ 61
+
62
-
+
63
-
- 64
-
+
+ 64 1 private static CpeMemoryIndex instance = new CpeMemoryIndex();
65
-
+
66
- private CpeMemoryIndex() {
+
67
- }
+
68
-
+
69
-
+ private CpeMemoryIndex() {
70
-
+ }
71
-
+
72
-
+
73
-
+
74
- public static CpeMemoryIndex getInstance() {
- 75 0 return instance;
+
+ 75
+
76
- }
+
77
-
- 78
-
+ public static CpeMemoryIndex getInstance() {
+ 78 2 return instance;
79
-
+ }
80
- private RAMDirectory index;
+
81
-
+
82
-
+
83
-
+ private RAMDirectory index;
84
- private IndexReader indexReader;
+
85
-
+
86
-
+
87
-
+ private IndexReader indexReader;
88
- private IndexSearcher indexSearcher;
+
89
-
+
90
-
+
91
-
+ private IndexSearcher indexSearcher;
92
- private Analyzer searchingAnalyzer;
+
93
-
+
94
-
+
95
-
+ private Analyzer searchingAnalyzer;
96
- private QueryParser queryParser;
+
97
-
+
98
-
+
99
-
+ private QueryParser queryParser;
100
- private SearchFieldAnalyzer productSearchFieldAnalyzer;
+
101
-
+
102
-
+
103
-
+ private SearchFieldAnalyzer productSearchFieldAnalyzer;
104
- private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
+
105
-
+
106
-
+
107
-
+ private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
108
-
+
109
-
+
110
-
+
111
-
+
112
+
+ 113
+
+ 114
+
+ 115
public void open(CveDB cve) throws IndexException {
- 113 0 if (!openState) {
- 114 0 index = new RAMDirectory();
- 115 0 buildIndex(cve);
- 116
+ 116 2 if (!openState) {
+ 117 1 index = new RAMDirectory();
+ 118 1 buildIndex(cve);
+ 119
try {
- 117 0 indexReader = DirectoryReader.open(index);
- 118 0 } catch (IOException ex) {
- 119 0 throw new IndexException(ex);
- 120 0 }
- 121 0 indexSearcher = new IndexSearcher(indexReader);
- 122 0 searchingAnalyzer = createSearchingAnalyzer();
- 123 0 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
- 124 0 openState = true ;
- 125
- }
- 126 0 }
- 127
-
+ 120 1 indexReader = DirectoryReader.open(index);
+ 121 0 } catch (IOException ex) {
+ 122 0 throw new IndexException(ex);
+ 123 1 }
+ 124 1 indexSearcher = new IndexSearcher(indexReader);
+ 125 1 searchingAnalyzer = createSearchingAnalyzer();
+ 126 1 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
+ 127 1 openState = true ;
128
-
- 129
-
+ }
+ 129 2 }
130
- private boolean openState = false ;
+
131
-
+
132
-
+
133
-
+ private boolean openState = false ;
134
-
+
135
-
+
136
-
+
137
- public boolean isOpen() {
+
138
- return openState;
+
139
- }
+
140
-
+ public boolean isOpen() {
141
-
+ return openState;
142
-
+ }
143
-
+
144
-
- 145
-
- 146
- @SuppressWarnings("unchecked" )
- 147
- private Analyzer createIndexingAnalyzer() {
- 148 0 final Map fieldAnalyzers = new HashMap();
- 149 0 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
- 150 0 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
- 151
- }
- 152
-
- 153
- 154
-
- 155
+ 145
+
+ 146
- 156
+ 147
- 157
+ 148
- 158
+ 149
@SuppressWarnings("unchecked" )
- 159
- private Analyzer createSearchingAnalyzer() {
- 160 0 final Map fieldAnalyzers = new HashMap();
- 161 0 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
- 162 0 productSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
- 163 0 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
- 164 0 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
- 165 0 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
- 166
-
- 167 0 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
- 168
+ 150
+ private Analyzer createIndexingAnalyzer() {
+ 151 1 final Map fieldAnalyzers = new HashMap();
+ 152 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+ 153 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
+ 154
}
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+ @SuppressWarnings("unchecked" )
+ 162
+ private Analyzer createSearchingAnalyzer() {
+ 163 1 final Map fieldAnalyzers = new HashMap();
+ 164 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+ 165 1 productSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
+ 166 1 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
+ 167 1 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
+ 168 1 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
169
- 170
-
+ 170 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
171
-
+ }
172
-
+
173
-
+
174
-
+
175
-
- 176
-
- 177
-
- 178
-
- 179
- public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
- 180 0 final Document doc = new Document();
- 181 0 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
- 182 0 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
- 183 0 doc.add(v);
- 184 0 doc.add(p);
- 185 0 indexWriter.addDocument(doc);
- 186 0 }
- 187
-
- 188
-
- 189
-
- 190
-
- 191
- public void close() {
- 192 0 if (searchingAnalyzer != null ) {
- 193 0 searchingAnalyzer.close();
- 194 0 searchingAnalyzer = null ;
- 195
- }
- 196 0 if (indexReader != null ) {
- 197
- try {
- 198 0 indexReader.close();
- 199 0 } catch (IOException ex) {
- 200 0 Logger.getLogger(CpeMemoryIndex.class .getName()).log(Level.FINEST, null , ex);
- 201 0 }
- 202 0 indexReader = null ;
- 203
- }
- 204 0 queryParser = null ;
- 205 0 indexSearcher = null ;
- 206 0 if (index != null ) {
- 207 0 index.close();
- 208 0 index = null ;
- 209
- }
- 210 0 openState = false ;
- 211 0 }
- 212
-
- 213
-
- 214
-
- 215
- 216
-
- 217
-
- 218
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
- 219
- private void buildIndex(CveDB cve) throws IndexException {
- 220 0 Analyzer analyzer = null ;
- 221 0 IndexWriter indexWriter = null ;
- 222
- try {
- 223 0 analyzer = createIndexingAnalyzer();
- 224 0 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
- 225 0 indexWriter = new IndexWriter(index, conf);
- 226
- try {
- 227 0 final Set<Pair<String, String>> data = cve.getVendorProductList();
- 228 0 for (Pair<String, String> pair : data) {
- 229 0 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
- 230 0 }
- 231 0 } catch (DatabaseException ex) {
- 232 0 Logger.getLogger(CpeMemoryIndex.class .getName()).log(Level.FINE, null , ex);
- 233 0 throw new IndexException("Error reading CPE data" , ex);
- 234 0 }
- 235 0 } catch (CorruptIndexException ex) {
- 236 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 237 0 } catch (IOException ex) {
- 238 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 239
- } finally {
- 240 0 if (indexWriter != null ) {
- 241
- try {
- 242
- try {
- 243 0 indexWriter.commit();
- 244
- } finally {
- 245 0 indexWriter.close(true );
- 246 0 }
- 247 0 } catch (CorruptIndexException ex) {
- 248 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 249 0 } catch (IOException ex) {
- 250 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 251 0 }
- 252 0 if (analyzer != null ) {
- 253 0 analyzer.close();
- 254
- }
- 255
- }
- 256
- }
- 257 0 }
- 258
+ 182
+ public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
+ 183 21494 final Document doc = new Document();
+ 184 21494 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
+ 185 21494 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
+ 186 21494 doc.add(v);
+ 187 21494 doc.add(p);
+ 188 21494 indexWriter.addDocument(doc);
+ 189 21494 }
+ 190
- 259
+ 191
- 260
-
- 261
+ 192
+
+ 193
- 262
- private void resetSearchingAnalyzer() {
- 263 0 if (productSearchFieldAnalyzer != null ) {
- 264 0 productSearchFieldAnalyzer.clear();
- 265
+ 194
+ public void close() {
+ 195 1 if (searchingAnalyzer != null ) {
+ 196 1 searchingAnalyzer.close();
+ 197 1 searchingAnalyzer = null ;
+ 198
}
- 266 0 if (vendorSearchFieldAnalyzer != null ) {
- 267 0 vendorSearchFieldAnalyzer.clear();
+ 199 1 if (indexReader != null ) {
+ 200
+ try {
+ 201 1 indexReader.close();
+ 202 0 } catch (IOException ex) {
+ 203 0 LOGGER.log(Level.FINEST, null , ex);
+ 204 1 }
+ 205 1 indexReader = null ;
+ 206
+ }
+ 207 1 queryParser = null ;
+ 208 1 indexSearcher = null ;
+ 209 1 if (index != null ) {
+ 210 1 index.close();
+ 211 1 index = null ;
+ 212
+ }
+ 213 1 openState = false ;
+ 214 1 }
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+ private void buildIndex(CveDB cve) throws IndexException {
+ 223 1 Analyzer analyzer = null ;
+ 224 1 IndexWriter indexWriter = null ;
+ 225
+ try {
+ 226 1 analyzer = createIndexingAnalyzer();
+ 227 1 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
+ 228 1 indexWriter = new IndexWriter(index, conf);
+ 229
+ try {
+ 230 1 final Set<Pair<String, String>> data = cve.getVendorProductList();
+ 231 1 for (Pair<String, String> pair : data) {
+ 232 21494 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
+ 233 21494 }
+ 234 0 } catch (DatabaseException ex) {
+ 235 0 LOGGER.log(Level.FINE, null , ex);
+ 236 0 throw new IndexException("Error reading CPE data" , ex);
+ 237 1 }
+ 238 0 } catch (CorruptIndexException ex) {
+ 239 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 240 0 } catch (IOException ex) {
+ 241 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 242
+ } finally {
+ 243 1 if (indexWriter != null ) {
+ 244
+ try {
+ 245
+ try {
+ 246 1 indexWriter.commit();
+ 247
+ } finally {
+ 248 1 indexWriter.close(true );
+ 249 1 }
+ 250 0 } catch (CorruptIndexException ex) {
+ 251 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 252 0 } catch (IOException ex) {
+ 253 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 254 1 }
+ 255 1 if (analyzer != null ) {
+ 256 1 analyzer.close();
+ 257
+ }
+ 258
+ }
+ 259
+ }
+ 260 1 }
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+ private void resetSearchingAnalyzer() {
+ 266 0 if (productSearchFieldAnalyzer != null ) {
+ 267 0 productSearchFieldAnalyzer.clear();
268
}
- 269 0 }
- 270
-
+ 269 0 if (vendorSearchFieldAnalyzer != null ) {
+ 270 0 vendorSearchFieldAnalyzer.clear();
271
-
- 272
-
+ }
+ 272 0 }
273
-
+
274
-
+
275
-
+
276
-
+
277
-
+
278
-
+
279
-
+
280
- public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
- 281 0 if (searchString == null || searchString.trim().isEmpty()) {
- 282 0 throw new ParseException("Query is null or empty" );
+
+ 281
+
+ 282
+
283
- }
- 284 0 final Query query = queryParser.parse(searchString);
- 285 0 return indexSearcher.search(query, maxQueryResults);
+ public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
+ 284 8 if (searchString == null || searchString.trim().isEmpty()) {
+ 285 0 throw new ParseException("Query is null or empty" );
286
- }
- 287
-
- 288
-
- 289
-
- 290
-
- 291
-
- 292
-
- 293
-
- 294
-
- 295
-
- 296
-
- 297
- public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
- 298 0 resetSearchingAnalyzer();
- 299 0 return indexSearcher.search(query, maxQueryResults);
- 300
- }
- 301
-
- 302
-
- 303
-
- 304
-
- 305
-
- 306
-
- 307
-
- 308
-
- 309
- public Document getDocument(int documentId) throws IOException {
- 310 0 return indexSearcher.doc(documentId);
- 311
- }
- 312
-
- 313
-
- 314
-
- 315
-
- 316
-
- 317
-
- 318
- public int numDocs() {
- 319 0 if (indexReader == null ) {
- 320 0 return -1;
- 321
}
- 322 0 return indexReader.numDocs();
- 323
+ 287 8 final Query query = queryParser.parse(searchString);
+ 288 8 return indexSearcher.search(query, maxQueryResults);
+ 289
}
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+
+ 299
+
+ 300
+ public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
+ 301 0 resetSearchingAnalyzer();
+ 302 0 return indexSearcher.search(query, maxQueryResults);
+ 303
+ }
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+ public Document getDocument(int documentId) throws IOException {
+ 313 54 return indexSearcher.doc(documentId);
+ 314
+ }
+ 315
+
+ 316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+ public int numDocs() {
+ 322 1 if (indexReader == null ) {
+ 323 0 return -1;
324
+ }
+ 325 1 return indexReader.numDocs();
+ 326
+ }
+ 327
}
-
+
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 834e56adf..d4d363648 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
@@ -103,6 +103,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 d6b481239..b55cf4e39 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
@@ -12,7 +12,7 @@
@@ -302,19 +302,19 @@
144
public void parseName(String cpeName) throws UnsupportedEncodingException {
- 145 0 if (cpeName != null && cpeName.length() > 7) {
- 146 0 final String[] data = cpeName.substring(7).split(":" );
- 147 0 if (data.length >= 1) {
- 148 0 vendor = URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" );
- 149 0 if (data.length >= 2) {
- 150 0 product = URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" );
+ 145 1 if (cpeName != null && cpeName.length() > 7) {
+ 146 1 final String[] data = cpeName.substring(7).split(":" );
+ 147 1 if (data.length >= 1) {
+ 148 1 vendor = URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" );
+ 149 1 if (data.length >= 2) {
+ 150 1 product = URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" );
151
}
152
}
153
}
- 154 0 }
+ 154 1 }
155
156
@@ -332,21 +332,21 @@
@Override
164
public boolean equals(Object obj) {
- 165 0 if (obj == null ) {
+ 165 336 if (obj == null ) {
166 0 return false ;
167
}
- 168 0 if (getClass() != obj.getClass()) {
+ 168 336 if (getClass() != obj.getClass()) {
169 0 return false ;
170
}
- 171 0 final IndexEntry other = (IndexEntry) obj;
- 172 0 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
- 173 0 return false ;
+ 171 336 final IndexEntry other = (IndexEntry) obj;
+ 172 336 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
+ 173 279 return false ;
174
}
- 175 0 if ((this .product == null ) ? (other.product != null ) : !this .product.equals(other.product)) {
- 176 0 return false ;
+ 175 57 if ((this .product == null ) ? (other.product != null ) : !this .product.equals(other.product)) {
+ 176 57 return false ;
177
}
178 0 return true ;
@@ -375,6 +375,6 @@
}
-
+
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 780cc993f..57ef2676d 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
@@ -151,6 +151,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 e85de9f6d..2c345540b 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
@@ -12,7 +12,7 @@
@@ -80,98 +80,103 @@
31
public final class CweDB {
32
-
+
33
-
+
34
-
- 35
+ 35 1 private static final Logger LOGGER = Logger.getLogger(CweDB.class .getName());
36
- private CweDB() {
+
37
-
+
38
- }
+
39
-
+ private CweDB() {
40
-
+
41
-
- 42 0 private static final HashMap<String, String> CWE = loadData();
+ }
+ 42
+
43
-
+
44
-
- 45
-
+
+ 45 1 private static final HashMap<String, String> CWE = loadData();
46
-
- 47
-
- 48
-
- 49
- private static HashMap<String, String> loadData() {
- 50 0 ObjectInputStream oin = null ;
- 51
- try {
- 52 0 final String filePath = "data/cwe.hashmap.serialized" ;
- 53 0 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
- 54 0 oin = new ObjectInputStream(input);
- 55 0 return (HashMap<String, String>) oin.readObject();
- 56 0 } catch (ClassNotFoundException ex) {
- 57 0 Logger.getLogger(CweDB.class .getName()).log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
- 58 0 Logger.getLogger(CweDB.class .getName()).log(Level.FINE, null , ex);
- 59 0 } catch (IOException ex) {
- 60 0 Logger.getLogger(CweDB.class .getName()).log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
- 61 0 Logger.getLogger(CweDB.class .getName()).log(Level.FINE, null , ex);
- 62
- } finally {
- 63 0 if (oin != null ) {
- 64
- try {
- 65 0 oin.close();
- 66 0 } catch (IOException ex) {
- 67 0 Logger.getLogger(CweDB.class .getName()).log(Level.FINEST, null , ex);
- 68 0 }
- 69
- }
- 70
- }
- 71 0 return null ;
- 72
- }
- 73
- 74
+ 47
- 75
-
- 76
-
- 77
+ 48
+
+ 49
- 78
-
- 79
-
- 80
+ 50
+
+ 51
- 81
- public static String getCweName(String cweId) {
- 82 0 if (cweId != null ) {
- 83 0 return CWE.get(cweId);
- 84
+ 52
+ private static HashMap<String, String> loadData() {
+ 53 1 ObjectInputStream oin = null ;
+ 54
+ try {
+ 55 1 final String filePath = "data/cwe.hashmap.serialized" ;
+ 56 1 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
+ 57 1 oin = new ObjectInputStream(input);
+ 58 1 return (HashMap<String, String>) oin.readObject();
+ 59 0 } catch (ClassNotFoundException ex) {
+ 60 0 LOGGER.log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
+ 61 0 LOGGER.log(Level.FINE, null , ex);
+ 62 0 } catch (IOException ex) {
+ 63 0 LOGGER.log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
+ 64 0 LOGGER.log(Level.FINE, null , ex);
+ 65
+ } finally {
+ 66 1 if (oin != null ) {
+ 67
+ try {
+ 68 1 oin.close();
+ 69 0 } catch (IOException ex) {
+ 70 0 LOGGER.log(Level.FINEST, null , ex);
+ 71 2 }
+ 72
+ }
+ 73
}
- 85 0 return null ;
- 86
+ 74 0 return null ;
+ 75
}
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+ public static String getCweName(String cweId) {
+ 85 4 if (cweId != null ) {
+ 86 4 return CWE.get(cweId);
87
+ }
+ 88 0 return null ;
+ 89
+ }
+ 90
}
-
+
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 8b0dcbd13..da169430a 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
@@ -122,6 +122,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 5b2c888f7..b5871c832 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
@@ -12,7 +12,7 @@
@@ -85,7 +85,7 @@
34
- 35 0 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 35 10 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
36
37
@@ -144,9 +144,9 @@
64
public AbstractTokenizingFilter(TokenStream stream) {
- 65 0 super (stream);
- 66 0 tokens = new LinkedList<String>();
- 67 0 }
+ 65 10 super (stream);
+ 66 10 tokens = new LinkedList<String>();
+ 67 10 }
68
69
@@ -161,20 +161,20 @@
74
protected boolean addTerm() {
- 75 0 final boolean termAdded = tokens.size() > 0;
- 76 0 if (termAdded) {
- 77 0 final String term = tokens.pop();
- 78 0 clearAttributes();
- 79 0 termAtt.append(term);
+ 75 26554 final boolean termAdded = tokens.size() > 0;
+ 76 26542 if (termAdded) {
+ 77 17463 final String term = tokens.pop();
+ 78 17464 clearAttributes();
+ 79 17475 termAtt.append(term);
80
}
- 81 0 return termAdded;
+ 81 26532 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 f1420ec9e..79d7873fa 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
@@ -12,7 +12,7 @@
@@ -135,13 +135,13 @@
@Override
59
protected boolean isTokenChar(int c) {
- 60 0 return Character.isLetter(c) || Character.isDigit(c);
+ 60 501912 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 cc3fa360d..6a36aa7d5 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
@@ -112,6 +112,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 517b15be6..8e836e888 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
@@ -12,7 +12,7 @@
@@ -139,13 +139,13 @@
@Override
61
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
- 62 0 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
+ 62 3 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
63
- 64 0 TokenStream stream = source;
+ 64 3 TokenStream stream = source;
65
- 66 0 stream = new WordDelimiterFilter(stream,
+ 66 3 stream = new WordDelimiterFilter(stream,
67
WordDelimiterFilter.CATENATE_WORDS
68
@@ -162,17 +162,17 @@
| WordDelimiterFilter.STEM_ENGLISH_POSSESSIVE, null );
74
- 75 0 stream = new LowerCaseFilter(version, stream);
- 76 0 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+ 75 3 stream = new LowerCaseFilter(version, stream);
+ 76 3 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
77
- 78 0 return new TokenStreamComponents(source, stream);
+ 78 3 return new TokenStreamComponents(source, stream);
79
}
80
}
-
+
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 bb1f92987..e83150713 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
@@ -12,7 +12,7 @@
@@ -83,7 +83,7 @@
33
- 34 0 public static final Version CURRENT_VERSION = Version.LUCENE_45;
+ 34 1 public static final Version CURRENT_VERSION = Version.LUCENE_45;
35
36
@@ -124,15 +124,15 @@
final CharSequence text) {
54
- 55 0 if (text == null || buf == null ) {
- 56 0 return ;
+ 55 227 if (text == null || buf == null ) {
+ 56 1 return ;
57
}
58
- 59 0 for (int i = 0; i < text.length(); i++) {
- 60 0 final char c = text.charAt(i);
- 61 0 switch (c) {
+ 59 2333 for (int i = 0; i < text.length(); i++) {
+ 60 2107 final char c = text.charAt(i);
+ 61 2107 switch (c) {
62
case '+' :
63
@@ -169,17 +169,17 @@
case ':' :
79
case '\\' :
- 80 0 buf.append('\\' );
+ 80 72 buf.append('\\' );
81
default :
- 82 0 buf.append(c);
+ 82 2107 buf.append(c);
83
break ;
84
}
85
}
- 86 0 }
+ 86 226 }
87
88
@@ -198,27 +198,27 @@
public static String escapeLuceneQuery(final CharSequence text) {
95
- 96 0 if (text == null ) {
- 97 0 return null ;
+ 96 226 if (text == null ) {
+ 97 1 return null ;
98
}
99
- 100 0 int size = text.length();
- 101 0 size = size >> 1;
- 102 0 final StringBuilder buf = new StringBuilder(size);
+ 100 225 int size = text.length();
+ 101 225 size = size >> 1;
+ 102 225 final StringBuilder buf = new StringBuilder(size);
103
- 104 0 appendEscapedLuceneQuery(buf, text);
+ 104 225 appendEscapedLuceneQuery(buf, text);
105
- 106 0 return buf.toString();
+ 106 225 return buf.toString();
107
}
108
}
-
+
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 96987705a..35bf21f5e 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
@@ -12,7 +12,7 @@
@@ -145,13 +145,13 @@
@Override
64
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
- 65 0 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
+ 65 4 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
66
- 67 0 TokenStream stream = source;
+ 67 4 TokenStream stream = source;
68
- 69 0 stream = new WordDelimiterFilter(stream,
+ 69 4 stream = new WordDelimiterFilter(stream,
70
WordDelimiterFilter.GENERATE_WORD_PARTS
71
@@ -166,14 +166,14 @@
| WordDelimiterFilter.STEM_ENGLISH_POSSESSIVE, null );
76
- 77 0 stream = new LowerCaseFilter(version, stream);
- 78 0 stream = new UrlTokenizingFilter(stream);
- 79 0 concatenatingFilter = new TokenPairConcatenatingFilter(stream);
- 80 0 stream = concatenatingFilter;
- 81 0 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+ 77 4 stream = new LowerCaseFilter(version, stream);
+ 78 4 stream = new UrlTokenizingFilter(stream);
+ 79 4 concatenatingFilter = new TokenPairConcatenatingFilter(stream);
+ 80 4 stream = concatenatingFilter;
+ 81 4 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
82
- 83 0 return new TokenStreamComponents(source, stream);
+ 83 4 return new TokenStreamComponents(source, stream);
84
}
85
@@ -194,15 +194,15 @@
93
public void clear() {
- 94 0 if (concatenatingFilter != null ) {
- 95 0 concatenatingFilter.clear();
+ 94 2 if (concatenatingFilter != null ) {
+ 95 2 concatenatingFilter.clear();
96
}
- 97 0 }
+ 97 2 }
98
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
index a1da0ba89..e052bb97e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
@@ -158,6 +158,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 6aca86c3b..55a803bff 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
@@ -12,7 +12,7 @@
@@ -93,7 +93,7 @@
38
- 39 0 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 39 6 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
40
41
@@ -160,9 +160,9 @@
72
public TokenPairConcatenatingFilter(TokenStream stream) {
- 73 0 super (stream);
- 74 0 words = new LinkedList<String>();
- 75 0 }
+ 73 6 super (stream);
+ 74 6 words = new LinkedList<String>();
+ 75 6 }
76
77
@@ -187,35 +187,35 @@
87
- 88 0 while (input.incrementToken()) {
- 89 0 final String word = new String(termAtt.buffer(), 0, termAtt.length());
- 90 0 words.add(word);
- 91 0 }
+ 88 1540 while (input.incrementToken()) {
+ 89 439 final String word = new String(termAtt.buffer(), 0, termAtt.length());
+ 90 439 words.add(word);
+ 91 439 }
92
93
94
- 95 0 if (previousWord != null && words.size() > 0) {
- 96 0 final String word = words.getFirst();
- 97 0 clearAttributes();
- 98 0 termAtt.append(previousWord).append(word);
- 99 0 previousWord = null ;
- 100 0 return true ;
+ 95 1101 if (previousWord != null && words.size() > 0) {
+ 96 431 final String word = words.getFirst();
+ 97 431 clearAttributes();
+ 98 431 termAtt.append(previousWord).append(word);
+ 99 431 previousWord = null ;
+ 100 431 return true ;
101
}
102
- 103 0 if (words.size() > 0) {
- 104 0 final String word = words.removeFirst();
- 105 0 clearAttributes();
- 106 0 termAtt.append(word);
- 107 0 previousWord = word;
- 108 0 return true ;
+ 103 670 if (words.size() > 0) {
+ 104 439 final String word = words.removeFirst();
+ 105 439 clearAttributes();
+ 106 439 termAtt.append(word);
+ 107 439 previousWord = word;
+ 108 439 return true ;
109
}
- 110 0 return false ;
+ 110 231 return false ;
111
}
112
@@ -236,13 +236,13 @@
120
public void clear() {
- 121 0 previousWord = null ;
- 122 0 words.clear();
- 123 0 }
+ 121 3 previousWord = null ;
+ 122 3 words.clear();
+ 123 3 }
124
}
-
+
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 1eb29b246..7826fff2e 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
@@ -12,7 +12,7 @@
@@ -94,79 +94,84 @@
38
public final class UrlTokenizingFilter extends AbstractTokenizingFilter {
39
-
+
40
-
+
41
-
- 42
-
+
+ 42 1 private static final Logger LOGGER = Logger.getLogger(UrlTokenizingFilter.class .getName());
43
-
- 44
-
- 45
- public UrlTokenizingFilter(TokenStream stream) {
- 46
- super (stream);
- 47
- }
- 48
-
- 49
- 50
-
- 51
-
- 52
+ 44
+
+ 45
- 53
-
- 54
-
- 55
+ 46
+
+ 47
- 56
- @Override
- 57
- public boolean incrementToken() throws IOException {
- 58 0 final LinkedList<String> tokens = getTokens();
- 59 0 final CharTermAttribute termAtt = getTermAtt();
- 60 0 if (tokens.size() == 0 && input.incrementToken()) {
- 61 0 final String text = new String(termAtt.buffer(), 0, termAtt.length());
- 62 0 if (UrlStringUtils.containsUrl(text)) {
- 63 0 final String[] parts = text.split("\\s" );
- 64 0 for (String part : parts) {
- 65 0 if (UrlStringUtils.isUrl(part)) {
- 66
- try {
- 67 0 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
- 68 0 tokens.addAll(data);
- 69 0 } catch (MalformedURLException ex) {
- 70 0 Logger.getLogger(UrlTokenizingFilter.class .getName()).log(Level.FINE, "error parsing " + part, ex);
- 71 0 tokens.add(part);
- 72 0 }
- 73
- } else {
- 74 0 tokens.add(part);
- 75
- }
- 76
- }
- 77 0 } else {
- 78 0 tokens.add(text);
- 79
- }
- 80
- }
- 81 0 return addTerm();
- 82
+ 48
+ public UrlTokenizingFilter(TokenStream stream) {
+ 49
+ super (stream);
+ 50
}
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+ @Override
+ 60
+ public boolean incrementToken() throws IOException {
+ 61 26632 final LinkedList<String> tokens = getTokens();
+ 62 26636 final CharTermAttribute termAtt = getTermAtt();
+ 63 26652 if (tokens.size() == 0 && input.incrementToken()) {
+ 64 17476 final String text = new String(termAtt.buffer(), 0, termAtt.length());
+ 65 17473 if (UrlStringUtils.containsUrl(text)) {
+ 66 2 final String[] parts = text.split("\\s" );
+ 67 4 for (String part : parts) {
+ 68 2 if (UrlStringUtils.isUrl(part)) {
+ 69
+ try {
+ 70 2 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
+ 71 2 tokens.addAll(data);
+ 72 0 } catch (MalformedURLException ex) {
+ 73 0 LOGGER.log(Level.FINE, "error parsing " + part, ex);
+ 74 0 tokens.add(part);
+ 75 2 }
+ 76
+ } else {
+ 77 0 tokens.add(part);
+ 78
+ }
+ 79
+ }
+ 80 2 } else {
+ 81 17472 tokens.add(text);
+ 82
+ }
83
+ }
+ 84 26545 return addTerm();
+ 85
+ }
+ 86
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
index 8e23c0137..6e32c7bda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
@@ -157,6 +157,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
index ba4fde1f3..c834b39c8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
@@ -195,6 +195,6 @@
}
-
+
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 b83712b6c..717fce5c4 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
@@ -12,7 +12,7 @@
@@ -158,12 +158,12 @@
73
- 74 0 public MavenArtifact(String groupId, String artifactId, String version, String url) {
- 75 0 setGroupId(groupId);
- 76 0 setArtifactId(artifactId);
- 77 0 setVersion(version);
- 78 0 setArtifactUrl(url);
- 79 0 }
+ 74 1 public MavenArtifact(String groupId, String artifactId, String version, String url) {
+ 75 1 setGroupId(groupId);
+ 76 1 setArtifactId(artifactId);
+ 77 1 setVersion(version);
+ 78 1 setArtifactUrl(url);
+ 79 1 }
80
81
@@ -335,6 +335,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 90d27a848..8d80f252a 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 @@
@@ -64,265 +64,266 @@
23
import java.net.URL;
24
- import java.net.URLConnection;
- 25
import java.util.logging.Level;
- 26
+ 25
import java.util.logging.Logger;
- 27
+ 26
import javax.xml.parsers.DocumentBuilder;
- 28
+ 27
import javax.xml.parsers.DocumentBuilderFactory;
- 29
+ 28
import javax.xml.xpath.XPath;
- 30
+ 29
import javax.xml.xpath.XPathFactory;
- 31
+ 30
import org.owasp.dependencycheck.utils.InvalidSettingException;
- 32
+ 31
import org.owasp.dependencycheck.utils.Settings;
- 33
+ 32
import org.owasp.dependencycheck.utils.URLConnectionFactory;
- 34
+ 33
import org.w3c.dom.Document;
+ 34
+
35
-
- 36
- 37
+ 36
- 38
+ 37
- 39
+ 38
- 40
+ 39
- 41
+ 40
public class NexusSearch {
+ 41
+
42
-
+
43
-
- 44
+ 44
+
45
-
- 46
private final URL rootURL;
+ 46
+
47
-
+
48
-
- 49
+ 49
+
50
-
- 51
private boolean useProxy;
+ 51
+
52
-
+
53
-
- 54
- 55
+ 54
- 56 0 private static final Logger LOGGER = Logger.getLogger(NexusSearch.class
- 57
+ 55 1 private static final Logger LOGGER = Logger.getLogger(NexusSearch.class
+ 56
.getName());
+ 57
+
58
-
+
59
-
- 60
+ 60
+
61
-
- 62
- 63
+ 62
- 64
+ 63
- 65 0 public NexusSearch(URL rootURL) {
- 66 0 this .rootURL = rootURL;
- 67
+ 64 4 public NexusSearch(URL rootURL) {
+ 65 4 this .rootURL = rootURL;
+ 66
try {
- 68 0 if (null != Settings.getString(Settings.KEYS.PROXY_URL)
- 69
+ 67 4 if (null != Settings.getString(Settings.KEYS.PROXY_URL)
+ 68
&& Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY)) {
- 70 0 useProxy = true ;
- 71 0 LOGGER.fine("Using proxy" );
- 72
+ 69 0 useProxy = true ;
+ 70 0 LOGGER.fine("Using proxy" );
+ 71
} else {
- 73 0 useProxy = false ;
- 74 0 LOGGER.fine("Not using proxy" );
- 75
+ 72 4 useProxy = false ;
+ 73 4 LOGGER.fine("Not using proxy" );
+ 74
}
- 76 0 } catch (InvalidSettingException ise) {
- 77 0 useProxy = false ;
- 78 0 }
- 79 0 }
+ 75 0 } catch (InvalidSettingException ise) {
+ 76 0 useProxy = false ;
+ 77 4 }
+ 78 4 }
+ 79
+
80
-
- 81
- 82
+ 81
- 83
+ 82
- 84
+ 83
- 85
+ 84
- 86
+ 85
+ 86
+
87
-
- 88
- 89
+ 88
- 90
+ 89
public MavenArtifact searchSha1(String sha1) throws IOException {
- 91 0 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
- 92 0 throw new IllegalArgumentException("Invalid SHA1 format" );
- 93
+ 90 4 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
+ 91 2 throw new IllegalArgumentException("Invalid SHA1 format" );
+ 92
}
- 94
+ 93
- 95 0 final URL url = new URL(rootURL, String.format("identify/sha1/%s" ,
- 96
+ 94 2 final URL url = new URL(rootURL, String.format("identify/sha1/%s" ,
+ 95
sha1.toLowerCase()));
- 97
+ 96
+
+ 97 2 LOGGER.fine(String.format("Searching Nexus url %s" , url.toString()));
+ 98
- 98 0 LOGGER.fine(String.format("Searching Nexus url %s" , url.toString()));
99
-
- 100
- 101
+ 100
- 102
+ 101
- 103
+ 102
- 104
+ 103
- 105 0 URLConnection conn = null ;
- 106 0 conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 104 2 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 105
+
+ 106 2 conn.setDoOutput(true );
107
- 108 0 conn.setDoOutput(true );
- 109
-
- 110
+ 108
- 111
+ 109
- 112 0 conn.addRequestProperty("Accept" , "application/xml" );
- 113 0 conn.connect();
+ 110 2 conn.addRequestProperty("Accept" , "application/xml" );
+ 111 2 conn.connect();
+ 112
+
+ 113 2 if (conn.getResponseCode() == 200) {
114
-
- 115
- try {
- 116 0 final DocumentBuilder builder = DocumentBuilderFactory
- 117
- .newInstance().newDocumentBuilder();
- 118 0 final Document doc = builder.parse(conn.getInputStream());
- 119 0 final XPath xpath = XPathFactory.newInstance().newXPath();
- 120 0 final String groupId = xpath
+ try {
+ 115 1 final DocumentBuilder builder = DocumentBuilderFactory
+ 116
+ .newInstance().newDocumentBuilder();
+ 117 1 final Document doc = builder.parse(conn.getInputStream());
+ 118 1 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 119 1 final String groupId = xpath
+ 120
+ .evaluate(
121
- .evaluate(
+ "/org.sonatype.nexus.rest.model.NexusArtifact/groupId" ,
122
- "/org.sonatype.nexus.rest.model.NexusArtifact/groupId" ,
- 123
- doc);
- 124 0 final String artifactId = xpath.evaluate(
+ doc);
+ 123 1 final String artifactId = xpath.evaluate(
+ 124
+ "/org.sonatype.nexus.rest.model.NexusArtifact/artifactId" ,
125
- "/org.sonatype.nexus.rest.model.NexusArtifact/artifactId" ,
- 126
- doc);
- 127 0 final String version = xpath
+ doc);
+ 126 1 final String version = xpath
+ 127
+ .evaluate(
128
- .evaluate(
+ "/org.sonatype.nexus.rest.model.NexusArtifact/version" ,
129
- "/org.sonatype.nexus.rest.model.NexusArtifact/version" ,
- 130
- doc);
- 131 0 final String link = xpath
+ doc);
+ 130 1 final String link = xpath
+ 131
+ .evaluate(
132
- .evaluate(
+ "/org.sonatype.nexus.rest.model.NexusArtifact/artifactLink" ,
133
- "/org.sonatype.nexus.rest.model.NexusArtifact/artifactLink" ,
- 134
- doc);
- 135 0 return new MavenArtifact(groupId, artifactId, version, link);
- 136 0 } catch (FileNotFoundException fnfe) {
+ doc);
+ 134 1 return new MavenArtifact(groupId, artifactId, version, link);
+ 135 0 } catch (Throwable e) {
+ 136
+
137
-
- 138
-
+
+ 138 0 throw new IOException(e.getMessage(), e);
139
-
- 140 0 throw fnfe;
- 141 0 } catch (Throwable e) {
+ }
+ 140 1 } else if (conn.getResponseCode() == 404) {
+ 141 1 throw new FileNotFoundException("Artifact not found in Nexus" );
142
-
- 143
-
- 144 0 throw new IOException(e.getMessage(), e);
- 145
- }
- 146
- }
+ } else {
+ 143 0 final String msg = String.format("Could not connect to Nexus received response code: %d %s" ,
+ 144
+ conn.getResponseCode(), conn.getResponseMessage());
+ 145 0 LOGGER.fine(msg);
+ 146 0 throw new IOException(msg);
147
-
+ }
148
-
- 149
-
- 150
-
- 151
-
- 152
-
- 153
- public boolean preflightRequest() {
- 154
- try {
- 155 0 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(new URL(rootURL, "status" ), useProxy);
- 156 0 conn.addRequestProperty("Accept" , "application/xml" );
- 157 0 conn.connect();
- 158 0 if (conn.getResponseCode() != 200) {
- 159 0 LOGGER.log(Level.WARNING, "Expected 200 result from Nexus, got {0}" , conn.getResponseCode());
- 160 0 return false ;
- 161
- }
- 162 0 final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- 163 0 final Document doc = builder.parse(conn.getInputStream());
- 164 0 if (!"status" .equals(doc.getDocumentElement().getNodeName())) {
- 165 0 LOGGER.log(Level.WARNING, "Expected root node name of status, got {0}" , doc.getDocumentElement().getNodeName());
- 166 0 return false ;
- 167
- }
- 168 0 } catch (Throwable e) {
- 169 0 return false ;
- 170 0 }
- 171
-
- 172 0 return true ;
- 173
}
- 174
- }
- 175
+ 149
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+ public boolean preflightRequest() {
+ 156
+ try {
+ 157 4 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(new URL(rootURL, "status" ), useProxy);
+ 158 4 conn.addRequestProperty("Accept" , "application/xml" );
+ 159 4 conn.connect();
+ 160 4 if (conn.getResponseCode() != 200) {
+ 161 0 LOGGER.log(Level.WARNING, "Expected 200 result from Nexus, got {0}" , conn.getResponseCode());
+ 162 0 return false ;
+ 163
+ }
+ 164 4 final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ 165 4 final Document doc = builder.parse(conn.getInputStream());
+ 166 4 if (!"status" .equals(doc.getDocumentElement().getNodeName())) {
+ 167 0 LOGGER.log(Level.WARNING, "Expected root node name of status, got {0}" , doc.getDocumentElement().getNodeName());
+ 168 0 return false ;
+ 169
+ }
+ 170 0 } catch (Throwable e) {
+ 171 0 return false ;
+ 172 4 }
+ 173
+
+ 174 4 return true ;
+ 175
+ }
176
+ }
+ 177
+
+ 178
-
+
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 adff45eb2..f8f22a5e8 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
@@ -377,6 +377,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 26005863e..da52696e1 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
@@ -134,7 +134,7 @@
58
59
-
+
60
61
@@ -153,6 +153,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 a9bd9f005..89d37d24d 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 23d2bbf74..c931cf3e2 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
@@ -12,7 +12,7 @@
@@ -99,8 +99,8 @@
41
private String getOrNull(Node n) {
- 42 0 if (n != null ) {
- 43 0 return n.getTextContent();
+ 42 3 if (n != null ) {
+ 43 3 return n.getTextContent();
44
} else {
45 0 return null ;
@@ -130,32 +130,32 @@
public NugetPackage parse(InputStream stream) throws NuspecParseException {
58
try {
- 59 0 final Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(stream);
- 60 0 final XPath xpath = XPathFactory.newInstance().newXPath();
- 61 0 final NugetPackage nuspec = new NugetPackage();
+ 59 3 final Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(stream);
+ 60 2 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 61 2 final NugetPackage nuspec = new NugetPackage();
62
- 63 0 if (xpath.evaluate("/package/metadata/id" , d, XPathConstants.NODE) == null
+ 63 2 if (xpath.evaluate("/package/metadata/id" , d, XPathConstants.NODE) == null
64
|| xpath.evaluate("/package/metadata/version" , d, XPathConstants.NODE) == null
65
|| xpath.evaluate("/package/metadata/authors" , d, XPathConstants.NODE) == null
66
|| xpath.evaluate("/package/metadata/description" , d, XPathConstants.NODE) == null ) {
- 67 0 throw new NuspecParseException("Invalid Nuspec format" );
+ 67 1 throw new NuspecParseException("Invalid Nuspec format" );
68
}
69
- 70 0 nuspec.setId(xpath.evaluate("/package/metadata/id" , d));
- 71 0 nuspec.setVersion(xpath.evaluate("/package/metadata/version" , d));
- 72 0 nuspec.setAuthors(xpath.evaluate("/package/metadata/authors" , d));
- 73 0 nuspec.setOwners(getOrNull((Node) xpath.evaluate("/package/metadata/owners" , d, XPathConstants.NODE)));
- 74 0 nuspec.setLicenseUrl(getOrNull((Node) xpath.evaluate("/package/metadata/licenseUrl" , d, XPathConstants.NODE)));
- 75 0 nuspec.setTitle(getOrNull((Node) xpath.evaluate("/package/metadata/title" , d, XPathConstants.NODE)));
- 76 0 return nuspec;
- 77 0 } catch (Throwable e) {
- 78 0 throw new NuspecParseException("Unable to parse nuspec" , e);
+ 70 1 nuspec.setId(xpath.evaluate("/package/metadata/id" , d));
+ 71 1 nuspec.setVersion(xpath.evaluate("/package/metadata/version" , d));
+ 72 1 nuspec.setAuthors(xpath.evaluate("/package/metadata/authors" , d));
+ 73 1 nuspec.setOwners(getOrNull((Node) xpath.evaluate("/package/metadata/owners" , d, XPathConstants.NODE)));
+ 74 1 nuspec.setLicenseUrl(getOrNull((Node) xpath.evaluate("/package/metadata/licenseUrl" , d, XPathConstants.NODE)));
+ 75 1 nuspec.setTitle(getOrNull((Node) xpath.evaluate("/package/metadata/title" , d, XPathConstants.NODE)));
+ 76 1 return nuspec;
+ 77 2 } catch (Throwable e) {
+ 78 2 throw new NuspecParseException("Unable to parse nuspec" , e);
79
}
80
@@ -164,6 +164,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 183c31933..d04b12a10 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
@@ -12,7 +12,7 @@
@@ -106,442 +106,451 @@
44
public final class ConnectionFactory {
45
-
+
46
-
+
47
-
- 48
+ 48 1 private static final Logger LOGGER = Logger.getLogger(ConnectionFactory.class .getName());
49
- public static final String DB_SCHEMA_VERSION = "2.9" ;
+
50
-
+
51
-
+
52
-
+ public static final String DB_SCHEMA_VERSION = "2.9" ;
53
- public static final String DB_STRUCTURE_RESOURCE = "data/initialize.sql" ;
+
54
-
+
55
-
+
56
-
- 57 0 private static Driver driver = null ;
+ public static final String DB_STRUCTURE_RESOURCE = "data/initialize.sql" ;
+ 57
+
58
-
+
59
-
- 60
- 61 0 private static String connectionString = null ;
+ 60 1 private static Driver driver = null ;
+ 61
+
62
-
+
63
-
- 64
- 65 0 private static String userName = null ;
+ 64 1 private static String connectionString = null ;
+ 65
+
66
-
+
67
-
- 68
- 69 0 private static String password = null ;
+ 68 1 private static String userName = null ;
+ 69
+
70
-
+
71
-
- 72
-
+
+ 72 1 private static String password = null ;
73
-
+
74
- private ConnectionFactory() {
+
75
- }
+
76
-
+
77
-
+ private ConnectionFactory() {
78
-
+ }
79
-
+
80
-
+
81
-
+
82
-
+
83
- public static synchronized void initialize() throws DatabaseException {
+
84
-
- 85 0 if (connectionString != null ) {
- 86 0 return ;
+
+ 85
+
+ 86
+ public static synchronized void initialize() throws DatabaseException {
87
- }
- 88 0 Connection conn = null ;
- 89
- try {
+
+ 88 7 if (connectionString != null ) {
+ 89 6 return ;
90
+ }
+ 91 1 Connection conn = null ;
+ 92
+ try {
+ 93
- 91 0 final String driverName = Settings.getString(Settings.KEYS.DB_DRIVER_NAME, "" );
- 92 0 if (!driverName.isEmpty()) {
- 93 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Loading driver: {0}" , driverName);
- 94 0 final String driverPath = Settings.getString(Settings.KEYS.DB_DRIVER_PATH, "" );
- 95
+ 94 1 final String driverName = Settings.getString(Settings.KEYS.DB_DRIVER_NAME, "" );
+ 95 1 if (!driverName.isEmpty()) {
+ 96 1 LOGGER.log(Level.FINE, "Loading driver: {0}" , driverName);
+ 97 1 final String driverPath = Settings.getString(Settings.KEYS.DB_DRIVER_PATH, "" );
+ 98
try {
- 96 0 if (!driverPath.isEmpty()) {
- 97 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Loading driver from: {0}" , driverPath);
- 98 0 driver = DriverLoader.load(driverName, driverPath);
- 99
+ 99 1 if (!driverPath.isEmpty()) {
+ 100 0 LOGGER.log(Level.FINE, "Loading driver from: {0}" , driverPath);
+ 101 0 driver = DriverLoader.load(driverName, driverPath);
+ 102
} else {
- 100 0 driver = DriverLoader.load(driverName);
- 101
+ 103 1 driver = DriverLoader.load(driverName);
+ 104
}
- 102 0 } catch (DriverLoadException ex) {
- 103 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "Unable to load database driver" , ex);
- 104 0 throw new DatabaseException("Unable to load database driver" );
- 105 0 }
- 106
+ 105 0 } catch (DriverLoadException ex) {
+ 106 0 LOGGER.log(Level.FINE, "Unable to load database driver" , ex);
+ 107 0 throw new DatabaseException("Unable to load database driver" );
+ 108 1 }
+ 109
}
- 107 0 userName = Settings.getString(Settings.KEYS.DB_USER, "dcuser" );
- 108
+ 110 1 userName = Settings.getString(Settings.KEYS.DB_USER, "dcuser" );
+ 111
- 109 0 password = Settings.getString(Settings.KEYS.DB_PASSWORD, "DC-Pass1337!" );
- 110
+ 112 1 password = Settings.getString(Settings.KEYS.DB_PASSWORD, "DC-Pass1337!" );
+ 113
try {
- 111 0 connectionString = getConnectionString();
- 112 0 } catch (IOException ex) {
- 113 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE,
- 114
+ 114 1 connectionString = getConnectionString();
+ 115 0 } catch (IOException ex) {
+ 116 0 LOGGER.log(Level.FINE,
+ 117
"Unable to retrieve the database connection string" , ex);
- 115 0 throw new DatabaseException("Unable to retrieve the database connection string" );
- 116 0 }
- 117 0 boolean shouldCreateSchema = false ;
- 118
+ 118 0 throw new DatabaseException("Unable to retrieve the database connection string" );
+ 119 1 }
+ 120 1 boolean shouldCreateSchema = false ;
+ 121
try {
- 119 0 if (connectionString.startsWith("jdbc:h2:file:" )) {
- 120 0 shouldCreateSchema = !dbSchemaExists();
- 121 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Need to create DB Structure: {0}" , shouldCreateSchema);
- 122
+ 122 1 if (connectionString.startsWith("jdbc:h2:file:" )) {
+ 123 1 shouldCreateSchema = !dbSchemaExists();
+ 124 1 LOGGER.log(Level.FINE, "Need to create DB Structure: {0}" , shouldCreateSchema);
+ 125
}
- 123 0 } catch (IOException ioex) {
- 124 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "Unable to verify database exists" , ioex);
- 125 0 throw new DatabaseException("Unable to verify database exists" );
- 126 0 }
- 127 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Loading database connection" );
- 128 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Connection String: {0}" , connectionString);
- 129 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, "Database User: {0}" , userName);
- 130
+ 126 0 } catch (IOException ioex) {
+ 127 0 LOGGER.log(Level.FINE, "Unable to verify database exists" , ioex);
+ 128 0 throw new DatabaseException("Unable to verify database exists" );
+ 129 1 }
+ 130 1 LOGGER.log(Level.FINE, "Loading database connection" );
+ 131 1 LOGGER.log(Level.FINE, "Connection String: {0}" , connectionString);
+ 132 1 LOGGER.log(Level.FINE, "Database User: {0}" , userName);
+ 133
- 131
+ 134
try {
- 132 0 conn = DriverManager.getConnection(connectionString, userName, password);
- 133 0 } catch (SQLException ex) {
- 134 0 if (ex.getMessage().contains("java.net.UnknownHostException" ) && connectionString.contains("AUTO_SERVER=TRUE;" )) {
- 135 0 connectionString = connectionString.replace("AUTO_SERVER=TRUE;" , "" );
- 136
+ 135 1 conn = DriverManager.getConnection(connectionString, userName, password);
+ 136 0 } catch (SQLException ex) {
+ 137 0 if (ex.getMessage().contains("java.net.UnknownHostException" ) && connectionString.contains("AUTO_SERVER=TRUE;" )) {
+ 138 0 connectionString = connectionString.replace("AUTO_SERVER=TRUE;" , "" );
+ 139
try {
- 137 0 conn = DriverManager.getConnection(connectionString, userName, password);
- 138 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
- 139 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE,
- 140
+ 140 0 conn = DriverManager.getConnection(connectionString, userName, password);
+ 141 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
+ 142 0 LOGGER.log(Level.FINE,
+ 143
"Unable to start the database in server mode; reverting to single user mode" );
- 141 0 } catch (SQLException sqlex) {
- 142 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "Unable to connect to the database" , ex);
- 143 0 throw new DatabaseException("Unable to connect to the database" );
- 144 0 }
- 145
- } else {
- 146 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "Unable to connect to the database" , ex);
- 147 0 throw new DatabaseException("Unable to connect to the database" );
+ 144 0 } catch (SQLException sqlex) {
+ 145 0 LOGGER.log(Level.FINE, "Unable to connect to the database" , ex);
+ 146 0 throw new DatabaseException("Unable to connect to the database" );
+ 147 0 }
148
+ } else {
+ 149 0 LOGGER.log(Level.FINE, "Unable to connect to the database" , ex);
+ 150 0 throw new DatabaseException("Unable to connect to the database" );
+ 151
}
- 149 0 }
- 150
+ 152 1 }
+ 153
- 151 0 if (shouldCreateSchema) {
- 152
+ 154 1 if (shouldCreateSchema) {
+ 155
try {
- 153 0 createTables(conn);
- 154 0 } catch (DatabaseException dex) {
- 155 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, null , dex);
- 156 0 throw new DatabaseException("Unable to create the database structure" );
- 157 0 }
- 158
+ 156 0 createTables(conn);
+ 157 0 } catch (DatabaseException dex) {
+ 158 0 LOGGER.log(Level.FINE, null , dex);
+ 159 0 throw new DatabaseException("Unable to create the database structure" );
+ 160 0 }
+ 161
} else {
- 159
+ 162
try {
- 160 0 ensureSchemaVersion(conn);
- 161 0 } catch (DatabaseException dex) {
- 162 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, null , dex);
- 163 0 throw new DatabaseException("Database schema does not match this version of dependency-check" );
- 164 0 }
- 165
- }
- 166
- } finally {
- 167 0 if (conn != null ) {
+ 163 1 ensureSchemaVersion(conn);
+ 164 0 } catch (DatabaseException dex) {
+ 165 0 LOGGER.log(Level.FINE, null , dex);
+ 166 0 throw new DatabaseException("Database schema does not match this version of dependency-check" );
+ 167 1 }
168
- try {
- 169 0 conn.close();
- 170 0 } catch (SQLException ex) {
- 171 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "An error occured closing the connection" , ex);
- 172 0 }
- 173
}
- 174
- }
- 175 0 }
+ 169
+ } finally {
+ 170 1 if (conn != null ) {
+ 171
+ try {
+ 172 1 conn.close();
+ 173 0 } catch (SQLException ex) {
+ 174 0 LOGGER.log(Level.FINE, "An error occurred closing the connection" , ex);
+ 175 1 }
176
-
+ }
177
-
- 178
-
+ }
+ 178 1 }
179
-
+
180
-
+
181
-
+
182
- public static synchronized void cleanup() {
- 183 0 if (driver != null ) {
+
+ 183
+
184
+
+ 185
+ public static synchronized void cleanup() {
+ 186 0 if (driver != null ) {
+ 187
try {
- 185 0 DriverManager.deregisterDriver(driver);
- 186 0 } catch (SQLException ex) {
- 187 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "An error occured unloading the databse driver" , ex);
- 188 0 }
- 189 0 driver = null ;
- 190
- }
- 191 0 connectionString = null ;
- 192 0 userName = null ;
- 193 0 password = null ;
- 194 0 }
- 195
-
+ 188 0 DriverManager.deregisterDriver(driver);
+ 189 0 } catch (SQLException ex) {
+ 190 0 LOGGER.log(Level.FINE, "An error occurred unloading the database driver" , ex);
+ 191 0 } catch (Throwable unexpected) {
+ 192 0 LOGGER.log(Level.FINE,
+ 193
+ "An unexpected throwable occurred unloading the database driver" , unexpected);
+ 194 0 }
+ 195 0 driver = null ;
196
-
- 197
-
- 198
-
- 199
-
- 200
-
+ }
+ 197 0 connectionString = null ;
+ 198 0 userName = null ;
+ 199 0 password = null ;
+ 200 0 }
201
-
+
202
- public static Connection getConnection() throws DatabaseException {
- 203 0 initialize();
- 204 0 Connection conn = null ;
+
+ 203
+
+ 204
+
205
+
+ 206
+
+ 207
+
+ 208
+ public static Connection getConnection() throws DatabaseException {
+ 209 6 initialize();
+ 210 6 Connection conn = null ;
+ 211
try {
- 206 0 conn = DriverManager.getConnection(connectionString, userName, password);
- 207 0 } catch (SQLException ex) {
- 208 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, null , ex);
- 209 0 throw new DatabaseException("Unable to connect to the database" );
- 210 0 }
- 211 0 return conn;
- 212
- }
- 213
-
- 214
-
- 215
-
- 216
-
- 217
-
+ 212 6 conn = DriverManager.getConnection(connectionString, userName, password);
+ 213 0 } catch (SQLException ex) {
+ 214 0 LOGGER.log(Level.FINE, null , ex);
+ 215 0 throw new DatabaseException("Unable to connect to the database" );
+ 216 6 }
+ 217 6 return conn;
218
-
+ }
219
-
+
220
-
+
221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
private static String getConnectionString() throws IOException {
- 222 0 final String connStr = Settings.getString(Settings.KEYS.DB_CONNECTION_STRING, "jdbc:h2:file:%s;AUTO_SERVER=TRUE" );
- 223 0 if (connStr.contains("%s" )) {
- 224 0 final String directory = getDataDirectory().getCanonicalPath();
- 225 0 final File dataFile = new File(directory, "cve." + DB_SCHEMA_VERSION);
- 226 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, String.format("File path for H2 file: '%s'" , dataFile.toString()));
- 227 0 return String.format(connStr, dataFile.getAbsolutePath());
- 228
- }
- 229 0 return connStr;
- 230
- }
- 231
-
- 232
-
- 233
-
+ 228 1 final String connStr = Settings.getString(Settings.KEYS.DB_CONNECTION_STRING, "jdbc:h2:file:%s;AUTO_SERVER=TRUE" );
+ 229 1 if (connStr.contains("%s" )) {
+ 230 1 final String directory = getDataDirectory().getCanonicalPath();
+ 231 1 final File dataFile = new File(directory, "cve." + DB_SCHEMA_VERSION);
+ 232 1 LOGGER.log(Level.FINE, String.format("File path for H2 file: '%s'" , dataFile.toString()));
+ 233 1 return String.format(connStr, dataFile.getAbsolutePath());
234
-
- 235
-
+ }
+ 235 0 return connStr;
236
-
+ }
237
-
+
238
-
+
239
- public static File getDataDirectory() throws IOException {
- 240 0 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
- 241 0 if (!path.exists()) {
- 242 0 if (!path.mkdirs()) {
- 243 0 throw new IOException("Unable to create NVD CVE Data directory" );
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
244
- }
+
245
- }
- 246 0 return path;
- 247
- }
- 248
-
- 249
-
+ public static File getDataDirectory() throws IOException {
+ 246 2 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
+ 247 2 if (!path.exists()) {
+ 248 0 if (!path.mkdirs()) {
+ 249 0 throw new IOException("Unable to create NVD CVE Data directory" );
250
-
+ }
251
-
- 252
-
- 253
-
- 254
-
- 255
- private static boolean dbSchemaExists() throws IOException {
- 256 0 final File dir = getDataDirectory();
- 257 0 final String name = String.format("cve.%s.h2.db" , DB_SCHEMA_VERSION);
- 258 0 final File file = new File(dir, name);
- 259 0 return file.exists();
- 260
- }
- 261
-
- 262
-
- 263
-
- 264
-
- 265
-
- 266
-
- 267
-
- 268
- private static void createTables(Connection conn) throws DatabaseException {
- 269 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, "Creating database structure" );
- 270
- InputStream is;
- 271
- InputStreamReader reader;
- 272 0 BufferedReader in = null ;
- 273
- try {
- 274 0 is = ConnectionFactory.class .getClassLoader().getResourceAsStream(DB_STRUCTURE_RESOURCE);
- 275 0 reader = new InputStreamReader(is, "UTF-8" );
- 276 0 in = new BufferedReader(reader);
- 277 0 final StringBuilder sb = new StringBuilder(2110);
- 278
- String tmp;
- 279 0 while ((tmp = in.readLine()) != null ) {
- 280 0 sb.append(tmp);
- 281
- }
- 282 0 Statement statement = null ;
- 283
- try {
- 284 0 statement = conn.createStatement();
- 285 0 statement.execute(sb.toString());
- 286 0 } catch (SQLException ex) {
- 287 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, null , ex);
- 288 0 throw new DatabaseException("Unable to create database statement" , ex);
- 289
- } finally {
- 290 0 DBUtils.closeStatement(statement);
- 291 0 }
- 292 0 } catch (IOException ex) {
- 293 0 throw new DatabaseException("Unable to create database schema" , ex);
- 294
- } finally {
- 295 0 if (in != null ) {
- 296
- try {
- 297 0 in.close();
- 298 0 } catch (IOException ex) {
- 299 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINEST, null , ex);
- 300 0 }
- 301
- }
- 302
}
- 303 0 }
- 304
+ 252 2 return path;
+ 253
+ }
+ 254
- 305
+ 255
- 306
-
- 307
+ 256
+
+ 257
- 308
-
- 309
-
- 310
+ 258
+
+ 259
+
+ 260
- 311
- private static void ensureSchemaVersion(Connection conn) throws DatabaseException {
- 312 0 ResultSet rs = null ;
- 313 0 CallableStatement cs = null ;
- 314
+ 261
+ private static boolean dbSchemaExists() throws IOException {
+ 262 1 final File dir = getDataDirectory();
+ 263 1 final String name = String.format("cve.%s.h2.db" , DB_SCHEMA_VERSION);
+ 264 1 final File file = new File(dir, name);
+ 265 1 return file.exists();
+ 266
+ }
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+
+ 273
+
+ 274
+ private static void createTables(Connection conn) throws DatabaseException {
+ 275 0 LOGGER.log(Level.FINE, "Creating database structure" );
+ 276
+ InputStream is;
+ 277
+ InputStreamReader reader;
+ 278 0 BufferedReader in = null ;
+ 279
try {
- 315 0 cs = conn.prepareCall("SELECT value FROM properties WHERE id = 'version'" );
- 316 0 rs = cs.executeQuery();
- 317 0 if (rs.next()) {
- 318 0 final boolean isWrongSchema = !DB_SCHEMA_VERSION.equals(rs.getString(1));
- 319 0 if (isWrongSchema) {
- 320 0 throw new DatabaseException("Incorrect database schema; unable to continue" );
- 321
- }
- 322 0 } else {
- 323 0 throw new DatabaseException("Database schema is missing" );
- 324
+ 280 0 is = ConnectionFactory.class .getClassLoader().getResourceAsStream(DB_STRUCTURE_RESOURCE);
+ 281 0 reader = new InputStreamReader(is, "UTF-8" );
+ 282 0 in = new BufferedReader(reader);
+ 283 0 final StringBuilder sb = new StringBuilder(2110);
+ 284
+ String tmp;
+ 285 0 while ((tmp = in.readLine()) != null ) {
+ 286 0 sb.append(tmp);
+ 287
}
- 325 0 } catch (SQLException ex) {
- 326 0 Logger.getLogger(ConnectionFactory.class .getName()).log(Level.FINE, null , ex);
- 327 0 throw new DatabaseException("Unable to check the database schema version" );
- 328
+ 288 0 Statement statement = null ;
+ 289
+ try {
+ 290 0 statement = conn.createStatement();
+ 291 0 statement.execute(sb.toString());
+ 292 0 } catch (SQLException ex) {
+ 293 0 LOGGER.log(Level.FINE, null , ex);
+ 294 0 throw new DatabaseException("Unable to create database statement" , ex);
+ 295
+ } finally {
+ 296 0 DBUtils.closeStatement(statement);
+ 297 0 }
+ 298 0 } catch (IOException ex) {
+ 299 0 throw new DatabaseException("Unable to create database schema" , ex);
+ 300
} finally {
- 329 0 DBUtils.closeResultSet(rs);
- 330 0 DBUtils.closeStatement(cs);
- 331 0 }
- 332 0 }
- 333
+ 301 0 if (in != null ) {
+ 302
+ try {
+ 303 0 in.close();
+ 304 0 } catch (IOException ex) {
+ 305 0 LOGGER.log(Level.FINEST, null , ex);
+ 306 0 }
+ 307
+ }
+ 308
+ }
+ 309 0 }
+ 310
+
+ 311
+
+ 312
+
+ 313
+
+ 314
+
+ 315
+
+ 316
+
+ 317
+ private static void ensureSchemaVersion(Connection conn) throws DatabaseException {
+ 318 1 ResultSet rs = null ;
+ 319 1 CallableStatement cs = null ;
+ 320
+ try {
+ 321 1 cs = conn.prepareCall("SELECT value FROM properties WHERE id = 'version'" );
+ 322 1 rs = cs.executeQuery();
+ 323 1 if (rs.next()) {
+ 324 1 final boolean isWrongSchema = !DB_SCHEMA_VERSION.equals(rs.getString(1));
+ 325 1 if (isWrongSchema) {
+ 326 0 throw new DatabaseException("Incorrect database schema; unable to continue" );
+ 327
+ }
+ 328 1 } else {
+ 329 0 throw new DatabaseException("Database schema is missing" );
+ 330
+ }
+ 331 0 } catch (SQLException ex) {
+ 332 0 LOGGER.log(Level.FINE, null , ex);
+ 333 0 throw new DatabaseException("Unable to check the database schema version" );
+ 334
+ } finally {
+ 335 1 DBUtils.closeResultSet(rs);
+ 336 1 DBUtils.closeStatement(cs);
+ 337 1 }
+ 338 1 }
+ 339
}
-
+
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 866b0a7cf..a317aee4e 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
@@ -121,6 +121,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 9ed07ff81..2d0f33604 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
@@ -137,6 +137,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 8326a4e47..e6aba6379 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
@@ -12,7 +12,7 @@
@@ -56,23 +56,23 @@
19
20
- import com.hazelcast.logging.Logger;
- 21
import java.text.DateFormat;
- 22
+ 21
import java.text.SimpleDateFormat;
- 23
+ 22
import java.util.Date;
- 24
+ 23
import java.util.Map;
- 25
+ 24
import java.util.Map.Entry;
- 26
+ 25
import java.util.Properties;
- 27
+ 26
import java.util.TreeMap;
- 28
+ 27
import java.util.logging.Level;
+ 28
+ import java.util.logging.Logger;
29
import org.owasp.dependencycheck.data.update.NvdCveInfo;
30
@@ -96,226 +96,233 @@
39
40
-
+
41
-
- 42
+ 42 1 private static final Logger LOGGER = Logger.getLogger(DatabaseProperties.class .getName());
43
- public static final String MODIFIED = "Modified" ;
+
44
-
+
45
-
+
46
-
+
47
-
+ public static final String MODIFIED = "Modified" ;
48
- public static final String LAST_UPDATED = "NVD CVE Modified" ;
+
49
-
+
50
-
+
51
-
- 52
+ 52
+ public static final String LAST_UPDATED = "NVD CVE Modified" ;
53
- public static final String LAST_UPDATED_BASE = "NVD CVE " ;
- 54
+ 54
+
55
-
+
56
57
- private Properties properties;
+ public static final String LAST_UPDATED_BASE = "NVD CVE " ;
58
59
-
+
60
61
- private CveDB cveDB;
+ private Properties properties;
62
-
+
63
-
+
64
-
+
65
-
+ private CveDB cveDB;
66
-
+
67
-
- 68 0 DatabaseProperties(CveDB cveDB) {
- 69 0 this .cveDB = cveDB;
- 70 0 loadProperties();
- 71 0 }
- 72
-
- 73
- 74
-
- 75
+ 68
+
+ 69
+
+ 70
+
+ 71
+ 72 3 DatabaseProperties(CveDB cveDB) {
+ 73 3 this .cveDB = cveDB;
+ 74 3 loadProperties();
+ 75 3 }
76
- private void loadProperties() {
- 77 0 this .properties = cveDB.getProperties();
- 78 0 }
+
+ 77
+
+ 78
+
79
-
+
80
-
- 81
-
- 82
-
+ private void loadProperties() {
+ 81 3 this .properties = cveDB.getProperties();
+ 82 3 }
83
-
+
84
-
+
85
- public boolean isEmpty() {
- 86 0 return properties == null || properties.isEmpty();
+
+ 86
+
87
- }
+
88
-
+
89
-
- 90
-
+ public boolean isEmpty() {
+ 90 0 return properties == null || properties.isEmpty();
91
-
+ }
92
-
+
93
-
+
94
-
+
95
- public void save(NvdCveInfo updatedValue) throws UpdateException {
- 96 0 if (updatedValue == null ) {
- 97 0 return ;
+
+ 96
+
+ 97
+
98
- }
- 99 0 properties.put(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp()));
- 100 0 cveDB.saveProperty(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp()));
- 101 0 }
+
+ 99
+ public void save(NvdCveInfo updatedValue) throws UpdateException {
+ 100 0 if (updatedValue == null ) {
+ 101 0 return ;
102
-
- 103
-
- 104
-
- 105
-
+ }
+ 103 0 properties.put(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp()));
+ 104 0 cveDB.saveProperty(LAST_UPDATED_BASE + updatedValue.getId(), String.valueOf(updatedValue.getTimestamp()));
+ 105 0 }
106
-
+
107
-
+
108
-
+
109
-
+
110
- public String getProperty(String key) {
- 111 0 return properties.getProperty(key);
- 112
- }
- 113
-
- 114
-
- 115
-
- 116
-
- 117
- 118
+ 111
- 119
-
- 120
+ 112
+ 113
+
+ 114
+ public String getProperty(String key) {
+ 115 0 return properties.getProperty(key);
+ 116
+ }
+ 117
+
+ 118
+
+ 119
+
+ 120
+
121
-
+
122
- public String getProperty(String key, String defaultValue) {
- 123 0 return properties.getProperty(key, defaultValue);
+
+ 123
+
124
- }
+
125
-
+
126
-
- 127
-
+ public String getProperty(String key, String defaultValue) {
+ 127 0 return properties.getProperty(key, defaultValue);
128
-
+ }
129
-
- 130
-
- 131
- public Properties getProperties() {
- 132
- return properties;
- 133
- }
- 134
- 135
+ 130
- 136
-
- 137
-
- 138
+ 131
+
+ 132
- 139
-
- 140
+ 133
+
+ 134
- 141
- public Map getMetaData() {
- 142 0 final TreeMap map = new TreeMap();
- 143 0 for (Entry<Object, Object> entry : properties.entrySet()) {
- 144 0 final String key = (String) entry.getKey();
- 145 0 if (!"version" .equals(key)) {
- 146 0 if (key.startsWith("NVD CVE " )) {
- 147
- try {
- 148 0 final long epoch = Long.parseLong((String) entry.getValue());
- 149 0 final Date date = new Date(epoch);
- 150 0 final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss" );
- 151 0 final String formatted = format.format(date);
- 152 0 map.put(key, formatted);
- 153 0 } catch (Throwable ex) {
- 154 0 Logger.getLogger(DatabaseProperties.class .getName()).log(Level.FINE, "Unable to parse timestamp from DB" , ex);
- 155 0 map.put(key, entry.getValue());
- 156 0 }
- 157
- } else {
- 158 0 map.put(key, entry.getValue());
- 159
- }
- 160
- }
- 161 0 }
- 162 0 return map;
- 163
+ 135
+ public Properties getProperties() {
+ 136
+ return properties;
+ 137
}
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+ public Map getMetaData() {
+ 146 0 final TreeMap map = new TreeMap();
+ 147 0 for (Entry<Object, Object> entry : properties.entrySet()) {
+ 148 0 final String key = (String) entry.getKey();
+ 149 0 if (!"version" .equals(key)) {
+ 150 0 if (key.startsWith("NVD CVE " )) {
+ 151
+ try {
+ 152 0 final long epoch = Long.parseLong((String) entry.getValue());
+ 153 0 final Date date = new Date(epoch);
+ 154 0 final DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss" );
+ 155 0 final String formatted = format.format(date);
+ 156 0 map.put(key, formatted);
+ 157 0 } catch (Throwable ex) {
+ 158 0 LOGGER.log(Level.FINE, "Unable to parse timestamp from DB" , ex);
+ 159 0 map.put(key, entry.getValue());
+ 160 0 }
+ 161
+ } else {
+ 162 0 map.put(key, entry.getValue());
+ 163
+ }
164
+ }
+ 165 0 }
+ 166 0 return map;
+ 167
+ }
+ 168
}
-
+
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 cd9b7af9d..0e7464450 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
@@ -137,6 +137,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 9f582e0df..c9f28a64d 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
@@ -12,8 +12,8 @@
@@ -99,172 +99,181 @@
40
41
-
+
42
- 43
- private DriverLoader() {
+ 43 1 private static final Logger LOGGER = Logger.getLogger(DriverLoader.class .getName());
44
- }
+
45
-
+
46
-
+
47
-
+
48
-
+ private DriverLoader() {
49
-
+ }
50
-
+
51
-
+
52
-
+
53
- public static Driver load(String className) throws DriverLoadException {
- 54 0 final ClassLoader loader = DriverLoader.class .getClassLoader();
- 55 0 return load(className, loader);
+
+ 54
+
+ 55
+
56
- }
+
57
-
+
58
-
- 59
-
- 60
-
+ public static Driver load(String className) throws DriverLoadException {
+ 59 3 final ClassLoader loader = DriverLoader.class .getClassLoader();
+ 60 3 return load(className, loader);
61
-
+ }
62
-
+
63
-
- 64
-
- 65
-
- 66
-
- 67
-
- 68
-
- 69
-
- 70
-
- 71
- public static Driver load(String className, String pathToDriver) throws DriverLoadException {
- 72 0 final URLClassLoader parent = (URLClassLoader) ClassLoader.getSystemClassLoader();
- 73 0 final ArrayList<URL> urls = new ArrayList<URL>();
- 74 0 final String[] paths = pathToDriver.split(File.pathSeparator);
- 75 0 for (String path : paths) {
- 76 0 final File file = new File(path);
- 77 0 if (file.isDirectory()) {
- 78 0 final File[] files = file.listFiles();
- 79
-
- 80 0 for (File f : files) {
- 81
- try {
- 82 0 urls.add(f.toURI().toURL());
- 83 0 } catch (MalformedURLException ex) {
- 84 0 final String msg = String.format("Unable to load database driver '%s'; invalid path provided '%s'" ,
- 85
- className, f.getAbsoluteFile());
- 86 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 87 0 throw new DriverLoadException(msg, ex);
- 88 0 }
- 89
- }
- 90 0 } else if (file.exists()) {
- 91
- try {
- 92 0 urls.add(file.toURI().toURL());
- 93 0 } catch (MalformedURLException ex) {
- 94 0 final String msg = String.format("Unable to load database driver '%s'; invalid path provided '%s'" ,
- 95
- className, file.getAbsoluteFile());
- 96 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 97 0 throw new DriverLoadException(msg, ex);
- 98 0 }
- 99
- }
- 100
- }
- 101 0 final URLClassLoader loader = AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>() {
- 102
- @Override
- 103
- public URLClassLoader run() {
- 104 0 return new URLClassLoader(urls.toArray(new URL[urls.size()]), parent);
- 105
- }
- 106
- });
- 107
-
- 108 0 return load(className, loader);
- 109
- }
- 110
-
- 111
- 112
-
- 113
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
- 114
+ 70
- 115
-
- 116
+ 71
+
+ 72
+
+ 73
- 117
+ 74
- 118
+ 75
- 119
- private static Driver load(String className, ClassLoader loader) throws DriverLoadException {
- 120
- try {
- 121 0 final Class c = Class.forName(className, true , loader);
- 122
-
- 123 0 final Driver driver = (Driver) c.newInstance();
- 124 0 final Driver shim = new DriverShim(driver);
- 125
-
- 126 0 DriverManager.registerDriver(shim);
- 127 0 return shim;
- 128 0 } catch (ClassNotFoundException ex) {
- 129 0 final String msg = String.format("Unable to load database driver '%s'" , className);
- 130 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 131 0 throw new DriverLoadException(msg, ex);
- 132 0 } catch (InstantiationException ex) {
- 133 0 final String msg = String.format("Unable to load database driver '%s'" , className);
- 134 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 135 0 throw new DriverLoadException(msg, ex);
- 136 0 } catch (IllegalAccessException ex) {
- 137 0 final String msg = String.format("Unable to load database driver '%s'" , className);
- 138 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 139 0 throw new DriverLoadException(msg, ex);
- 140 0 } catch (SQLException ex) {
- 141 0 final String msg = String.format("Unable to load database driver '%s'" , className);
- 142 0 Logger.getLogger(DriverLoader.class .getName()).log(Level.FINE, msg, ex);
- 143 0 throw new DriverLoadException(msg, ex);
- 144
+ 76
+ public static Driver load(String className, String pathToDriver) throws DriverLoadException {
+ 77 4 final URLClassLoader parent = (URLClassLoader) ClassLoader.getSystemClassLoader();
+ 78 4 final ArrayList<URL> urls = new ArrayList<URL>();
+ 79 4 final String[] paths = pathToDriver.split(File.pathSeparator);
+ 80 9 for (String path : paths) {
+ 81 5 final File file = new File(path);
+ 82 5 if (file.isDirectory()) {
+ 83 2 final File[] files = file.listFiles();
+ 84
+
+ 85 29 for (File f : files) {
+ 86
+ try {
+ 87 27 urls.add(f.toURI().toURL());
+ 88 0 } catch (MalformedURLException ex) {
+ 89 0 final String msg = String.format("Unable to load database driver '%s'; invalid path provided '%s'" ,
+ 90
+ className, f.getAbsoluteFile());
+ 91 0 LOGGER.log(Level.FINE, msg, ex);
+ 92 0 throw new DriverLoadException(msg, ex);
+ 93 27 }
+ 94
+ }
+ 95 2 } else if (file.exists()) {
+ 96
+ try {
+ 97 2 urls.add(file.toURI().toURL());
+ 98 0 } catch (MalformedURLException ex) {
+ 99 0 final String msg = String.format("Unable to load database driver '%s'; invalid path provided '%s'" ,
+ 100
+ className, file.getAbsoluteFile());
+ 101 0 LOGGER.log(Level.FINE, msg, ex);
+ 102 0 throw new DriverLoadException(msg, ex);
+ 103 2 }
+ 104
+ }
+ 105
}
- 145
+ 106 4 final URLClassLoader loader = AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>() {
+ 107
+ @Override
+ 108
+ public URLClassLoader run() {
+ 109 4 return new URLClassLoader(urls.toArray(new URL[urls.size()]), parent);
+ 110
+ }
+ 111
+ });
+ 112
+
+ 113 4 return load(className, loader);
+ 114
}
- 146
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+ private static Driver load(String className, ClassLoader loader) throws DriverLoadException {
+ 125
+ try {
+ 126 7 final Class c = Class.forName(className, true , loader);
+ 127
+
+ 128 4 final Driver driver = (Driver) c.newInstance();
+ 129 4 final Driver shim = new DriverShim(driver);
+ 130
+
+ 131 4 DriverManager.registerDriver(shim);
+ 132 4 return shim;
+ 133 3 } catch (ClassNotFoundException ex) {
+ 134 3 final String msg = String.format("Unable to load database driver '%s'" , className);
+ 135 3 LOGGER.log(Level.FINE, msg, ex);
+ 136 3 throw new DriverLoadException(msg, ex);
+ 137 0 } catch (InstantiationException ex) {
+ 138 0 final String msg = String.format("Unable to load database driver '%s'" , className);
+ 139 0 LOGGER.log(Level.FINE, msg, ex);
+ 140 0 throw new DriverLoadException(msg, ex);
+ 141 0 } catch (IllegalAccessException ex) {
+ 142 0 final String msg = String.format("Unable to load database driver '%s'" , className);
+ 143 0 LOGGER.log(Level.FINE, msg, ex);
+ 144 0 throw new DriverLoadException(msg, ex);
+ 145 0 } catch (SQLException ex) {
+ 146 0 final String msg = String.format("Unable to load database driver '%s'" , className);
+ 147 0 LOGGER.log(Level.FINE, msg, ex);
+ 148 0 throw new DriverLoadException(msg, ex);
+ 149
+ }
+ 150
+ }
+ 151
}
-
+
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 131dd0002..7ec760ac4 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
@@ -12,7 +12,7 @@
@@ -102,292 +102,299 @@
42
43
-
+
44
- 45
- private final Driver driver;
+ 45 1 private static final Logger LOGGER = Logger.getLogger(DriverShim.class .getName());
46
-
+
47
-
+
48
-
+
49
-
+ private final Driver driver;
50
-
+
51
-
+
52
- DriverShim(Driver driver) {
+
53
- this .driver = driver;
+
54
- }
+
55
-
+
56
-
+ DriverShim(Driver driver) {
57
-
+ this .driver = driver;
58
-
+ }
59
-
+
60
-
+
61
-
+
62
-
+
63
-
+
64
-
+
65
- @Override
+
66
- public boolean acceptsURL(String url) throws SQLException {
- 67 0 return this .driver.acceptsURL(url);
- 68
- }
- 69
-
- 70
-
- 71
-
- 72
-
- 73
-
- 74
-
- 75
-
- 76
+ 67
+
+ 68
+
+ 69
+ @Override
+ 70
+ public boolean acceptsURL(String url) throws SQLException {
+ 71 2 return this .driver.acceptsURL(url);
+ 72
+ }
+ 73
+
+ 74
+
+ 75
+
+ 76
+
77
-
- 78
-
- 79
- @Override
- 80
- public Connection connect(String url, Properties info) throws SQLException {
- 81 0 return this .driver.connect(url, info);
- 82
- }
- 83
-
- 84
-
- 85
-
- 86
-
- 87
-
- 88
-
- 89
-
- 90
- @Override
- 91
- public int getMajorVersion() {
- 92 0 return this .driver.getMajorVersion();
- 93
- }
- 94
-
- 95
-
- 96
-
- 97
-
- 98
-
- 99
-
- 100
-
- 101
- @Override
- 102
- public int getMinorVersion() {
- 103 0 return this .driver.getMinorVersion();
- 104
- }
- 105
-
- 106
-
- 107
-
- 108
-
- 109
-
- 110
-
- 111
-
- 112
-
- 113
-
- 114
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- 115
-
- 116 0 Method m = null ;
- 117
- try {
- 118 0 m = driver.getClass().getMethod("getParentLogger" );
- 119 0 } catch (Throwable e) {
- 120 0 throw new SQLFeatureNotSupportedException();
- 121 0 }
- 122 0 if (m != null ) {
- 123
- try {
- 124 0 return (Logger) m.invoke(m);
- 125 0 } catch (IllegalAccessException ex) {
- 126 0 Logger.getLogger(DriverShim.class .getName()).log(Level.FINER, null , ex);
- 127 0 } catch (IllegalArgumentException ex) {
- 128 0 Logger.getLogger(DriverShim.class .getName()).log(Level.FINER, null , ex);
- 129 0 } catch (InvocationTargetException ex) {
- 130 0 Logger.getLogger(DriverShim.class .getName()).log(Level.FINER, null , ex);
- 131 0 }
- 132
- }
- 133 0 throw new SQLFeatureNotSupportedException();
- 134
- }
- 135
-
- 136
-
- 137
-
- 138
-
- 139
- 140
+ 78
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+ @Override
+ 84
+ public Connection connect(String url, Properties info) throws SQLException {
+ 85 0 return this .driver.connect(url, info);
+ 86
+ }
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+ @Override
+ 95
+ public int getMajorVersion() {
+ 96 0 return this .driver.getMajorVersion();
+ 97
+ }
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+ @Override
+ 106
+ public int getMinorVersion() {
+ 107 0 return this .driver.getMinorVersion();
+ 108
+ }
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ 119
+
+ 120 0 Method m = null ;
+ 121
+ try {
+ 122 0 m = driver.getClass().getMethod("getParentLogger" );
+ 123 0 } catch (Throwable e) {
+ 124 0 throw new SQLFeatureNotSupportedException();
+ 125 0 }
+ 126 0 if (m != null ) {
+ 127
+ try {
+ 128 0 return (Logger) m.invoke(m);
+ 129 0 } catch (IllegalAccessException ex) {
+ 130 0 LOGGER.log(Level.FINER, null , ex);
+ 131 0 } catch (IllegalArgumentException ex) {
+ 132 0 LOGGER.log(Level.FINER, null , ex);
+ 133 0 } catch (InvocationTargetException ex) {
+ 134 0 LOGGER.log(Level.FINER, null , ex);
+ 135 0 }
+ 136
+ }
+ 137 0 throw new SQLFeatureNotSupportedException();
+ 138
+ }
+ 139
+
+ 140
+
141
-
+
142
-
+
143
-
+
144
-
+
145
- @Override
+
146
- public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
- 147 0 return this .driver.getPropertyInfo(url, info);
+
+ 147
+
148
- }
+
149
-
+ @Override
150
-
- 151
-
+ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
+ 151 0 return this .driver.getPropertyInfo(url, info);
152
-
+ }
153
-
+
154
-
+
155
-
+
156
- @Override
+
157
- public boolean jdbcCompliant() {
- 158 0 return this .driver.jdbcCompliant();
+
+ 158
+
159
- }
+
160
-
+ @Override
161
-
- 162
-
+ public boolean jdbcCompliant() {
+ 162 0 return this .driver.jdbcCompliant();
163
-
+ }
164
-
+
165
-
+
166
- @Override
+
167
- public int hashCode() {
- 168 0 int hash = 7;
- 169 0 hash = 97 * hash + (this .driver != null ? this .driver.hashCode() : 0);
- 170 0 return hash;
+
+ 168
+
+ 169
+
+ 170
+ @Override
171
- }
- 172
-
- 173
-
- 174
-
+ public int hashCode() {
+ 172 0 int hash = 7;
+ 173 0 hash = 97 * hash + (this .driver != null ? this .driver.hashCode() : 0);
+ 174 0 return hash;
175
-
+ }
176
-
- 177
-
- 178
-
- 179
- @Override
- 180
- public boolean equals(Object obj) {
- 181 0 if (obj == null ) {
- 182 0 return false ;
- 183
- }
- 184 0 if (getClass() != obj.getClass()) {
- 185 0 return false ;
- 186
- }
- 187 0 final DriverShim other = (DriverShim) obj;
- 188 0 return this .driver == other.driver || (this .driver != null && this .driver.equals(other.driver));
- 189
- }
- 190
- 191
+ 177
- 192
-
- 193
+ 178
+
+ 179
- 194
-
- 195
+ 180
+
+ 181
+
+ 182
- 196
+ 183
@Override
- 197
- public String toString() {
- 198 0 return "DriverShim{" + "driver=" + driver + '}' ;
- 199
+ 184
+ public boolean equals(Object obj) {
+ 185 0 if (obj == null ) {
+ 186 0 return false ;
+ 187
+ }
+ 188 0 if (getClass() != obj.getClass()) {
+ 189 0 return false ;
+ 190
+ }
+ 191 0 final DriverShim other = (DriverShim) obj;
+ 192 0 return this .driver == other.driver || (this .driver != null && this .driver.equals(other.driver));
+ 193
}
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
200
+ @Override
+ 201
+ public String toString() {
+ 202 7 return "DriverShim{" + "driver=" + driver + '}' ;
+ 203
+ }
+ 204
}
-
+
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 98ff7d4cd..1fe3b5c81 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
@@ -93,6 +93,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 33c84387b..921d55830 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
@@ -293,6 +293,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 c71451c84..b496fe839 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
@@ -12,7 +12,7 @@
@@ -84,42 +84,51 @@
33
34
-
+
35
-
- 36
-
- 37
-
- 38
+ 36 0 private static final Logger LOGGER = Logger.getLogger(NvdCveUpdater.class .getName());
+ 37
+
+ 38
+
39
- @Override
+
40
- public void update() throws UpdateException {
+
41
- try {
- 42 0 final StandardUpdate task = new StandardUpdate();
- 43 0 if (task.isUpdateNeeded()) {
- 44 0 task.update();
+
+ 42
+
+ 43
+
+ 44
+ @Override
45
+ public void update() throws UpdateException {
+ 46
+ try {
+ 47 0 final StandardUpdate task = new StandardUpdate();
+ 48 0 if (task.isUpdateNeeded()) {
+ 49 0 task.update();
+ 50
}
- 46 0 } catch (MalformedURLException ex) {
- 47 0 Logger.getLogger(NvdCveUpdater.class .getName()).log(Level.WARNING,
- 48
+ 51 0 } catch (MalformedURLException ex) {
+ 52 0 LOGGER.log(Level.WARNING,
+ 53
"NVD CVE properties files contain an invalid URL, unable to update the data to use the most current data." );
- 49 0 Logger.getLogger(NvdCveUpdater.class .getName()).log(Level.FINE, null , ex);
- 50 0 } catch (DownloadFailedException ex) {
- 51 0 Logger.getLogger(NvdCveUpdater.class .getName()).log(Level.WARNING,
- 52
+ 54 0 LOGGER.log(Level.FINE, null , ex);
+ 55 0 } catch (DownloadFailedException ex) {
+ 56 0 LOGGER.log(Level.WARNING,
+ 57
"Unable to download the NVD CVE data, unable to update the data to use the most current data." );
- 53 0 Logger.getLogger(NvdCveUpdater.class .getName()).log(Level.FINE, null , ex);
- 54 0 }
- 55 0 }
- 56
+ 58 0 LOGGER.log(Level.FINE, null , ex);
+ 59 0 }
+ 60 0 }
+ 61
}
-
+
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 ea64cc014..dd4794a96 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
@@ -12,7 +12,7 @@
@@ -118,429 +118,432 @@
50
51
-
+
52
- 53 0 public static final int MAX_THREAD_POOL_SIZE = Settings.getInt(Settings.KEYS.MAX_DOWNLOAD_THREAD_POOL_SIZE, 3);
+ 53 0 private static final Logger LOGGER = Logger.getLogger(StandardUpdate.class .getName());
54
55
-
+
56
- 57
- private DatabaseProperties properties;
+ 57 0 public static final int MAX_THREAD_POOL_SIZE = Settings.getInt(Settings.KEYS.MAX_DOWNLOAD_THREAD_POOL_SIZE, 3);
58
59
-
+
60
61
- private UpdateableNvdCve updateable;
+ private DatabaseProperties properties;
62
63
-
+
64
- 65 0 private CveDB cveDB = null ;
+ 65
+ private UpdateableNvdCve updateable;
66
-
+
67
-
+
68
-
- 69
-
+
+ 69 0 private CveDB cveDB = null ;
70
-
+
71
-
+
72
- public boolean isUpdateNeeded() {
- 73 0 return updateable.isUpdateNeeded();
+
+ 73
+
74
- }
+
75
-
+
76
-
- 77
-
+ public boolean isUpdateNeeded() {
+ 77 0 return updateable.isUpdateNeeded();
78
-
+ }
79
-
- 80
-
- 81
-
- 82
-
- 83 0 public StandardUpdate() throws MalformedURLException, DownloadFailedException, UpdateException {
- 84 0 openDataStores();
- 85 0 properties = cveDB.getDatabaseProperties();
- 86 0 updateable = updatesNeeded();
- 87 0 }
- 88
- 89
+ 80
- 90
-
- 91
-
- 92
+ 81
+
+ 82
- 93
-
- 94
+ 83
+
+ 84
+
+ 85
+
+ 86
+ 87 0 public StandardUpdate() throws MalformedURLException, DownloadFailedException, UpdateException {
+ 88 0 openDataStores();
+ 89 0 properties = cveDB.getDatabaseProperties();
+ 90 0 updateable = updatesNeeded();
+ 91 0 }
+ 92
+
+ 93
+
+ 94
+
95
- public void update() throws UpdateException {
- 96 0 int maxUpdates = 0;
+
+ 96
+
97
- try {
- 98 0 for (NvdCveInfo cve : updateable) {
- 99 0 if (cve.getNeedsUpdate()) {
- 100 0 maxUpdates += 1;
+
+ 98
+
+ 99
+ public void update() throws UpdateException {
+ 100 0 int maxUpdates = 0;
101
- }
- 102 0 }
- 103 0 if (maxUpdates <= 0) {
- 104
- return ;
+ try {
+ 102 0 for (NvdCveInfo cve : updateable) {
+ 103 0 if (cve.getNeedsUpdate()) {
+ 104 0 maxUpdates += 1;
105
- }
- 106 0 if (maxUpdates > 3) {
- 107 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.INFO,
+ }
+ 106 0 }
+ 107 0 if (maxUpdates <= 0) {
108
- "NVD CVE requires several updates; this could take a couple of minutes." );
+ return ;
109
}
- 110 0 if (maxUpdates > 0) {
- 111 0 openDataStores();
+ 110 0 if (maxUpdates > 3) {
+ 111 0 LOGGER.log(Level.INFO,
112
- }
+ "NVD CVE requires several updates; this could take a couple of minutes." );
113
-
- 114 0 final int poolSize = (MAX_THREAD_POOL_SIZE < maxUpdates) ? MAX_THREAD_POOL_SIZE : maxUpdates;
- 115
-
- 116 0 final ExecutorService downloadExecutors = Executors.newFixedThreadPool(poolSize);
- 117 0 final ExecutorService processExecutor = Executors.newSingleThreadExecutor();
- 118 0 final Set<Future<Future<ProcessTask>>> downloadFutures = new HashSet<Future<Future<ProcessTask>>>(maxUpdates);
- 119 0 for (NvdCveInfo cve : updateable) {
- 120 0 if (cve.getNeedsUpdate()) {
- 121 0 final CallableDownloadTask call = new CallableDownloadTask(cve, processExecutor, cveDB);
- 122 0 downloadFutures.add(downloadExecutors.submit(call));
- 123
- }
- 124 0 }
- 125 0 downloadExecutors.shutdown();
- 126
-
- 127
-
- 128 0 final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates);
- 129 0 for (Future<Future<ProcessTask>> future : downloadFutures) {
- 130 0 Future<ProcessTask> task = null ;
- 131
- try {
- 132 0 task = future.get();
- 133 0 } catch (InterruptedException ex) {
- 134 0 downloadExecutors.shutdownNow();
- 135 0 processExecutor.shutdownNow();
- 136
-
- 137 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Thread was interrupted during download" , ex);
- 138 0 throw new UpdateException("The download was interrupted" , ex);
- 139 0 } catch (ExecutionException ex) {
- 140 0 downloadExecutors.shutdownNow();
- 141 0 processExecutor.shutdownNow();
- 142
-
- 143 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Thread was interrupted during download execution" , ex);
- 144 0 throw new UpdateException("The execution of the download was interrupted" , ex);
- 145 0 }
- 146 0 if (task == null ) {
- 147 0 downloadExecutors.shutdownNow();
- 148 0 processExecutor.shutdownNow();
- 149 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Thread was interrupted during download" );
- 150 0 throw new UpdateException("The download was interrupted; unable to complete the update" );
- 151
- } else {
- 152 0 processFutures.add(task);
- 153
- }
- 154 0 }
- 155
-
- 156 0 for (Future<ProcessTask> future : processFutures) {
- 157
- try {
- 158 0 final ProcessTask task = future.get();
- 159 0 if (task.getException() != null ) {
- 160 0 throw task.getException();
- 161
- }
- 162 0 } catch (InterruptedException ex) {
- 163 0 processExecutor.shutdownNow();
- 164 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Thread was interrupted during processing" , ex);
- 165 0 throw new UpdateException(ex);
- 166 0 } catch (ExecutionException ex) {
- 167 0 processExecutor.shutdownNow();
- 168 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Execution Exception during process" , ex);
- 169 0 throw new UpdateException(ex);
- 170
- } finally {
- 171 0 processExecutor.shutdown();
- 172 0 }
- 173 0 }
- 174
-
- 175 0 if (maxUpdates >= 1) {
- 176 0 properties.save(updateable.get(MODIFIED));
- 177 0 cveDB.cleanupDatabase();
- 178
}
- 179
- } finally {
- 180 0 closeDataStores();
- 181 0 }
- 182 0 }
- 183
+ 114 0 if (maxUpdates > 0) {
+ 115 0 openDataStores();
+ 116
+ }
+ 117
- 184
-
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
-
- 191
-
- 192
-
- 193
-
- 194
- protected final UpdateableNvdCve updatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException {
- 195 0 UpdateableNvdCve updates = null ;
- 196
- try {
- 197 0 updates = retrieveCurrentTimestampsFromWeb();
- 198 0 } catch (InvalidDataException ex) {
- 199 0 final String msg = "Unable to retrieve valid timestamp from nvd cve downloads page" ;
- 200 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, msg, ex);
- 201 0 throw new DownloadFailedException(msg, ex);
- 202 0 } catch (InvalidSettingException ex) {
- 203 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Invalid setting found when retrieving timestamps" , ex);
- 204 0 throw new DownloadFailedException("Invalid settings" , ex);
- 205 0 }
- 206
+ 118 0 final int poolSize = (MAX_THREAD_POOL_SIZE < maxUpdates) ? MAX_THREAD_POOL_SIZE : maxUpdates;
+ 119
- 207 0 if (updates == null ) {
- 208 0 throw new DownloadFailedException("Unable to retrieve the timestamps of the currently published NVD CVE data" );
- 209
- }
- 210 0 if (!properties.isEmpty()) {
- 211
- try {
- 212 0 final long lastUpdated = Long.parseLong(properties.getProperty(DatabaseProperties.LAST_UPDATED, "0" ));
- 213 0 final Date now = new Date();
- 214 0 final int days = Settings.getInt(Settings.KEYS.CVE_MODIFIED_VALID_FOR_DAYS, 7);
- 215 0 if (lastUpdated == updates.getTimeStamp(MODIFIED)) {
- 216 0 updates.clear();
- 217 0 } else if (withinRange(lastUpdated, now.getTime(), days)) {
- 218 0 for (NvdCveInfo entry : updates) {
- 219 0 if (MODIFIED.equals(entry.getId())) {
- 220 0 entry.setNeedsUpdate(true );
- 221
- } else {
- 222 0 entry.setNeedsUpdate(false );
- 223
- }
- 224 0 }
- 225
- } else {
- 226 0 for (NvdCveInfo entry : updates) {
- 227 0 if (MODIFIED.equals(entry.getId())) {
- 228 0 entry.setNeedsUpdate(true );
- 229
- } else {
- 230 0 long currentTimestamp = 0;
- 231
- try {
- 232 0 currentTimestamp = Long.parseLong(properties.getProperty(DatabaseProperties.LAST_UPDATED_BASE + entry.getId(), "0" ));
- 233 0 } catch (NumberFormatException ex) {
- 234 0 final String msg = String.format("Error parsing '%s' '%s' from nvdcve.lastupdated" ,
- 235
- DatabaseProperties.LAST_UPDATED_BASE, entry.getId());
- 236 0 Logger
- 237
- .getLogger(StandardUpdate.class
- 238
- .getName()).log(Level.FINE, msg, ex);
- 239 0 }
- 240 0 if (currentTimestamp == entry.getTimestamp()) {
- 241 0 entry.setNeedsUpdate(false );
- 242
- }
- 243
- }
- 244 0 }
- 245
+ 120 0 final ExecutorService downloadExecutors = Executors.newFixedThreadPool(poolSize);
+ 121 0 final ExecutorService processExecutor = Executors.newSingleThreadExecutor();
+ 122 0 final Set<Future<Future<ProcessTask>>> downloadFutures = new HashSet<Future<Future<ProcessTask>>>(maxUpdates);
+ 123 0 for (NvdCveInfo cve : updateable) {
+ 124 0 if (cve.getNeedsUpdate()) {
+ 125 0 final CallableDownloadTask call = new CallableDownloadTask(cve, processExecutor, cveDB, Settings.getInstance());
+ 126 0 downloadFutures.add(downloadExecutors.submit(call));
+ 127
}
- 246 0 } catch (NumberFormatException ex) {
- 247 0 final String msg = "An invalid schema version or timestamp exists in the data.properties file." ;
- 248 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.WARNING, msg);
- 249 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "" , ex);
- 250 0 }
- 251
- }
- 252 0 return updates;
- 253
- }
- 254
+ 128 0 }
+ 129 0 downloadExecutors.shutdown();
+ 130
- 255
+ 131
+
+ 132 0 final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates);
+ 133 0 for (Future<Future<ProcessTask>> future : downloadFutures) {
+ 134 0 Future<ProcessTask> task = null ;
+ 135
+ try {
+ 136 0 task = future.get();
+ 137 0 } catch (InterruptedException ex) {
+ 138 0 downloadExecutors.shutdownNow();
+ 139 0 processExecutor.shutdownNow();
+ 140
+
+ 141 0 LOGGER.log(Level.FINE, "Thread was interrupted during download" , ex);
+ 142 0 throw new UpdateException("The download was interrupted" , ex);
+ 143 0 } catch (ExecutionException ex) {
+ 144 0 downloadExecutors.shutdownNow();
+ 145 0 processExecutor.shutdownNow();
+ 146
+
+ 147 0 LOGGER.log(Level.FINE, "Thread was interrupted during download execution" , ex);
+ 148 0 throw new UpdateException("The execution of the download was interrupted" , ex);
+ 149 0 }
+ 150 0 if (task == null ) {
+ 151 0 downloadExecutors.shutdownNow();
+ 152 0 processExecutor.shutdownNow();
+ 153 0 LOGGER.log(Level.FINE, "Thread was interrupted during download" );
+ 154 0 throw new UpdateException("The download was interrupted; unable to complete the update" );
+ 155
+ } else {
+ 156 0 processFutures.add(task);
+ 157
+ }
+ 158 0 }
+ 159
+
+ 160 0 for (Future<ProcessTask> future : processFutures) {
+ 161
+ try {
+ 162 0 final ProcessTask task = future.get();
+ 163 0 if (task.getException() != null ) {
+ 164 0 throw task.getException();
+ 165
+ }
+ 166 0 } catch (InterruptedException ex) {
+ 167 0 processExecutor.shutdownNow();
+ 168 0 LOGGER.log(Level.FINE, "Thread was interrupted during processing" , ex);
+ 169 0 throw new UpdateException(ex);
+ 170 0 } catch (ExecutionException ex) {
+ 171 0 processExecutor.shutdownNow();
+ 172 0 LOGGER.log(Level.FINE, "Execution Exception during process" , ex);
+ 173 0 throw new UpdateException(ex);
+ 174
+ } finally {
+ 175 0 processExecutor.shutdown();
+ 176 0 }
+ 177 0 }
+ 178
+
+ 179 0 if (maxUpdates >= 1) {
+ 180 0 properties.save(updateable.get(MODIFIED));
+ 181 0 cveDB.cleanupDatabase();
+ 182
+ }
+ 183
+ } finally {
+ 184 0 closeDataStores();
+ 185 0 }
+ 186 0 }
+ 187
+
+ 188
- 256
-
- 257
+ 189
+
+ 190
+
+ 191
+
+ 192
- 258
-
- 259
-
- 260
-
- 261
-
- 262
-
- 263
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
- 264
- private UpdateableNvdCve retrieveCurrentTimestampsFromWeb()
- 265
- throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException {
- 266
-
- 267 0 final UpdateableNvdCve updates = new UpdateableNvdCve();
- 268 0 updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL),
- 269
- Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL),
- 270
- false );
- 271
-
- 272 0 final int start = Settings.getInt(Settings.KEYS.CVE_START_YEAR);
- 273 0 final int end = Calendar.getInstance().get(Calendar.YEAR);
- 274 0 final String baseUrl20 = Settings.getString(Settings.KEYS.CVE_SCHEMA_2_0);
- 275 0 final String baseUrl12 = Settings.getString(Settings.KEYS.CVE_SCHEMA_1_2);
- 276 0 for (int i = start; i <= end; i++) {
- 277 0 updates.add(Integer.toString(i), String.format(baseUrl20, i),
- 278
- String.format(baseUrl12, i),
- 279
- true );
- 280
- }
- 281
-
- 282 0 return updates;
- 283
- }
- 284
-
- 285
-
- 286
-
- 287
-
- 288
- protected void closeDataStores() {
- 289 0 if (cveDB != null ) {
- 290
- try {
- 291 0 cveDB.close();
- 292 0 } catch (Throwable ignore) {
- 293 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINEST, "Error closing the cveDB" , ignore);
- 294 0 }
- 295
- }
- 296 0 }
- 297
-
- 298
-
- 299
-
- 300
-
- 301
-
- 302
-
- 303
- protected final void openDataStores() throws UpdateException {
- 304 0 if (cveDB != null ) {
- 305 0 return ;
- 306
- }
- 307
+ 198
+ protected final UpdateableNvdCve updatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException {
+ 199 0 UpdateableNvdCve updates = null ;
+ 200
try {
- 308 0 cveDB = new CveDB();
- 309 0 cveDB.open();
- 310 0 } catch (DatabaseException ex) {
- 311 0 closeDataStores();
- 312 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.FINE, "Database Exception opening databases" , ex);
- 313 0 throw new UpdateException("Error updating the CPE/CVE data, please see the log file for more details." );
- 314 0 }
- 315 0 }
- 316
+ 201 0 updates = retrieveCurrentTimestampsFromWeb();
+ 202 0 } catch (InvalidDataException ex) {
+ 203 0 final String msg = "Unable to retrieve valid timestamp from nvd cve downloads page" ;
+ 204 0 LOGGER.log(Level.FINE, msg, ex);
+ 205 0 throw new DownloadFailedException(msg, ex);
+ 206 0 } catch (InvalidSettingException ex) {
+ 207 0 LOGGER.log(Level.FINE, "Invalid setting found when retrieving timestamps" , ex);
+ 208 0 throw new DownloadFailedException("Invalid settings" , ex);
+ 209 0 }
+ 210
- 317
-
- 318
-
- 319
-
- 320
-
- 321
-
- 322
-
- 323
-
- 324
-
- 325
-
- 326
-
- 327
- protected boolean withinRange(long date, long compareTo, int range) {
- 328 0 final double differenceInDays = (compareTo - date) / 1000.0 / 60.0 / 60.0 / 24.0;
- 329 0 return differenceInDays < range;
- 330
+ 211 0 if (updates == null ) {
+ 212 0 throw new DownloadFailedException("Unable to retrieve the timestamps of the currently published NVD CVE data" );
+ 213
+ }
+ 214 0 if (!properties.isEmpty()) {
+ 215
+ try {
+ 216 0 final long lastUpdated = Long.parseLong(properties.getProperty(DatabaseProperties.LAST_UPDATED, "0" ));
+ 217 0 final Date now = new Date();
+ 218 0 final int days = Settings.getInt(Settings.KEYS.CVE_MODIFIED_VALID_FOR_DAYS, 7);
+ 219 0 if (lastUpdated == updates.getTimeStamp(MODIFIED)) {
+ 220 0 updates.clear();
+ 221 0 } else if (withinRange(lastUpdated, now.getTime(), days)) {
+ 222 0 for (NvdCveInfo entry : updates) {
+ 223 0 if (MODIFIED.equals(entry.getId())) {
+ 224 0 entry.setNeedsUpdate(true );
+ 225
+ } else {
+ 226 0 entry.setNeedsUpdate(false );
+ 227
+ }
+ 228 0 }
+ 229
+ } else {
+ 230 0 for (NvdCveInfo entry : updates) {
+ 231 0 if (MODIFIED.equals(entry.getId())) {
+ 232 0 entry.setNeedsUpdate(true );
+ 233
+ } else {
+ 234 0 long currentTimestamp = 0;
+ 235
+ try {
+ 236 0 currentTimestamp = Long.parseLong(properties.getProperty(DatabaseProperties.LAST_UPDATED_BASE + entry.getId(), "0" ));
+ 237 0 } catch (NumberFormatException ex) {
+ 238 0 final String msg = String.format("Error parsing '%s' '%s' from nvdcve.lastupdated" ,
+ 239
+ DatabaseProperties.LAST_UPDATED_BASE, entry.getId());
+ 240 0 LOGGER.log(Level.FINE, msg, ex);
+ 241 0 }
+ 242 0 if (currentTimestamp == entry.getTimestamp()) {
+ 243 0 entry.setNeedsUpdate(false );
+ 244
+ }
+ 245
+ }
+ 246 0 }
+ 247
+ }
+ 248 0 } catch (NumberFormatException ex) {
+ 249 0 final String msg = "An invalid schema version or timestamp exists in the data.properties file." ;
+ 250 0 LOGGER.log(Level.WARNING, msg);
+ 251 0 LOGGER.log(Level.FINE, "" , ex);
+ 252 0 }
+ 253
+ }
+ 254 0 return updates;
+ 255
}
- 331
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+ private UpdateableNvdCve retrieveCurrentTimestampsFromWeb()
+ 267
+ throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException {
+ 268
+
+ 269 0 final UpdateableNvdCve updates = new UpdateableNvdCve();
+ 270 0 updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL),
+ 271
+ Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL),
+ 272
+ false );
+ 273
+
+ 274 0 final int start = Settings.getInt(Settings.KEYS.CVE_START_YEAR);
+ 275 0 final int end = Calendar.getInstance().get(Calendar.YEAR);
+ 276 0 final String baseUrl20 = Settings.getString(Settings.KEYS.CVE_SCHEMA_2_0);
+ 277 0 final String baseUrl12 = Settings.getString(Settings.KEYS.CVE_SCHEMA_1_2);
+ 278 0 for (int i = start; i <= end; i++) {
+ 279 0 updates.add(Integer.toString(i), String.format(baseUrl20, i),
+ 280
+ String.format(baseUrl12, i),
+ 281
+ true );
+ 282
+ }
+ 283
+
+ 284 0 return updates;
+ 285
+ }
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+ protected void closeDataStores() {
+ 291 0 if (cveDB != null ) {
+ 292
+ try {
+ 293 0 cveDB.close();
+ 294 0 } catch (Throwable ignore) {
+ 295 0 LOGGER.log(Level.FINEST, "Error closing the cveDB" , ignore);
+ 296 0 }
+ 297
+ }
+ 298 0 }
+ 299
+
+ 300
+
+ 301
+
+ 302
+
+ 303
+
+ 304
+
+ 305
+ protected final void openDataStores() throws UpdateException {
+ 306 0 if (cveDB != null ) {
+ 307 0 return ;
+ 308
+ }
+ 309
+ try {
+ 310 0 cveDB = new CveDB();
+ 311 0 cveDB.open();
+ 312 0 } catch (DatabaseException ex) {
+ 313 0 closeDataStores();
+ 314 0 LOGGER.log(Level.FINE, "Database Exception opening databases" , ex);
+ 315 0 throw new UpdateException("Error updating the CPE/CVE data, please see the log file for more details." );
+ 316 0 }
+ 317 0 }
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
+ 328
+
+ 329
+ protected boolean withinRange(long date, long compareTo, int range) {
+ 330 0 final double differenceInDays = (compareTo - date) / 1000.0 / 60.0 / 60.0 / 24.0;
+ 331 0 return differenceInDays < range;
+ 332
+ }
+ 333
}
-
+
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 71916461d..b6518b7be 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
@@ -12,7 +12,7 @@
@@ -64,84 +64,63 @@
23
24
-
+
25
-
+
26
-
+
27
- public final class UpdateService {
+
28
-
+
29
-
+ public class UpdateService {
30
-
- 31
-
- 32
- private static UpdateService service;
- 33
-
- 34
-
- 35
-
- 36
- private final ServiceLoader<CachedWebDataSource> loader;
- 37
- 38
+ 31
+ 32
+
+ 33
+
+ 34
+ private final ServiceLoader<CachedWebDataSource> loader;
+ 35
+
+ 36
+
+ 37
+
+ 38
+
39
-
+
40
- 41 0 private UpdateService() {
- 42 0 loader = ServiceLoader.load(CachedWebDataSource.class );
+ 41 0 public UpdateService(ClassLoader classLoader) {
+ 42 0 loader = ServiceLoader.load(CachedWebDataSource.class , classLoader);
43 0 }
44
45
46
-
+
47
48
-
+
49
50
- public static synchronized UpdateService getInstance() {
- 51 0 if (service == null ) {
- 52 0 service = new UpdateService();
- 53
- }
- 54 0 return service;
- 55
- }
- 56
-
- 57
-
- 58
-
- 59
-
- 60
-
- 61
-
- 62
public Iterator<CachedWebDataSource> getDataSources() {
- 63 0 return loader.iterator();
- 64
+ 51 0 return loader.iterator();
+ 52
}
- 65
+ 53
}
-
+
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 39a101f22..80a06a36c 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
@@ -12,7 +12,7 @@
@@ -85,7 +85,7 @@
34
- 35 0 public class UpdateableNvdCve implements java.lang.Iterable<NvdCveInfo>, Iterator<NvdCveInfo> {
+ 35 12 public class UpdateableNvdCve implements java.lang.Iterable<NvdCveInfo>, Iterator<NvdCveInfo> {
36
37
@@ -94,7 +94,7 @@
39
- 40 0 private Map<String, NvdCveInfo> collection = new TreeMap<String, NvdCveInfo>();
+ 40 5 private Map<String, NvdCveInfo> collection = new TreeMap<String, NvdCveInfo>();
41
42
@@ -127,13 +127,13 @@
56
public boolean isUpdateNeeded() {
- 57 0 for (NvdCveInfo item : this ) {
- 58 0 if (item.getNeedsUpdate()) {
- 59 0 return true ;
+ 57 3 for (NvdCveInfo item : this ) {
+ 58 4 if (item.getNeedsUpdate()) {
+ 59 1 return true ;
60
}
- 61 0 }
- 62 0 return false ;
+ 61 3 }
+ 62 2 return false ;
63
}
64
@@ -160,8 +160,8 @@
75
public void add(String id, String url, String oldUrl) throws MalformedURLException, DownloadFailedException {
- 76 0 add(id, url, oldUrl, false );
- 77 0 }
+ 76 1 add(id, url, oldUrl, false );
+ 77 1 }
78
79
@@ -188,14 +188,14 @@
90
public void add(String id, String url, String oldUrl, boolean needsUpdate) throws MalformedURLException, DownloadFailedException {
- 91 0 final NvdCveInfo item = new NvdCveInfo();
- 92 0 item.setNeedsUpdate(needsUpdate);
- 93 0 item.setId(id);
- 94 0 item.setUrl(url);
- 95 0 item.setOldSchemaVersionUrl(oldUrl);
- 96 0 item.setTimestamp(Downloader.getLastModified(new URL(url)));
- 97 0 collection.put(id, item);
- 98 0 }
+ 91 9 final NvdCveInfo item = new NvdCveInfo();
+ 92 9 item.setNeedsUpdate(needsUpdate);
+ 93 9 item.setId(id);
+ 94 9 item.setUrl(url);
+ 95 9 item.setOldSchemaVersionUrl(oldUrl);
+ 96 9 item.setTimestamp(Downloader.getLastModified(new URL(url)));
+ 97 9 collection.put(id, item);
+ 98 9 }
99
100
@@ -206,8 +206,8 @@
103
public void clear() {
- 104 0 collection.clear();
- 105 0 }
+ 104 1 collection.clear();
+ 105 1 }
106
107
@@ -233,7 +233,7 @@
118
- 119 0 private Iterator<Entry<String, NvdCveInfo>> iterableContent = null ;
+ 119 5 private Iterator<Entry<String, NvdCveInfo>> iterableContent = null ;
120
121
@@ -256,8 +256,8 @@
@Override
130
public Iterator<NvdCveInfo> iterator() {
- 131 0 iterableContent = collection.entrySet().iterator();
- 132 0 return this ;
+ 131 4 iterableContent = collection.entrySet().iterator();
+ 132 4 return this ;
133
}
134
@@ -282,7 +282,7 @@
@Override
144
public boolean hasNext() {
- 145 0 return iterableContent.hasNext();
+ 145 10 return iterableContent.hasNext();
146
}
147
@@ -307,7 +307,7 @@
@Override
157
public NvdCveInfo next() {
- 158 0 return iterableContent.next().getValue();
+ 158 7 return iterableContent.next().getValue();
159
}
160
@@ -328,8 +328,8 @@
@Override
168
public void remove() {
- 169 0 iterableContent.remove();
- 170 0 }
+ 169 1 iterableContent.remove();
+ 170 1 }
171
172
@@ -346,7 +346,7 @@
178
NvdCveInfo get(String key) {
- 179 0 return collection.get(key);
+ 179 2 return collection.get(key);
180
}
181
@@ -362,6 +362,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 296bbccab..a18f3335b 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
@@ -119,6 +119,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 4198ff5ca..d406b7b07 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
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.CallableDownloadTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.CallableDownloadTask.html
index ef7d8a389..179465eab 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.CallableDownloadTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.CallableDownloadTask.html
@@ -12,7 +12,7 @@
@@ -76,340 +76,369 @@
29
import org.owasp.dependencycheck.data.update.NvdCveInfo;
30
- import org.owasp.dependencycheck.utils.DownloadFailedException;
+ import org.owasp.dependencycheck.data.update.exception.UpdateException;
31
- import org.owasp.dependencycheck.utils.Downloader;
+ import org.owasp.dependencycheck.utils.DownloadFailedException;
32
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.utils.Downloader;
33
-
+ import org.owasp.dependencycheck.utils.Settings;
34
-
+
35
-
+
36
-
+
37
-
+
38
+
+ 39
- 39 0 public class CallableDownloadTask implements Callable<Future<ProcessTask>> {
- 40
-
+ 40 0 public class CallableDownloadTask implements Callable<Future<ProcessTask>> {
41
-
+
42
-
+
43
-
+
44
-
- 45
-
+
+ 45 0 private static final Logger LOGGER = Logger.getLogger(CallableDownloadTask.class .getName());
46
-
+
47
-
- 48 0 public CallableDownloadTask(NvdCveInfo nvdCveInfo, ExecutorService processor, CveDB cveDB) {
- 49 0 this .nvdCveInfo = nvdCveInfo;
- 50 0 this .processorService = processor;
- 51 0 this .cveDB = cveDB;
- 52
-
- 53
- final File file1;
- 54
- final File file2;
- 55
-
- 56
- try {
- 57 0 file1 = File.createTempFile("cve" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
- 58 0 file2 = File.createTempFile("cve_1_2_" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
- 59 0 } catch (IOException ex) {
- 60 0 return ;
- 61 0 }
- 62 0 this .first = file1;
- 63 0 this .second = file2;
- 64
-
- 65 0 }
- 66
- 67
-
- 68
-
- 69
- private CveDB cveDB;
- 70
-
- 71
-
- 72
-
- 73
- private ExecutorService processorService;
- 74
-
- 75
-
- 76
-
- 77
- private NvdCveInfo nvdCveInfo;
- 78
-
- 79
-
- 80
-
- 81
+ 48
+
+ 49
- 82
-
- 83
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
- 84
- public NvdCveInfo getNvdCveInfo() {
- 85
- return nvdCveInfo;
- 86
- }
- 87
+ 57 0 public CallableDownloadTask(NvdCveInfo nvdCveInfo, ExecutorService processor, CveDB cveDB, Settings settings) throws UpdateException {
+ 58 0 this .nvdCveInfo = nvdCveInfo;
+ 59 0 this .processorService = processor;
+ 60 0 this .cveDB = cveDB;
+ 61 0 this .settings = settings;
+ 62
+ 63
+ final File file1;
+ 64
+ final File file2;
+ 65
+
+ 66
+ try {
+ 67 0 file1 = File.createTempFile("cve" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
+ 68 0 file2 = File.createTempFile("cve_1_2_" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
+ 69 0 } catch (IOException ex) {
+ 70 0 throw new UpdateException("Unable to create temporary files" , ex);
+ 71 0 }
+ 72 0 this .first = file1;
+ 73 0 this .second = file2;
+ 74
+
+ 75 0 }
+ 76
+
+ 77
+
+ 78
+
+ 79
+ private CveDB cveDB;
+ 80
+
+ 81
+
+ 82
+
+ 83
+ private ExecutorService processorService;
+ 84
+
+ 85
+
+ 86
+
+ 87
+ private NvdCveInfo nvdCveInfo;
88
89
-
+
90
-
+
91
-
+ private Settings settings;
92
-
+
93
- public void setNvdCveInfo(NvdCveInfo nvdCveInfo) {
+
94
- this .nvdCveInfo = nvdCveInfo;
+
95
- }
- 96
-
- 97
-
- 98
-
- 99
- private File first;
- 100
-
- 101
-
- 102
-
- 103
- 104
-
- 105
+ 96
+
+ 97
- 106
- public File getFirst() {
- 107
- return first;
- 108
+ 98
+ public NvdCveInfo getNvdCveInfo() {
+ 99
+ return nvdCveInfo;
+ 100
}
- 109
+ 101
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+ public void setNvdCveInfo(NvdCveInfo nvdCveInfo) {
+ 108
+ this .nvdCveInfo = nvdCveInfo;
+ 109
+ }
110
111
-
- 112
-
- 113
-
- 114
-
- 115
- public void setFirst(File first) {
- 116
- this .first = first;
- 117
- }
- 118
-
- 119
- 120
+ 112
- 121
- private File second;
- 122
+ 113
+ private File first;
+ 114
- 123
+ 115
- 124
-
- 125
+ 116
+
+ 117
- 126
-
- 127
+ 118
+
+ 119
- 128
- public File getSecond() {
- 129
- return second;
- 130
+ 120
+ public File getFirst() {
+ 121
+ return first;
+ 122
}
- 131
+ 123
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+ public void setFirst(File first) {
+ 130
+ this .first = first;
+ 131
+ }
132
133
-
+
134
-
+
135
-
+ private File second;
136
-
+
137
- public void setSecond(File second) {
+
138
- this .second = second;
+
139
- }
- 140
-
- 141
-
- 142
-
- 143 0 private Exception exception = null ;
- 144
-
- 145
-
- 146
-
- 147
- 148
-
- 149
+ 140
+
+ 141
- 150
- public Exception getException() {
- 151
- return exception;
- 152
+ 142
+ public File getSecond() {
+ 143
+ return second;
+ 144
}
- 153
+ 145
+ 146
+
+ 147
+
+ 148
+
+ 149
+
+ 150
+
+ 151
+ public void setSecond(File second) {
+ 152
+ this .second = second;
+ 153
+ }
154
155
-
+
156
-
- 157
-
+
+ 157 0 private Exception exception = null ;
158
-
+
159
- public boolean hasException() {
- 160 0 return exception != null ;
- 161
- }
- 162
-
- 163
- @Override
- 164
- public Future<ProcessTask> call() throws Exception {
- 165
- try {
- 166 0 final URL url1 = new URL(nvdCveInfo.getUrl());
- 167 0 final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl());
- 168 0 String msg = String.format("Download Started for NVD CVE - %s" , nvdCveInfo.getId());
- 169 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.INFO, msg);
- 170
- try {
- 171 0 Downloader.fetchFile(url1, first);
- 172 0 Downloader.fetchFile(url2, second);
- 173 0 } catch (DownloadFailedException ex) {
- 174 0 msg = String.format("Download Failed for NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
- 175 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.WARNING, msg);
- 176 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.FINE, null , ex);
- 177 0 return null ;
- 178 0 }
- 179
-
- 180 0 msg = String.format("Download Complete for NVD CVE - %s" , nvdCveInfo.getId());
- 181 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.INFO, msg);
- 182
-
- 183 0 final ProcessTask task = new ProcessTask(cveDB, this );
- 184 0 return this .processorService.submit(task);
- 185
-
- 186 0 } catch (Throwable ex) {
- 187 0 final String msg = String.format("An exception occurred downloading NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
- 188 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.WARNING, msg);
- 189 0 Logger.getLogger(CallableDownloadTask.class .getName()).log(Level.FINE, "Download Task Failed" , ex);
- 190
- }
- 191 0 return null ;
- 192
- }
- 193
-
- 194
- 195
-
- 196
+ 160
+
+ 161
+
+ 162
+
+ 163
+ 164
+ public Exception getException() {
+ 165
+ return exception;
+ 166
+ }
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+ public boolean hasException() {
+ 174 0 return exception != null ;
+ 175
+ }
+ 176
+
+ 177
+ @Override
+ 178
+ public Future<ProcessTask> call() throws Exception {
+ 179
+ try {
+ 180 0 Settings.setInstance(settings);
+ 181 0 final URL url1 = new URL(nvdCveInfo.getUrl());
+ 182 0 final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl());
+ 183 0 String msg = String.format("Download Started for NVD CVE - %s" , nvdCveInfo.getId());
+ 184 0 LOGGER.log(Level.INFO, msg);
+ 185
+ try {
+ 186 0 Downloader.fetchFile(url1, first);
+ 187 0 Downloader.fetchFile(url2, second);
+ 188 0 } catch (DownloadFailedException ex) {
+ 189 0 msg = String.format("Download Failed for NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
+ 190 0 LOGGER.log(Level.WARNING, msg);
+ 191 0 LOGGER.log(Level.FINE, null , ex);
+ 192 0 return null ;
+ 193 0 }
+ 194
+
+ 195 0 msg = String.format("Download Complete for NVD CVE - %s" , nvdCveInfo.getId());
+ 196 0 LOGGER.log(Level.INFO, msg);
197
- public void cleanup() {
- 198 0 boolean deleted = false ;
- 199
- try {
- 200 0 if (first != null && first.exists()) {
- 201 0 deleted = first.delete();
- 202
- }
- 203
+
+ 198 0 final ProcessTask task = new ProcessTask(cveDB, this , settings);
+ 199 0 return this .processorService.submit(task);
+ 200
+
+ 201 0 } catch (Throwable ex) {
+ 202 0 final String msg = String.format("An exception occurred downloading NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
+ 203 0 LOGGER.log(Level.WARNING, msg);
+ 204 0 LOGGER.log(Level.FINE, "Download Task Failed" , ex);
+ 205
} finally {
- 204 0 if (first != null && (first.exists() || !deleted)) {
- 205 0 first.deleteOnExit();
- 206
- }
- 207
- }
- 208
- try {
- 209 0 deleted = false ;
- 210 0 if (second != null && second.exists()) {
- 211 0 deleted = second.delete();
+ 206 0 Settings.cleanup();
+ 207 0 }
+ 208 0 return null ;
+ 209
+ }
+ 210
+
+ 211
+
212
- }
+
213
- } finally {
- 214 0 if (second != null && (second.exists() || !deleted)) {
- 215 0 second.deleteOnExit();
+
+ 214
+ public void cleanup() {
+ 215 0 boolean deleted = false ;
216
- }
- 217
- }
- 218 0 }
+ try {
+ 217 0 if (first != null && first.exists()) {
+ 218 0 deleted = first.delete();
219
+ }
+ 220
+ } finally {
+ 221 0 if (first != null && (first.exists() || !deleted)) {
+ 222 0 first.deleteOnExit();
+ 223
+ }
+ 224
+ }
+ 225
+ try {
+ 226 0 deleted = false ;
+ 227 0 if (second != null && second.exists()) {
+ 228 0 deleted = second.delete();
+ 229
+ }
+ 230
+ } finally {
+ 231 0 if (second != null && (second.exists() || !deleted)) {
+ 232 0 second.deleteOnExit();
+ 233
+ }
+ 234
+ }
+ 235 0 }
+ 236
}
-
+
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 4d8833bfc..9df851fe2 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
@@ -12,7 +12,7 @@
@@ -86,15 +86,15 @@
34
import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
35
- import org.owasp.dependencycheck.data.update.StandardUpdate;
- 36
import org.owasp.dependencycheck.data.update.exception.UpdateException;
- 37
+ 36
import org.owasp.dependencycheck.data.update.xml.NvdCve12Handler;
- 38
+ 37
import org.owasp.dependencycheck.data.update.xml.NvdCve20Handler;
- 39
+ 38
import org.owasp.dependencycheck.dependency.VulnerableSoftware;
+ 39
+ import org.owasp.dependencycheck.utils.Settings;
40
import org.xml.sax.SAXException;
41
@@ -115,210 +115,234 @@
49
50
-
+
51
- 52 0 private UpdateException exception = null ;
+ 52 0 private static final Logger LOGGER = Logger.getLogger(ProcessTask.class .getName());
53
-
+
54
-
+
55
-
- 56
-
+
+ 56 0 private UpdateException exception = null ;
57
-
- 58
-
- 59
- public UpdateException getException() {
- 60
- return exception;
- 61
- }
- 62
- 63
+ 58
- 64
-
- 65
+ 59
+
+ 60
- 66
-
- 67
+ 61
+
+ 62
- 68
- public void setException(UpdateException exception) {
- 69
- this .exception = exception;
- 70
+ 63
+ public UpdateException getException() {
+ 64
+ return exception;
+ 65
}
- 71
+ 66
+
+ 67
- 72
-
- 73
+ 68
+
+ 69
+
+ 70
+
+ 71
+ 72
+ public void setException(UpdateException exception) {
+ 73
+ this .exception = exception;
74
- private final CveDB cveDB;
+ }
75
76
-
+
77
78
- private final CallableDownloadTask filePair;
+ private final CveDB cveDB;
79
80
-
+
81
82
- private final DatabaseProperties properties;
+ private final CallableDownloadTask filePair;
83
-
- 84
+ 84
+
85
-
+
86
-
+ private final DatabaseProperties properties;
87
-
+
88
-
+
89
- 90 0 public ProcessTask(final CveDB cveDB, final CallableDownloadTask filePair) {
- 91 0 this .cveDB = cveDB;
- 92 0 this .filePair = filePair;
- 93 0 this .properties = cveDB.getDatabaseProperties();
- 94 0 }
+ 90
+ private Settings settings;
+ 91
+
+ 92
+
+ 93
+
+ 94
+
95
-
+
96
-
+
97
-
+
98
-
+
99
+
+ 100 0 public ProcessTask(final CveDB cveDB, final CallableDownloadTask filePair, Settings settings) {
+ 101 0 this .cveDB = cveDB;
+ 102 0 this .filePair = filePair;
+ 103 0 this .properties = cveDB.getDatabaseProperties();
+ 104 0 this .settings = settings;
+ 105 0 }
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
- 100
-
- 101
-
- 102
-
- 103
- @Override
- 104
- public ProcessTask call() throws Exception {
- 105
- try {
- 106 0 processFiles();
- 107 0 } catch (UpdateException ex) {
- 108 0 this .exception = ex;
- 109 0 }
- 110 0 return this ;
111
- }
+
112
-
+
113
-
+
114
-
+ @Override
115
-
+ public ProcessTask call() throws Exception {
116
-
- 117
-
- 118
-
- 119
-
- 120
-
- 121
-
- 122
-
- 123
-
- 124
-
- 125
- protected void importXML(File file, File oldVersion) throws ParserConfigurationException,
- 126
- SAXException, IOException, SQLException, DatabaseException, ClassNotFoundException {
- 127
-
- 128 0 final SAXParserFactory factory = SAXParserFactory.newInstance();
- 129 0 final SAXParser saxParser = factory.newSAXParser();
- 130
-
- 131 0 final NvdCve12Handler cve12Handler = new NvdCve12Handler();
- 132 0 saxParser.parse(oldVersion, cve12Handler);
- 133 0 final Map<String, List<VulnerableSoftware>> prevVersionVulnMap = cve12Handler.getVulnerabilities();
- 134
-
- 135 0 final NvdCve20Handler cve20Handler = new NvdCve20Handler();
- 136 0 cve20Handler.setCveDB(cveDB);
- 137 0 cve20Handler.setPrevVersionVulnMap(prevVersionVulnMap);
- 138 0 saxParser.parse(file, cve20Handler);
- 139 0 }
- 140
-
- 141
-
- 142
-
- 143
-
- 144
-
- 145
-
- 146
- private void processFiles() throws UpdateException {
- 147 0 String msg = String.format("Processing Started for NVD CVE - %s" , filePair.getNvdCveInfo().getId());
- 148 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.INFO, msg);
- 149
try {
- 150 0 importXML(filePair.getFirst(), filePair.getSecond());
- 151 0 cveDB.commit();
- 152 0 properties.save(filePair.getNvdCveInfo());
- 153 0 } catch (FileNotFoundException ex) {
- 154 0 throw new UpdateException(ex);
- 155 0 } catch (ParserConfigurationException ex) {
- 156 0 throw new UpdateException(ex);
- 157 0 } catch (SAXException ex) {
- 158 0 throw new UpdateException(ex);
- 159 0 } catch (IOException ex) {
- 160 0 throw new UpdateException(ex);
- 161 0 } catch (SQLException ex) {
- 162 0 throw new UpdateException(ex);
- 163 0 } catch (DatabaseException ex) {
- 164 0 throw new UpdateException(ex);
- 165 0 } catch (ClassNotFoundException ex) {
- 166 0 throw new UpdateException(ex);
- 167
+ 117 0 Settings.setInstance(settings);
+ 118 0 processFiles();
+ 119 0 } catch (UpdateException ex) {
+ 120 0 this .exception = ex;
+ 121
} finally {
- 168 0 filePair.cleanup();
- 169 0 }
- 170 0 msg = String.format("Processing Complete for NVD CVE - %s" , filePair.getNvdCveInfo().getId());
- 171 0 Logger.getLogger(StandardUpdate.class .getName()).log(Level.INFO, msg);
- 172 0 }
- 173
+ 122 0 Settings.cleanup();
+ 123 0 }
+ 124 0 return this ;
+ 125
+ }
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+ protected void importXML(File file, File oldVersion) throws ParserConfigurationException,
+ 140
+ SAXException, IOException, SQLException, DatabaseException, ClassNotFoundException {
+ 141
+
+ 142 0 final SAXParserFactory factory = SAXParserFactory.newInstance();
+ 143 0 final SAXParser saxParser = factory.newSAXParser();
+ 144
+
+ 145 0 final NvdCve12Handler cve12Handler = new NvdCve12Handler();
+ 146 0 saxParser.parse(oldVersion, cve12Handler);
+ 147 0 final Map<String, List<VulnerableSoftware>> prevVersionVulnMap = cve12Handler.getVulnerabilities();
+ 148
+
+ 149 0 final NvdCve20Handler cve20Handler = new NvdCve20Handler();
+ 150 0 cve20Handler.setCveDB(cveDB);
+ 151 0 cve20Handler.setPrevVersionVulnMap(prevVersionVulnMap);
+ 152 0 saxParser.parse(file, cve20Handler);
+ 153 0 }
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+ private void processFiles() throws UpdateException {
+ 161 0 String msg = String.format("Processing Started for NVD CVE - %s" , filePair.getNvdCveInfo().getId());
+ 162 0 LOGGER.log(Level.INFO, msg);
+ 163
+ try {
+ 164 0 importXML(filePair.getFirst(), filePair.getSecond());
+ 165 0 cveDB.commit();
+ 166 0 properties.save(filePair.getNvdCveInfo());
+ 167 0 } catch (FileNotFoundException ex) {
+ 168 0 throw new UpdateException(ex);
+ 169 0 } catch (ParserConfigurationException ex) {
+ 170 0 throw new UpdateException(ex);
+ 171 0 } catch (SAXException ex) {
+ 172 0 throw new UpdateException(ex);
+ 173 0 } catch (IOException ex) {
+ 174 0 throw new UpdateException(ex);
+ 175 0 } catch (SQLException ex) {
+ 176 0 throw new UpdateException(ex);
+ 177 0 } catch (DatabaseException ex) {
+ 178 0 throw new UpdateException(ex);
+ 179 0 } catch (ClassNotFoundException ex) {
+ 180 0 throw new UpdateException(ex);
+ 181
+ } finally {
+ 182 0 filePair.cleanup();
+ 183 0 }
+ 184 0 msg = String.format("Processing Complete for NVD CVE - %s" , filePair.getNvdCveInfo().getId());
+ 185 0 LOGGER.log(Level.INFO, msg);
+ 186 0 }
+ 187
}
-
+
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 7a8e96738..e1a8ed62c 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
@@ -12,8 +12,8 @@
@@ -90,7 +90,7 @@
36
- 37 0 public class NvdCve12Handler extends DefaultHandler {
+ 37 1 public class NvdCve12Handler extends DefaultHandler {
38
39
@@ -139,21 +139,21 @@
61
- 62 0 private boolean skip = false ;
+ 62 1 private boolean skip = false ;
63
64
65
- 66 0 private boolean hasPreviousVersion = false ;
+ 66 1 private boolean hasPreviousVersion = false ;
67
68
69
- 70 0 private final Element current = new Element();
+ 70 1 private final Element current = new Element();
71
72
@@ -186,33 +186,33 @@
@Override
86
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- 87 0 current.setNode(qName);
- 88 0 if (current.isEntryNode()) {
- 89 0 vendor = null ;
- 90 0 product = null ;
- 91 0 hasPreviousVersion = false ;
- 92 0 final String reject = attributes.getValue("reject" );
- 93 0 skip = "1" .equals(reject);
- 94 0 if (!skip) {
- 95 0 vulnerability = attributes.getValue("name" );
- 96 0 software = new ArrayList<VulnerableSoftware>();
+ 87 1222 current.setNode(qName);
+ 88 1222 if (current.isEntryNode()) {
+ 89 27 vendor = null ;
+ 90 27 product = null ;
+ 91 27 hasPreviousVersion = false ;
+ 92 27 final String reject = attributes.getValue("reject" );
+ 93 27 skip = "1" .equals(reject);
+ 94 27 if (!skip) {
+ 95 26 vulnerability = attributes.getValue("name" );
+ 96 26 software = new ArrayList<VulnerableSoftware>();
97
} else {
- 98 0 vulnerability = null ;
- 99 0 software = null ;
+ 98 1 vulnerability = null ;
+ 99 1 software = null ;
100
}
- 101 0 } else if (!skip && current.isProdNode()) {
+ 101 27 } else if (!skip && current.isProdNode()) {
102
- 103 0 vendor = attributes.getValue("vendor" );
- 104 0 product = attributes.getValue("name" );
- 105 0 } else if (!skip && current.isVersNode()) {
- 106 0 final String prev = attributes.getValue("prev" );
- 107 0 if (prev != null && "1" .equals(prev)) {
- 108 0 hasPreviousVersion = true ;
- 109 0 final String edition = attributes.getValue("edition" );
- 110 0 final String num = attributes.getValue("num" );
+ 103 52 vendor = attributes.getValue("vendor" );
+ 104 52 product = attributes.getValue("name" );
+ 105 1143 } else if (!skip && current.isVersNode()) {
+ 106 761 final String prev = attributes.getValue("prev" );
+ 107 761 if (prev != null && "1" .equals(prev)) {
+ 108 1 hasPreviousVersion = true ;
+ 109 1 final String edition = attributes.getValue("edition" );
+ 110 1 final String num = attributes.getValue("num" );
111
112
@@ -221,48 +221,48 @@
114
- 115 0 String cpe = "cpe:/a:" + vendor + ":" + product;
- 116 0 if (num != null ) {
- 117 0 cpe += ":" + num;
+ 115 1 String cpe = "cpe:/a:" + vendor + ":" + product;
+ 116 1 if (num != null ) {
+ 117 1 cpe += ":" + num;
118
}
- 119 0 if (edition != null ) {
+ 119 1 if (edition != null ) {
120 0 cpe += ":" + edition;
121
}
- 122 0 final VulnerableSoftware vs = new VulnerableSoftware();
- 123 0 vs.setCpe(cpe);
- 124 0 vs.setPreviousVersion(prev);
- 125 0 software.add(vs);
+ 122 1 final VulnerableSoftware vs = new VulnerableSoftware();
+ 123 1 vs.setCpe(cpe);
+ 124 1 vs.setPreviousVersion(prev);
+ 125 1 software.add(vs);
126
}
- 127 0 } else if (current.isNVDNode()) {
- 128 0 final String nvdVer = attributes.getValue("nvd_xml_version" );
- 129 0 if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) {
+ 127 761 } else if (current.isNVDNode()) {
+ 128 1 final String nvdVer = attributes.getValue("nvd_xml_version" );
+ 129 1 if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) {
130 0 throw new SAXNotSupportedException("Schema version " + nvdVer + " is not supported" );
131
}
- 132 0 vulnerabilities = new HashMap<String, List<VulnerableSoftware>>();
+ 132 1 vulnerabilities = new HashMap<String, List<VulnerableSoftware>>();
133
}
- 134 0 }
+ 134 1222 }
135
136
@Override
137
public void endElement(String uri, String localName, String qName) throws SAXException {
- 138 0 current.setNode(qName);
- 139 0 if (current.isEntryNode()) {
- 140 0 if (!skip && hasPreviousVersion) {
- 141 0 vulnerabilities.put(vulnerability, software);
+ 138 1222 current.setNode(qName);
+ 139 1222 if (current.isEntryNode()) {
+ 140 27 if (!skip && hasPreviousVersion) {
+ 141 1 vulnerabilities.put(vulnerability, software);
142
}
- 143 0 vulnerability = null ;
- 144 0 software = null ;
+ 143 27 vulnerability = null ;
+ 144 27 software = null ;
145
}
- 146 0 }
+ 146 1222 }
147
148
@@ -273,7 +273,7 @@
151
- 152 0 protected static class Element {
+ 152 1 protected static class Element {
153
154
@@ -374,7 +374,7 @@
202
public boolean isNVDNode() {
- 203 0 return NVD.equals(node);
+ 203 382 return NVD.equals(node);
204
}
205
@@ -391,7 +391,7 @@
211
public boolean isEntryNode() {
- 212 0 return ENTRY.equals(node);
+ 212 2444 return ENTRY.equals(node);
213
}
214
@@ -425,7 +425,7 @@
229
public boolean isProdNode() {
- 230 0 return PROD.equals(node);
+ 230 1192 return PROD.equals(node);
231
}
232
@@ -442,7 +442,7 @@
238
public boolean isVersNode() {
- 239 0 return VERS.equals(node);
+ 239 1140 return VERS.equals(node);
240
}
241
@@ -453,6 +453,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 12181df9c..2b3d8f030 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
@@ -12,8 +12,8 @@
@@ -98,358 +98,357 @@
40
- 41 0 public class NvdCve20Handler extends DefaultHandler {
+ 41 1 public class NvdCve20Handler extends DefaultHandler {
42
43
44
-
+
45
- 46
- private static final String CURRENT_SCHEMA_VERSION = "2.0" ;
+ 46 1 private static final Logger LOGGER = Logger.getLogger(NvdCve20Handler.class .getName());
47
48
-
+
49
- 50 0 private final Element current = new Element();
+ 50
+ private static final String CURRENT_SCHEMA_VERSION = "2.0" ;
51
52
-
+
53
- 54
- private StringBuilder nodeText;
+ 54 1 private final Element current = new Element();
55
56
-
+
57
58
- private Vulnerability vulnerability;
+ private StringBuilder nodeText;
59
60
-
+
61
62
- private Reference reference;
+ private Vulnerability vulnerability;
63
64
-
+
65
- 66 0 private boolean hasApplicationCpe = false ;
+ 66
+ private Reference reference;
67
68
-
+
69
- 70
- private int totalNumberOfEntries;
+ 70 1 private boolean hasApplicationCpe = false ;
71
-
+
72
-
+
73
-
+
74
-
+ private int totalNumberOfEntries;
75
-
+
76
-
+
77
- public int getTotalNumberOfEntries() {
+
78
- return totalNumberOfEntries;
+
79
- }
+
80
-
+
81
-
+ public int getTotalNumberOfEntries() {
82
-
+ return totalNumberOfEntries;
83
- private int totalNumberOfApplicationEntries;
+ }
84
-
+
85
-
+
86
-
+
87
-
+ private int totalNumberOfApplicationEntries;
88
-
+
89
-
+
90
- public int getTotalNumberOfApplicationEntries() {
+
91
- return totalNumberOfApplicationEntries;
+
92
- }
+
93
-
+
94
- @Override
+ public int getTotalNumberOfApplicationEntries() {
95
+ return totalNumberOfApplicationEntries;
+ 96
+ }
+ 97
+
+ 98
+ @Override
+ 99
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- 96 0 current.setNode(qName);
- 97 0 if (current.isEntryNode()) {
- 98 0 hasApplicationCpe = false ;
- 99 0 vulnerability = new Vulnerability();
- 100 0 vulnerability.setName(attributes.getValue("id" ));
- 101 0 } else if (current.isVulnProductNode()) {
- 102 0 nodeText = new StringBuilder(100);
- 103 0 } else if (current.isVulnReferencesNode()) {
- 104 0 final String lang = attributes.getValue("xml:lang" );
- 105 0 if ("en" .equals(lang)) {
- 106 0 reference = new Reference();
- 107
+ 100 2412 current.setNode(qName);
+ 101 2412 if (current.isEntryNode()) {
+ 102 27 hasApplicationCpe = false ;
+ 103 27 vulnerability = new Vulnerability();
+ 104 27 vulnerability.setName(attributes.getValue("id" ));
+ 105 2385 } else if (current.isVulnProductNode()) {
+ 106 727 nodeText = new StringBuilder(100);
+ 107 1658 } else if (current.isVulnReferencesNode()) {
+ 108 90 final String lang = attributes.getValue("xml:lang" );
+ 109 90 if ("en" .equals(lang)) {
+ 110 90 reference = new Reference();
+ 111
} else {
- 108 0 reference = null ;
- 109
+ 112 0 reference = null ;
+ 113
}
- 110 0 } else if (reference != null && current.isVulnReferenceNode()) {
- 111 0 reference.setUrl(attributes.getValue("href" ));
- 112 0 nodeText = new StringBuilder(130);
- 113 0 } else if (reference != null && current.isVulnSourceNode()) {
- 114 0 nodeText = new StringBuilder(30);
- 115 0 } else if (current.isVulnSummaryNode()) {
- 116 0 nodeText = new StringBuilder(500);
- 117 0 } else if (current.isNVDNode()) {
- 118 0 final String nvdVer = attributes.getValue("nvd_xml_version" );
- 119 0 if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) {
- 120 0 throw new SAXNotSupportedException("Schema version " + nvdVer + " is not supported" );
- 121
+ 114 90 } else if (reference != null && current.isVulnReferenceNode()) {
+ 115 90 reference.setUrl(attributes.getValue("href" ));
+ 116 90 nodeText = new StringBuilder(130);
+ 117 1478 } else if (reference != null && current.isVulnSourceNode()) {
+ 118 90 nodeText = new StringBuilder(30);
+ 119 1388 } else if (current.isVulnSummaryNode()) {
+ 120 27 nodeText = new StringBuilder(500);
+ 121 1361 } else if (current.isNVDNode()) {
+ 122 1 final String nvdVer = attributes.getValue("nvd_xml_version" );
+ 123 1 if (!CURRENT_SCHEMA_VERSION.equals(nvdVer)) {
+ 124 0 throw new SAXNotSupportedException("Schema version " + nvdVer + " is not supported" );
+ 125
}
- 122 0 } else if (current.isVulnCWENode()) {
- 123 0 vulnerability.setCwe(attributes.getValue("id" ));
- 124 0 } else if (current.isCVSSScoreNode()) {
- 125 0 nodeText = new StringBuilder(5);
- 126 0 } else if (current.isCVSSAccessVectorNode()) {
- 127 0 nodeText = new StringBuilder(20);
- 128 0 } else if (current.isCVSSAccessComplexityNode()) {
- 129 0 nodeText = new StringBuilder(20);
- 130 0 } else if (current.isCVSSAuthenticationNode()) {
- 131 0 nodeText = new StringBuilder(20);
- 132 0 } else if (current.isCVSSAvailabilityImpactNode()) {
- 133 0 nodeText = new StringBuilder(20);
- 134 0 } else if (current.isCVSSConfidentialityImpactNode()) {
- 135 0 nodeText = new StringBuilder(20);
- 136 0 } else if (current.isCVSSIntegrityImpactNode()) {
- 137 0 nodeText = new StringBuilder(20);
- 138
- }
- 139 0 }
- 140
-
- 141
- @Override
+ 126 1 } else if (current.isVulnCWENode()) {
+ 127 19 vulnerability.setCwe(attributes.getValue("id" ));
+ 128 1341 } else if (current.isCVSSScoreNode()) {
+ 129 26 nodeText = new StringBuilder(5);
+ 130 1315 } else if (current.isCVSSAccessVectorNode()) {
+ 131 26 nodeText = new StringBuilder(20);
+ 132 1289 } else if (current.isCVSSAccessComplexityNode()) {
+ 133 26 nodeText = new StringBuilder(20);
+ 134 1263 } else if (current.isCVSSAuthenticationNode()) {
+ 135 26 nodeText = new StringBuilder(20);
+ 136 1237 } else if (current.isCVSSAvailabilityImpactNode()) {
+ 137 26 nodeText = new StringBuilder(20);
+ 138 1211 } else if (current.isCVSSConfidentialityImpactNode()) {
+ 139 26 nodeText = new StringBuilder(20);
+ 140 1185 } else if (current.isCVSSIntegrityImpactNode()) {
+ 141 26 nodeText = new StringBuilder(20);
142
- public void characters(char [] ch, int start, int length) throws SAXException {
- 143 0 if (nodeText != null ) {
- 144 0 nodeText.append(ch, start, length);
+ }
+ 143 2412 }
+ 144
+
145
- }
- 146 0 }
- 147
-
- 148
@Override
+ 146
+ public void characters(char [] ch, int start, int length) throws SAXException {
+ 147 3987 if (nodeText != null ) {
+ 148 1142 nodeText.append(ch, start, length);
149
+ }
+ 150 3987 }
+ 151
+
+ 152
+ @Override
+ 153
public void endElement(String uri, String localName, String qName) throws SAXException {
- 150 0 current.setNode(qName);
- 151 0 if (current.isEntryNode()) {
- 152 0 totalNumberOfEntries += 1;
- 153 0 if (hasApplicationCpe) {
- 154 0 totalNumberOfApplicationEntries += 1;
- 155
+ 154 2412 current.setNode(qName);
+ 155 2412 if (current.isEntryNode()) {
+ 156 27 totalNumberOfEntries += 1;
+ 157 27 if (hasApplicationCpe) {
+ 158 19 totalNumberOfApplicationEntries += 1;
+ 159
try {
- 156 0 saveEntry(vulnerability);
- 157 0 } catch (DatabaseException ex) {
- 158 0 throw new SAXException(ex);
- 159 0 } catch (CorruptIndexException ex) {
- 160 0 throw new SAXException(ex);
- 161 0 } catch (IOException ex) {
+ 160 19 saveEntry(vulnerability);
+ 161 0 } catch (DatabaseException ex) {
162 0 throw new SAXException(ex);
- 163 0 }
- 164
+ 163 0 } catch (CorruptIndexException ex) {
+ 164 0 throw new SAXException(ex);
+ 165 0 } catch (IOException ex) {
+ 166 0 throw new SAXException(ex);
+ 167 19 }
+ 168
}
- 165 0 vulnerability = null ;
- 166 0 } else if (current.isCVSSScoreNode()) {
- 167
+ 169 27 vulnerability = null ;
+ 170 2385 } else if (current.isCVSSScoreNode()) {
+ 171
try {
- 168 0 final float score = Float.parseFloat(nodeText.toString());
- 169 0 vulnerability.setCvssScore(score);
- 170 0 } catch (NumberFormatException ex) {
- 171 0 Logger.getLogger(NvdCve20Handler.class .getName()).log(Level.SEVERE, "Error parsing CVSS Score." );
- 172 0 Logger.getLogger(NvdCve20Handler.class .getName()).log(Level.FINE, null , ex);
- 173 0 }
- 174 0 nodeText = null ;
- 175 0 } else if (current.isCVSSAccessVectorNode()) {
- 176 0 vulnerability.setCvssAccessVector(nodeText.toString());
- 177 0 nodeText = null ;
- 178 0 } else if (current.isCVSSAccessComplexityNode()) {
- 179 0 vulnerability.setCvssAccessComplexity(nodeText.toString());
- 180 0 nodeText = null ;
- 181 0 } else if (current.isCVSSAuthenticationNode()) {
- 182 0 vulnerability.setCvssAuthentication(nodeText.toString());
- 183 0 nodeText = null ;
- 184 0 } else if (current.isCVSSAvailabilityImpactNode()) {
- 185 0 vulnerability.setCvssAvailabilityImpact(nodeText.toString());
- 186 0 nodeText = null ;
- 187 0 } else if (current.isCVSSConfidentialityImpactNode()) {
- 188 0 vulnerability.setCvssConfidentialityImpact(nodeText.toString());
- 189 0 nodeText = null ;
- 190 0 } else if (current.isCVSSIntegrityImpactNode()) {
- 191 0 vulnerability.setCvssIntegrityImpact(nodeText.toString());
- 192 0 nodeText = null ;
- 193 0 } else if (current.isVulnProductNode()) {
- 194 0 final String cpe = nodeText.toString();
- 195 0 if (cpe.startsWith("cpe:/a:" )) {
- 196 0 hasApplicationCpe = true ;
- 197 0 vulnerability.addVulnerableSoftware(cpe);
- 198
+ 172 26 final float score = Float.parseFloat(nodeText.toString());
+ 173 26 vulnerability.setCvssScore(score);
+ 174 0 } catch (NumberFormatException ex) {
+ 175 0 LOGGER.log(Level.SEVERE, "Error parsing CVSS Score." );
+ 176 0 LOGGER.log(Level.FINE, null , ex);
+ 177 26 }
+ 178 26 nodeText = null ;
+ 179 2359 } else if (current.isCVSSAccessVectorNode()) {
+ 180 26 vulnerability.setCvssAccessVector(nodeText.toString());
+ 181 26 nodeText = null ;
+ 182 2333 } else if (current.isCVSSAccessComplexityNode()) {
+ 183 26 vulnerability.setCvssAccessComplexity(nodeText.toString());
+ 184 26 nodeText = null ;
+ 185 2307 } else if (current.isCVSSAuthenticationNode()) {
+ 186 26 vulnerability.setCvssAuthentication(nodeText.toString());
+ 187 26 nodeText = null ;
+ 188 2281 } else if (current.isCVSSAvailabilityImpactNode()) {
+ 189 26 vulnerability.setCvssAvailabilityImpact(nodeText.toString());
+ 190 26 nodeText = null ;
+ 191 2255 } else if (current.isCVSSConfidentialityImpactNode()) {
+ 192 26 vulnerability.setCvssConfidentialityImpact(nodeText.toString());
+ 193 26 nodeText = null ;
+ 194 2229 } else if (current.isCVSSIntegrityImpactNode()) {
+ 195 26 vulnerability.setCvssIntegrityImpact(nodeText.toString());
+ 196 26 nodeText = null ;
+ 197 2203 } else if (current.isVulnProductNode()) {
+ 198 727 final String cpe = nodeText.toString();
+ 199 727 if (cpe.startsWith("cpe:/a:" )) {
+ 200 614 hasApplicationCpe = true ;
+ 201 614 vulnerability.addVulnerableSoftware(cpe);
+ 202
}
- 199 0 nodeText = null ;
- 200 0 } else if (reference != null && current.isVulnReferencesNode()) {
- 201 0 vulnerability.addReference(reference);
- 202 0 reference = null ;
- 203 0 } else if (reference != null && current.isVulnReferenceNode()) {
- 204 0 reference.setName(nodeText.toString());
- 205 0 nodeText = null ;
- 206 0 } else if (reference != null && current.isVulnSourceNode()) {
- 207 0 reference.setSource(nodeText.toString());
- 208 0 nodeText = null ;
- 209 0 } else if (current.isVulnSummaryNode()) {
- 210 0 vulnerability.setDescription(nodeText.toString());
- 211 0 if (nodeText.indexOf("** REJECT **" ) >= 0) {
- 212 0 hasApplicationCpe = true ;
- 213
- }
- 214 0 nodeText = null ;
- 215
- }
- 216 0 }
+ 203 727 nodeText = null ;
+ 204 727 } else if (reference != null && current.isVulnReferencesNode()) {
+ 205 90 vulnerability.addReference(reference);
+ 206 90 reference = null ;
+ 207 1386 } else if (reference != null && current.isVulnReferenceNode()) {
+ 208 90 reference.setName(nodeText.toString());
+ 209 90 nodeText = null ;
+ 210 1296 } else if (reference != null && current.isVulnSourceNode()) {
+ 211 90 reference.setSource(nodeText.toString());
+ 212 90 nodeText = null ;
+ 213 1206 } else if (current.isVulnSummaryNode()) {
+ 214 27 vulnerability.setDescription(nodeText.toString());
+ 215 27 if (nodeText.indexOf("** REJECT **" ) >= 0) {
+ 216 1 hasApplicationCpe = true ;
217
-
- 218
-
+ }
+ 218 27 nodeText = null ;
219
-
- 220
- private CveDB cveDB;
+ }
+ 220 2412 }
221
-
+
222
-
+
223
-
+
224
-
+ private CveDB cveDB;
225
-
+
226
-
+
227
- public void setCveDB(CveDB db) {
+
228
- cveDB = db;
+
229
- }
+
230
-
+
231
-
+ public void setCveDB(CveDB db) {
232
-
+ cveDB = db;
233
- private Map<String, List<VulnerableSoftware>> prevVersionVulnMap;
- 234
-
- 235
-
- 236
-
- 237
-
- 238
-
- 239
-
- 240
- public void setPrevVersionVulnMap(Map<String, List<VulnerableSoftware>> map) {
- 241
- prevVersionVulnMap = map;
- 242
}
- 243
-
- 244
+ 234
- 245
-
- 246
+ 235
+
+ 236
+
+ 237
+ private Map<String, List<VulnerableSoftware>> prevVersionVulnMap;
+ 238
+
+ 239
+
+ 240
+
+ 241
+ 242
+
+ 243
+
+ 244
+ public void setPrevVersionVulnMap(Map<String, List<VulnerableSoftware>> map) {
+ 245
+ prevVersionVulnMap = map;
+ 246
+ }
247
-
+
248
-
- 249
-
- 250
-
- 251
-
- 252
- private void saveEntry(Vulnerability vuln) throws DatabaseException, CorruptIndexException, IOException {
- 253 0 if (cveDB == null ) {
- 254 0 return ;
- 255
- }
- 256 0 final String cveName = vuln.getName();
- 257 0 if (prevVersionVulnMap.containsKey(cveName)) {
- 258 0 final List<VulnerableSoftware> vulnSoftware = prevVersionVulnMap.get(cveName);
- 259 0 for (VulnerableSoftware vs : vulnSoftware) {
- 260 0 vuln.updateVulnerableSoftware(vs);
- 261 0 }
- 262
- }
- 263 0 cveDB.updateVulnerability(vuln);
- 264 0 }
- 265
-
- 266
-
- 267
- 268
-
- 269
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
- 270 0 protected static class Element {
- 271
+ 256
+ private void saveEntry(Vulnerability vuln) throws DatabaseException, CorruptIndexException, IOException {
+ 257 19 if (cveDB == null ) {
+ 258 19 return ;
+ 259
+ }
+ 260 0 final String cveName = vuln.getName();
+ 261 0 if (prevVersionVulnMap.containsKey(cveName)) {
+ 262 0 final List<VulnerableSoftware> vulnSoftware = prevVersionVulnMap.get(cveName);
+ 263 0 for (VulnerableSoftware vs : vulnSoftware) {
+ 264 0 vuln.updateVulnerableSoftware(vs);
+ 265 0 }
+ 266
+ }
+ 267 0 cveDB.updateVulnerability(vuln);
+ 268 0 }
+ 269
+ 270
+
+ 271
+
272
-
+
273
-
- 274
-
+
+ 274 1 protected static class Element {
275
- public static final String NVD = "nvd" ;
+
276
277
@@ -457,7 +456,7 @@
278
279
- public static final String ENTRY = "entry" ;
+ public static final String NVD = "nvd" ;
280
281
@@ -465,7 +464,7 @@
282
283
- public static final String VULN_PRODUCT = "vuln:product" ;
+ public static final String ENTRY = "entry" ;
284
285
@@ -473,7 +472,7 @@
286
287
- public static final String VULN_REFERENCES = "vuln:references" ;
+ public static final String VULN_PRODUCT = "vuln:product" ;
288
289
@@ -481,7 +480,7 @@
290
291
- public static final String VULN_SOURCE = "vuln:source" ;
+ public static final String VULN_REFERENCES = "vuln:references" ;
292
293
@@ -489,7 +488,7 @@
294
295
- public static final String VULN_REFERENCE = "vuln:reference" ;
+ public static final String VULN_SOURCE = "vuln:source" ;
296
297
@@ -497,7 +496,7 @@
298
299
- public static final String VULN_SUMMARY = "vuln:summary" ;
+ public static final String VULN_REFERENCE = "vuln:reference" ;
300
301
@@ -505,7 +504,7 @@
302
303
- public static final String VULN_CWE = "vuln:cwe" ;
+ public static final String VULN_SUMMARY = "vuln:summary" ;
304
305
@@ -513,7 +512,7 @@
306
307
- public static final String CVSS_SCORE = "cvss:score" ;
+ public static final String VULN_CWE = "vuln:cwe" ;
308
309
@@ -521,7 +520,7 @@
310
311
- public static final String CVSS_ACCESS_VECTOR = "cvss:access-vector" ;
+ public static final String CVSS_SCORE = "cvss:score" ;
312
313
@@ -529,7 +528,7 @@
314
315
- public static final String CVSS_ACCESS_COMPLEXITY = "cvss:access-complexity" ;
+ public static final String CVSS_ACCESS_VECTOR = "cvss:access-vector" ;
316
317
@@ -537,7 +536,7 @@
318
319
- public static final String CVSS_AUTHENTICATION = "cvss:authentication" ;
+ public static final String CVSS_ACCESS_COMPLEXITY = "cvss:access-complexity" ;
320
321
@@ -545,7 +544,7 @@
322
323
- public static final String CVSS_CONFIDENTIALITY_IMPACT = "cvss:confidentiality-impact" ;
+ public static final String CVSS_AUTHENTICATION = "cvss:authentication" ;
324
325
@@ -553,7 +552,7 @@
326
327
- public static final String CVSS_INTEGRITY_IMPACT = "cvss:integrity-impact" ;
+ public static final String CVSS_CONFIDENTIALITY_IMPACT = "cvss:confidentiality-impact" ;
328
329
@@ -561,314 +560,322 @@
330
331
- public static final String CVSS_AVAILABILITY_IMPACT = "cvss:availability-impact" ;
+ public static final String CVSS_INTEGRITY_IMPACT = "cvss:integrity-impact" ;
332
333
-
+
334
335
- private String node;
+ public static final String CVSS_AVAILABILITY_IMPACT = "cvss:availability-impact" ;
336
-
+
337
-
+
338
-
+
339
-
+ private String node;
340
-
+
341
-
+
342
- public String getNode() {
+
343
- return this .node;
+
344
- }
+
345
-
+
346
-
+ public String getNode() {
347
-
+ return this .node;
348
-
+ }
349
-
+
350
-
+
351
- public void setNode(String node) {
+
352
- this .node = node;
+
353
- }
+
354
-
+
355
-
+ public void setNode(String node) {
356
-
+ this .node = node;
357
-
+ }
358
-
+
359
-
+
360
- public boolean isNVDNode() {
- 361 0 return NVD.equals(node);
+
+ 361
+
362
- }
+
363
-
+
364
-
- 365
-
+ public boolean isNVDNode() {
+ 365 1361 return NVD.equals(node);
366
-
+ }
367
-
+
368
-
+
369
- public boolean isEntryNode() {
- 370 0 return ENTRY.equals(node);
+
+ 370
+
371
- }
+
372
-
+
373
-
- 374
-
+ public boolean isEntryNode() {
+ 374 4824 return ENTRY.equals(node);
375
-
+ }
376
-
+
377
-
+
378
- public boolean isVulnProductNode() {
- 379 0 return VULN_PRODUCT.equals(node);
+
+ 379
+
380
- }
+
381
-
+
382
-
- 383
-
+ public boolean isVulnProductNode() {
+ 383 4588 return VULN_PRODUCT.equals(node);
384
-
+ }
385
-
+
386
-
+
387
- public boolean isVulnReferencesNode() {
- 388 0 return VULN_REFERENCES.equals(node);
+
+ 388
+
389
- }
+
390
-
+
391
-
- 392
-
+ public boolean isVulnReferencesNode() {
+ 392 1928 return VULN_REFERENCES.equals(node);
393
-
+ }
394
-
+
395
-
+
396
- public boolean isVulnReferenceNode() {
- 397 0 return VULN_REFERENCE.equals(node);
+
+ 397
+
398
- }
+
399
-
+
400
-
- 401
-
+ public boolean isVulnReferenceNode() {
+ 401 360 return VULN_REFERENCE.equals(node);
402
-
+ }
403
-
+
404
-
+
405
- public boolean isVulnSourceNode() {
- 406 0 return VULN_SOURCE.equals(node);
+
+ 406
+
407
- }
+
408
-
+
409
-
- 410
-
+ public boolean isVulnSourceNode() {
+ 410 180 return VULN_SOURCE.equals(node);
411
-
+ }
412
-
+
413
-
+
414
- public boolean isVulnSummaryNode() {
- 415 0 return VULN_SUMMARY.equals(node);
+
+ 415
+
416
- }
+
417
-
+
418
-
- 419
-
+ public boolean isVulnSummaryNode() {
+ 419 2594 return VULN_SUMMARY.equals(node);
420
-
+ }
421
-
+
422
-
+
423
- public boolean isVulnCWENode() {
- 424 0 return VULN_CWE.equals(node);
+
+ 424
+
425
- }
+
426
-
+
427
-
- 428
-
+ public boolean isVulnCWENode() {
+ 428 1360 return VULN_CWE.equals(node);
429
-
+ }
430
-
+
431
-
+
432
- public boolean isCVSSScoreNode() {
- 433 0 return CVSS_SCORE.equals(node);
+
+ 433
+
434
- }
+
435
-
+
436
-
- 437
-
+ public boolean isCVSSScoreNode() {
+ 437 3726 return CVSS_SCORE.equals(node);
438
-
+ }
439
-
+
440
-
+
441
- public boolean isCVSSAccessVectorNode() {
- 442 0 return CVSS_ACCESS_VECTOR.equals(node);
+
+ 442
+
443
- }
+
444
-
+
445
-
- 446
-
+ public boolean isCVSSAccessVectorNode() {
+ 446 3674 return CVSS_ACCESS_VECTOR.equals(node);
447
-
+ }
448
-
+
449
-
+
450
- public boolean isCVSSAccessComplexityNode() {
- 451 0 return CVSS_ACCESS_COMPLEXITY.equals(node);
+
+ 451
+
452
- }
+
453
-
+
454
-
- 455
-
+ public boolean isCVSSAccessComplexityNode() {
+ 455 3622 return CVSS_ACCESS_COMPLEXITY.equals(node);
456
-
+ }
457
-
+
458
-
+
459
- public boolean isCVSSAuthenticationNode() {
- 460 0 return CVSS_AUTHENTICATION.equals(node);
+
+ 460
+
461
- }
+
462
-
+
463
-
- 464
-
+ public boolean isCVSSAuthenticationNode() {
+ 464 3570 return CVSS_AUTHENTICATION.equals(node);
465
-
+ }
466
-
+
467
-
+
468
- public boolean isCVSSConfidentialityImpactNode() {
- 469 0 return CVSS_CONFIDENTIALITY_IMPACT.equals(node);
+
+ 469
+
470
- }
+
471
-
+
472
-
- 473
-
+ public boolean isCVSSConfidentialityImpactNode() {
+ 473 3466 return CVSS_CONFIDENTIALITY_IMPACT.equals(node);
474
-
+ }
475
-
- 476
-
- 477
- public boolean isCVSSIntegrityImpactNode() {
- 478 0 return CVSS_INTEGRITY_IMPACT.equals(node);
- 479
- }
- 480
- 481
+ 476
- 482
-
- 483
+ 477
+
+ 478
- 484
+ 479
- 485
+ 480
- 486
- public boolean isCVSSAvailabilityImpactNode() {
- 487 0 return CVSS_AVAILABILITY_IMPACT.equals(node);
- 488
+ 481
+ public boolean isCVSSIntegrityImpactNode() {
+ 482 3414 return CVSS_INTEGRITY_IMPACT.equals(node);
+ 483
}
+ 484
+
+ 485
+
+ 486
+
+ 487
+
+ 488
+
489
- }
+
490
+ public boolean isCVSSAvailabilityImpactNode() {
+ 491 3518 return CVSS_AVAILABILITY_IMPACT.equals(node);
+ 492
+ }
+ 493
+ }
+ 494
- 491
+ 495
}
-
+
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 eb41b5de0..df9f0d509 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
@@ -12,7 +12,7 @@
@@ -65,7 +65,7 @@
24
- 25 0 public enum Confidence {
+ 25 5 public enum Confidence {
26
27
@@ -74,32 +74,32 @@
29
- 30 0 HIGHEST,
+ 30 1 HIGHEST,
31
32
33
- 34 0 HIGH,
+ 34 1 HIGH,
35
36
37
- 38 0 MEDIUM,
+ 38 1 MEDIUM,
39
40
41
- 42 0 LOW
+ 42 1 LOW
43
}
-
+
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 87694aa73..6261ec0c1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
@@ -12,7 +12,7 @@
@@ -91,976 +91,1107 @@
37
- 38 0 public class Dependency implements Comparable<Dependency> {
+ 38 2 public class Dependency implements Comparable<Dependency> {
39
40
41
-
+
42
- 43
- private String actualFilePath;
+ 43 1 private static final Logger LOGGER = Logger.getLogger(Dependency.class .getName());
44
45
-
+
46
47
- private String filePath;
+ private String actualFilePath;
48
49
-
+
50
51
- private String fileName;
+ private String filePath;
52
53
-
+
54
55
- private String fileExtension;
+ private String fileName;
56
57
-
+
58
59
- private String md5sum;
+ private String fileExtension;
60
61
-
+
62
63
- private String sha1sum;
+ private String md5sum;
64
65
-
+
66
67
- private Set<Identifier> identifiers;
+ private String sha1sum;
68
69
-
+
70
71
- private final EvidenceCollection vendorEvidence;
+ private Set<Identifier> identifiers;
72
73
-
+
74
75
- private final EvidenceCollection productEvidence;
+ private final EvidenceCollection vendorEvidence;
76
77
-
+
78
79
- private final EvidenceCollection versionEvidence;
+ private final EvidenceCollection productEvidence;
80
-
+
81
-
+
82
-
+
83
-
- 84 0 public Dependency() {
- 85 0 vendorEvidence = new EvidenceCollection();
- 86 0 productEvidence = new EvidenceCollection();
- 87 0 versionEvidence = new EvidenceCollection();
- 88 0 identifiers = new TreeSet<Identifier>();
- 89 0 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
- 90 0 }
- 91
+ private final EvidenceCollection versionEvidence;
+ 84
- 92
+ 85
- 93
+ 86
- 94
-
- 95
-
- 96
+ 87
+ 88 37 public Dependency() {
+ 89 37 vendorEvidence = new EvidenceCollection();
+ 90 37 productEvidence = new EvidenceCollection();
+ 91 37 versionEvidence = new EvidenceCollection();
+ 92 37 identifiers = new TreeSet<Identifier>();
+ 93 37 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
+ 94 37 suppressedIdentifiers = new TreeSet<Identifier>();
+ 95 37 suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
+ 96 37 }
97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
public Dependency(File file) {
- 98 0 this ();
- 99 0 this .actualFilePath = file.getPath();
- 100 0 this .filePath = this .actualFilePath;
- 101 0 this .fileName = file.getName();
- 102 0 this .fileExtension = FileUtils.getFileExtension(fileName);
- 103 0 determineHashes(file);
- 104 0 }
- 105
-
- 106
-
- 107
-
- 108
-
- 109
-
- 110
-
+ 104 16 this ();
+ 105 16 this .actualFilePath = file.getPath();
+ 106 16 this .filePath = this .actualFilePath;
+ 107 16 this .fileName = file.getName();
+ 108 16 this .fileExtension = FileUtils.getFileExtension(fileName);
+ 109 16 determineHashes(file);
+ 110 16 }
111
- public String getFileName() {
+
112
- return this .fileName;
+
113
- }
+
114
-
+
115
-
+
116
-
+
117
-
+ public String getFileName() {
118
-
+ return this .fileName;
119
-
+ }
120
-
+
121
- public String getFileNameForJavaScript() {
- 122 0 return this .fileName.replace("\\" , "\\\\" );
+
+ 122
+
123
- }
+
124
-
+
125
-
+
126
-
+
127
-
- 128
-
+ public String getFileNameForJavaScript() {
+ 128 0 return this .fileName.replace("\\" , "\\\\" );
129
-
+ }
130
- public void setFileName(String fileName) {
+
131
- this .fileName = fileName;
+
132
- }
- 133
-
- 134
-
- 135
-
- 136
-
- 137
-
- 138
-
- 139
- public void setActualFilePath(String actualFilePath) {
- 140 0 this .actualFilePath = actualFilePath;
- 141 0 if (this .sha1sum == null ) {
- 142 0 final File file = new File(this .actualFilePath);
- 143 0 determineHashes(file);
- 144
- }
- 145 0 }
- 146
-
- 147
-
- 148
-
- 149
-
- 150
-
- 151
-
- 152
- public String getActualFilePath() {
- 153
- return this .actualFilePath;
- 154
- }
- 155
-
- 156
-
- 157
-
- 158
-
- 159
-
- 160
-
- 161
- public File getActualFile() {
- 162 0 return new File(this .actualFilePath);
- 163
- }
- 164
-
- 165
-
- 166
-
- 167
-
- 168
-
- 169
-
- 170
- public void setFilePath(String filePath) {
- 171
- this .filePath = filePath;
- 172
- }
- 173
-
- 174
-
- 175
-
- 176
-
- 177
-
- 178
-
- 179
-
- 180
-
- 181
-
- 182
-
- 183
- public String getFilePath() {
- 184
- return this .filePath;
- 185
- }
- 186
-
- 187
-
- 188
+ 133
+
+ 134
+
+ 135
+
+ 136
+ public void setFileName(String fileName) {
+ 137
+ this .fileName = fileName;
+ 138
+ }
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+ public void setActualFilePath(String actualFilePath) {
+ 146 2 this .actualFilePath = actualFilePath;
+ 147 2 if (this .sha1sum == null ) {
+ 148 2 final File file = new File(this .actualFilePath);
+ 149 2 determineHashes(file);
+ 150
+ }
+ 151 2 }
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+ public String getActualFilePath() {
+ 159
+ return this .actualFilePath;
+ 160
+ }
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+ public File getActualFile() {
+ 168 2 return new File(this .actualFilePath);
+ 169
+ }
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+ public void setFilePath(String filePath) {
+ 177
+ this .filePath = filePath;
+ 178
+ }
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
189
-
+ public String getFilePath() {
190
-
+ return this .filePath;
191
-
+ }
192
- public void setFileExtension(String fileExtension) {
+
193
- this .fileExtension = fileExtension;
+
194
- }
+
195
-
+
196
-
+
197
-
+
198
-
+ public void setFileExtension(String fileExtension) {
199
-
+ this .fileExtension = fileExtension;
200
-
+ }
201
- public String getFileExtension() {
+
202
- return this .fileExtension;
+
203
- }
+
204
-
+
205
-
+
206
-
+
207
-
+ public String getFileExtension() {
208
-
+ return this .fileExtension;
209
-
+ }
210
- public String getMd5sum() {
+
211
- return this .md5sum;
+
212
- }
+
213
-
+
214
-
+
215
-
+
216
-
+ public String getMd5sum() {
217
-
+ return this .md5sum;
218
-
+ }
219
- public void setMd5sum(String md5sum) {
+
220
- this .md5sum = md5sum;
+
221
- }
+
222
-
+
223
-
+
224
-
+
225
-
+ public void setMd5sum(String md5sum) {
226
-
+ this .md5sum = md5sum;
227
-
+ }
228
- public String getSha1sum() {
+
229
- return this .sha1sum;
+
230
- }
+
231
-
+
232
-
+
233
-
+
234
-
+ public String getSha1sum() {
235
-
+ return this .sha1sum;
236
-
+ }
237
- public void setSha1sum(String sha1sum) {
+
238
- this .sha1sum = sha1sum;
+
239
- }
+
240
-
+
241
-
+
242
-
+
243
-
+ public void setSha1sum(String sha1sum) {
244
-
+ this .sha1sum = sha1sum;
245
-
+ }
246
- public Set<Identifier> getIdentifiers() {
+
247
- return this .identifiers;
+
248
- }
+
249
-
+
250
-
+
251
-
+
252
-
+ public Set<Identifier> getIdentifiers() {
253
-
+ return this .identifiers;
254
-
+ }
255
- public void setIdentifiers(Set<Identifier> identifiers) {
+
256
- this .identifiers = identifiers;
+
257
- }
+
258
-
+
259
-
+
260
-
+
261
-
+ public void setIdentifiers(Set<Identifier> identifiers) {
262
-
+ this .identifiers = identifiers;
263
-
+ }
264
-
+
265
-
+
266
- public void addIdentifier(String type, String value, String url) {
- 267 0 final Identifier i = new Identifier(type, value, url);
- 268 0 this .identifiers.add(i);
- 269 0 }
- 270
-
- 271
-
- 272
- 273
+ 267
- 274
+ 268
- 275
+ 269
- 276
+ 270
+ 271
+
+ 272
+ public void addIdentifier(String type, String value, String url) {
+ 273 6 final Identifier i = new Identifier(type, value, url);
+ 274 6 this .identifiers.add(i);
+ 275 6 }
+ 276
+
277
-
+
278
-
- 279
- public void addIdentifier(String type, String value, String url, Confidence confidence) {
- 280 0 final Identifier i = new Identifier(type, value, url);
- 281 0 i.setConfidence(confidence);
- 282 0 this .identifiers.add(i);
- 283 0 }
- 284
-
- 285
-
- 286
- 287
+ 279
- 288
-
- 289
+ 280
+
+ 281
+
+ 282
+
+ 283
+
+ 284
+ 285
+ public void addIdentifier(String type, String value, String url, Confidence confidence) {
+ 286 0 final Identifier i = new Identifier(type, value, url);
+ 287 0 i.setConfidence(confidence);
+ 288 0 this .identifiers.add(i);
+ 289 0 }
290
- public void addIdentifier(Identifier identifier) {
- 291 0 this .identifiers.add(identifier);
- 292 0 }
+
+ 291
+
+ 292
+
293
-
+
294
-
+
295
-
+
296
-
- 297
-
- 298
-
+ public void addIdentifier(Identifier identifier) {
+ 297 4 this .identifiers.add(identifier);
+ 298 4 }
299
- public EvidenceCollection getEvidence() {
- 300 0 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+
+ 300
+
301
- }
+
302
-
+ private Set<Identifier> suppressedIdentifiers;
303
-
+
304
-
+
305
-
+
306
-
+
307
-
+
308
- public EvidenceCollection getEvidenceUsed() {
- 309 0 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+
+ 309
+ public Set<Identifier> getSuppressedIdentifiers() {
310
- }
+ return suppressedIdentifiers;
311
-
+ }
312
-
+
313
-
+
314
-
+
315
-
+
316
-
+
317
- public EvidenceCollection getVendorEvidence() {
+
318
- return this .vendorEvidence;
+ public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) {
319
- }
+ this .suppressedIdentifiers = suppressedIdentifiers;
320
-
+ }
321
-
- 322
-
- 323
-
- 324
-
- 325
-
- 326
- public EvidenceCollection getProductEvidence() {
- 327
- return this .productEvidence;
- 328
- }
- 329
- 330
+ 322
- 331
-
- 332
+ 323
+
+ 324
- 333
-
- 334
+ 325
+
+ 326
- 335
- public EvidenceCollection getVersionEvidence() {
- 336
- return this .versionEvidence;
- 337
- }
- 338
+ 327
+ public void addSuppressedIdentifier(Identifier identifier) {
+ 328 4 this .suppressedIdentifiers.add(identifier);
+ 329 4 }
+ 330
+
+ 331
+ 332
+
+ 333
+
+ 334
+ private SortedSet<Vulnerability> suppressedVulnerabilities;
+ 335
+
+ 336
+
+ 337
+
+ 338
+
339
-
+
340
341
- private String description;
+ public SortedSet<Vulnerability> getSuppressedVulnerabilities() {
342
-
+ return suppressedVulnerabilities;
343
-
+ }
344
-
+
345
-
+
346
-
+
347
-
+
348
- public String getDescription() {
+
349
- return description;
+
350
- }
+ public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) {
351
-
+ this .suppressedVulnerabilities = suppressedVulnerabilities;
352
-
+ }
353
-
+
354
-
+
355
-
+
356
-
+
357
- public void setDescription(String description) {
+
358
- this .description = description;
+
359
- }
- 360
-
- 361
-
+ public void addSuppressedVulnerability(Vulnerability vulnerability) {
+ 360 3 this .suppressedVulnerabilities.add(vulnerability);
+ 361 3 }
362
-
+
363
- private String license;
+
364
-
+
365
-
+
366
-
+
367
-
+
368
-
- 369
-
+ public EvidenceCollection getEvidence() {
+ 369 3 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
370
- public String getLicense() {
+ }
371
- return license;
+
372
- }
+
373
-
+
374
-
+
375
-
+
376
-
+
377
-
- 378
-
+ public EvidenceCollection getEvidenceUsed() {
+ 378 1 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
379
- public void setLicense(String license) {
+ }
380
- this .license = license;
+
381
- }
+
382
-
+
383
-
+
384
-
+
385
- private SortedSet<Vulnerability> vulnerabilities;
+
386
-
+ public EvidenceCollection getVendorEvidence() {
387
-
+ return this .vendorEvidence;
388
-
+ }
389
-
+
390
-
+
391
-
+
392
- public SortedSet<Vulnerability> getVulnerabilities() {
+
393
- return vulnerabilities;
+
394
- }
- 395
-
- 396
-
- 397
-
- 398
-
- 399
-
- 400
- 401
- public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
- 402
- this .vulnerabilities = vulnerabilities;
- 403
+ 395
+ public EvidenceCollection getProductEvidence() {
+ 396
+ return this .productEvidence;
+ 397
}
- 404
+ 398
- 405
+ 399
- 406
-
- 407
+ 400
+
+ 401
+ 402
+
+ 403
+
+ 404
+ public EvidenceCollection getVersionEvidence() {
+ 405
+ return this .versionEvidence;
+ 406
+ }
+ 407
+
408
-
+
409
410
- private void determineHashes(File file) {
- 411 0 String md5 = null ;
- 412 0 String sha1 = null ;
- 413
- try {
- 414 0 md5 = Checksum.getMD5Checksum(file);
- 415 0 sha1 = Checksum.getSHA1Checksum(file);
- 416 0 } catch (IOException ex) {
- 417 0 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
- 418 0 Logger.getLogger(Dependency.class .getName()).log(Level.WARNING, msg);
- 419 0 Logger.getLogger(Dependency.class .getName()).log(Level.FINE, null , ex);
- 420 0 } catch (NoSuchAlgorithmException ex) {
- 421 0 final String msg = "Unable to use MD5 of SHA1 checksums." ;
- 422 0 Logger.getLogger(Dependency.class .getName()).log(Level.WARNING, msg);
- 423 0 Logger.getLogger(Dependency.class .getName()).log(Level.FINE, null , ex);
- 424 0 }
- 425 0 this .setMd5sum(md5);
- 426 0 this .setSha1sum(sha1);
- 427 0 }
- 428
+ private String description;
+ 411
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+ public String getDescription() {
+ 418
+ return description;
+ 419
+ }
+ 420
+
+ 421
+
+ 422
+
+ 423
+
+ 424
+
+ 425
+
+ 426
+ public void setDescription(String description) {
+ 427
+ this .description = description;
+ 428
+ }
429
430
-
+
431
-
+
432
-
+ private String license;
433
-
+
434
- public void addVulnerability(Vulnerability vulnerability) {
- 435 0 this .vulnerabilities.add(vulnerability);
- 436 0 }
- 437
- 438
-
- 439
-
- 440 0 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
- 441
-
- 442
-
- 443
-
- 444
+ 435
+
+ 436
- 445
-
- 446
+ 437
+
+ 438
- 447
- public Set<Dependency> getRelatedDependencies() {
- 448
- return relatedDependencies;
- 449
+ 439
+ public String getLicense() {
+ 440
+ return license;
+ 441
}
- 450
+ 442
+ 443
+
+ 444
+
+ 445
+
+ 446
+
+ 447
+
+ 448
+ public void setLicense(String license) {
+ 449
+ this .license = license;
+ 450
+ }
451
452
-
+
453
-
+
454
-
+ private SortedSet<Vulnerability> vulnerabilities;
455
-
+
456
- public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
+
457
- this .relatedDependencies = relatedDependencies;
+
458
- }
+
459
-
+
460
-
+
461
-
+ public SortedSet<Vulnerability> getVulnerabilities() {
462
-
+ return vulnerabilities;
463
-
+ }
464
-
+
465
- public void addRelatedDependency(Dependency dependency) {
- 466 0 relatedDependencies.add(dependency);
- 467 0 }
+
+ 466
+
+ 467
+
468
-
+
469
-
+
470
-
+ public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
471
-
+ this .vulnerabilities = vulnerabilities;
472
-
+ }
473
-
+
474
-
+
475
- public int compareTo(Dependency o) {
- 476 0 return this .getFileName().compareToIgnoreCase(o.getFileName());
+
+ 476
+
477
- }
+
478
-
+
479
-
- 480
-
- 481
-
+ private void determineHashes(File file) {
+ 480 18 String md5 = null ;
+ 481 18 String sha1 = null ;
482
-
- 483
-
- 484
-
- 485
- @Override
- 486
- public boolean equals(Object obj) {
- 487 0 if (obj == null ) {
- 488 0 return false ;
- 489
- }
- 490 0 if (getClass() != obj.getClass()) {
- 491 0 return false ;
- 492
- }
- 493 0 final Dependency other = (Dependency) obj;
- 494 0 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
- 495 0 return false ;
- 496
- }
- 497 0 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
- 498 0 return false ;
+ try {
+ 483 18 md5 = Checksum.getMD5Checksum(file);
+ 484 15 sha1 = Checksum.getSHA1Checksum(file);
+ 485 3 } catch (IOException ex) {
+ 486 3 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
+ 487 3 LOGGER.log(Level.WARNING, msg);
+ 488 3 LOGGER.log(Level.FINE, null , ex);
+ 489 0 } catch (NoSuchAlgorithmException ex) {
+ 490 0 final String msg = "Unable to use MD5 of SHA1 checksums." ;
+ 491 0 LOGGER.log(Level.WARNING, msg);
+ 492 0 LOGGER.log(Level.FINE, null , ex);
+ 493 18 }
+ 494 18 this .setMd5sum(md5);
+ 495 18 this .setSha1sum(sha1);
+ 496 18 }
+ 497
+
+ 498
+
499
- }
- 500 0 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
- 501 0 return false ;
+
+ 500
+
+ 501
+
502
- }
- 503 0 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
- 504 0 return false ;
- 505
- }
- 506 0 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
- 507 0 return false ;
+
+ 503
+ public void addVulnerability(Vulnerability vulnerability) {
+ 504 3 this .vulnerabilities.add(vulnerability);
+ 505 3 }
+ 506
+
+ 507
+
508
- }
- 509 0 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
- 510 0 return false ;
+
+ 509 37 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
+ 510
+
511
- }
- 512 0 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
- 513 0 return false ;
+
+ 512
+
+ 513
+
514
- }
- 515 0 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
- 516 0 return false ;
+
+ 515
+
+ 516
+ public Set<Dependency> getRelatedDependencies() {
517
- }
- 518 0 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
- 519 0 return false ;
+ return relatedDependencies;
+ 518
+ }
+ 519
+
520
- }
- 521 0 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
- 522 0 return false ;
+
+ 521
+
+ 522
+
523
- }
- 524 0 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
- 525 0 return false ;
+
+ 524
+
+ 525
+ public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
526
- }
- 527 0 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
- 528 0 return false ;
+ this .relatedDependencies = relatedDependencies;
+ 527
+ }
+ 528
+
529
- }
- 530 0 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
- 531 0 return false ;
+
+ 530
+
+ 531
+
532
- }
- 533 0 if (this .relatedDependencies != other.relatedDependencies
+
+ 533
+
534
- && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
- 535 0 return false ;
- 536
- }
- 537 0 return true ;
+ public void addRelatedDependency(Dependency dependency) {
+ 535 0 relatedDependencies.add(dependency);
+ 536 0 }
+ 537
+
538
- }
+
539
-
+
540
-
+
541
-
+
542
-
+
543
-
+
544
-
- 545
- @Override
+ public int compareTo(Dependency o) {
+ 545 2 return this .getFileName().compareToIgnoreCase(o.getFileName());
546
- public int hashCode() {
- 547 0 int hash = 3;
- 548 0 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
- 549 0 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
- 550 0 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
- 551 0 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
- 552 0 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
- 553 0 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
- 554 0 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
- 555 0 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
- 556 0 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
- 557 0 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
- 558 0 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
- 559 0 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
- 560 0 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
- 561 0 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
- 562 0 return hash;
- 563
}
- 564
+ 547
- 565
+ 548
- 566
-
- 567
+ 549
+
+ 550
- 568
-
- 569
+ 551
+
+ 552
+
+ 553
- 570
+ 554
@Override
+ 555
+ public boolean equals(Object obj) {
+ 556 0 if (obj == null ) {
+ 557 0 return false ;
+ 558
+ }
+ 559 0 if (getClass() != obj.getClass()) {
+ 560 0 return false ;
+ 561
+ }
+ 562 0 final Dependency other = (Dependency) obj;
+ 563 0 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
+ 564 0 return false ;
+ 565
+ }
+ 566 0 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
+ 567 0 return false ;
+ 568
+ }
+ 569 0 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
+ 570 0 return false ;
571
- public String toString() {
- 572 0 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
- 573
- }
+ }
+ 572 0 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
+ 573 0 return false ;
574
+ }
+ 575 0 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
+ 576 0 return false ;
+ 577
+ }
+ 578 0 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
+ 579 0 return false ;
+ 580
+ }
+ 581 0 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
+ 582 0 return false ;
+ 583
+ }
+ 584 0 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
+ 585 0 return false ;
+ 586
+ }
+ 587 0 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
+ 588 0 return false ;
+ 589
+ }
+ 590 0 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
+ 591 0 return false ;
+ 592
+ }
+ 593 0 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
+ 594 0 return false ;
+ 595
+ }
+ 596 0 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
+ 597 0 return false ;
+ 598
+ }
+ 599 0 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
+ 600 0 return false ;
+ 601
+ }
+ 602 0 if (this .relatedDependencies != other.relatedDependencies
+ 603
+ && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
+ 604 0 return false ;
+ 605
+ }
+ 606 0 return true ;
+ 607
+ }
+ 608
+
+ 609
+
+ 610
+
+ 611
+
+ 612
+
+ 613
+
+ 614
+ @Override
+ 615
+ public int hashCode() {
+ 616 26 int hash = 3;
+ 617 26 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
+ 618 26 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
+ 619 26 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
+ 620 26 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
+ 621 26 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
+ 622 26 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
+ 623 26 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
+ 624 26 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
+ 625 26 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
+ 626 26 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
+ 627 26 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
+ 628 26 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
+ 629 26 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
+ 630 26 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
+ 631 26 return hash;
+ 632
+ }
+ 633
+
+ 634
+
+ 635
+
+ 636
+
+ 637
+
+ 638
+
+ 639
+ @Override
+ 640
+ public String toString() {
+ 641 0 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
+ 642
+ }
+ 643
}
-
+
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 1fb19bc33..e46677a8e 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 @@
@@ -65,7 +65,7 @@
24
- 25 0 public class Evidence implements Comparable<Evidence> {
+ 25 35743 public class Evidence implements Comparable<Evidence> {
26
27
@@ -218,8 +218,8 @@
101
public String getValue() {
- 102 0 used = true ;
- 103 0 return value;
+ 102 863 used = true ;
+ 103 863 return value;
104
}
105
@@ -238,8 +238,8 @@
112
public String getValue(Boolean setUsed) {
- 113 0 used = used || setUsed;
- 114 0 return value;
+ 113 50 used = used || setUsed;
+ 114 50 return value;
115
}
116
@@ -364,12 +364,12 @@
@Override
176
public int hashCode() {
- 177 0 int hash = 3;
- 178 0 hash = 67 * hash + (this .name != null ? this .name.hashCode() : 0);
- 179 0 hash = 67 * hash + (this .source != null ? this .source.hashCode() : 0);
- 180 0 hash = 67 * hash + (this .value != null ? this .value.hashCode() : 0);
- 181 0 hash = 67 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
- 182 0 return hash;
+ 177 2 int hash = 3;
+ 178 2 hash = 67 * hash + (this .name != null ? this .name.hashCode() : 0);
+ 179 2 hash = 67 * hash + (this .source != null ? this .source.hashCode() : 0);
+ 180 2 hash = 67 * hash + (this .value != null ? this .value.hashCode() : 0);
+ 181 2 hash = 67 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
+ 182 2 return hash;
183
}
184
@@ -443,29 +443,29 @@
222
public int compareTo(Evidence o) {
- 223 0 if (source.equals(o.source)) {
- 224 0 if (name.equals(o.name)) {
- 225 0 if (value.equals(o.value)) {
- 226 0 if (confidence.equals(o.confidence)) {
- 227 0 return 0;
+ 223 35743 if (source.equals(o.source)) {
+ 224 22863 if (name.equals(o.name)) {
+ 225 22756 if (value.equals(o.value)) {
+ 226 13850 if (confidence.equals(o.confidence)) {
+ 227 13848 return 0;
228
} else {
- 229 0 return confidence.compareTo(o.confidence);
+ 229 2 return confidence.compareTo(o.confidence);
230
}
231
} else {
- 232 0 return value.compareToIgnoreCase(o.value);
+ 232 8906 return value.compareToIgnoreCase(o.value);
233
}
234
} else {
- 235 0 return name.compareToIgnoreCase(o.name);
+ 235 107 return name.compareToIgnoreCase(o.name);
236
}
237
} else {
- 238 0 return source.compareToIgnoreCase(o.source);
+ 238 12880 return source.compareToIgnoreCase(o.source);
239
}
240
@@ -474,6 +474,6 @@
}
-
+
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 83159456f..c341d6a8f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
@@ -12,12 +12,12 @@
@@ -105,570 +105,577 @@
41
42
-
+
43
- 44 0 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
+ 44 1 private static final Logger LOGGER = Logger.getLogger(EvidenceCollection.class .getName());
45
- public boolean passes(Evidence evidence) {
- 46 0 return evidence.getConfidence() == Confidence.HIGHEST;
+
+ 46
+
47
- }
- 48
- };
+
+ 48 73 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
49
-
- 50
-
+ public boolean passes(Evidence evidence) {
+ 50 73 return evidence.getConfidence() == Confidence.HIGHEST;
51
-
- 52 0 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
+ }
+ 52
+ };
53
- public boolean passes(Evidence evidence) {
- 54 0 return evidence.getConfidence() == Confidence.HIGH;
+
+ 54
+
55
- }
- 56
- };
+
+ 56 63 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
57
-
- 58
-
+ public boolean passes(Evidence evidence) {
+ 58 63 return evidence.getConfidence() == Confidence.HIGH;
59
-
- 60 0 private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
+ }
+ 60
+ };
61
- public boolean passes(Evidence evidence) {
- 62 0 return evidence.getConfidence() == Confidence.MEDIUM;
+
+ 62
+
63
- }
- 64
- };
+
+ 64 1 private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
65
-
- 66
-
+ public boolean passes(Evidence evidence) {
+ 66 73 return evidence.getConfidence() == Confidence.MEDIUM;
67
-
- 68 0 private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
+ }
+ 68
+ };
69
- public boolean passes(Evidence evidence) {
- 70 0 return evidence.getConfidence() == Confidence.LOW;
+
+ 70
+
71
- }
- 72
- };
+
+ 72 1 private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
73
-
- 74
-
- 75
-
- 76 0 private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
- 77
public boolean passes(Evidence evidence) {
- 78 0 return evidence.isUsed();
- 79
+ 74 122 return evidence.getConfidence() == Confidence.LOW;
+ 75
}
- 80
+ 76
};
+ 77
+
+ 78
+
+ 79
+
+ 80 1 private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
81
-
- 82
-
+ public boolean passes(Evidence evidence) {
+ 82 995 return evidence.isUsed();
83
-
- 84
-
- 85
-
- 86
-
- 87
-
- 88
- public final Iterable<Evidence> iterator(Confidence confidence) {
- 89 0 if (confidence == Confidence.HIGHEST) {
- 90 0 return EvidenceCollection.HIGHEST_CONFIDENCE.filter(this .list);
- 91 0 } else if (confidence == Confidence.HIGH) {
- 92 0 return EvidenceCollection.HIGH_CONFIDENCE.filter(this .list);
- 93 0 } else if (confidence == Confidence.MEDIUM) {
- 94 0 return EvidenceCollection.MEDIUM_CONFIDENCE.filter(this .list);
- 95
- } else {
- 96 0 return EvidenceCollection.LOW_CONFIDENCE.filter(this .list);
- 97
}
- 98
- }
- 99
+ 84
+ };
+ 85
+
+ 86
- 100
-
- 101
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+ 92
+ public final Iterable<Evidence> iterator(Confidence confidence) {
+ 93 44 if (confidence == Confidence.HIGHEST) {
+ 94 10 return EvidenceCollection.HIGHEST_CONFIDENCE.filter(this .list);
+ 95 34 } else if (confidence == Confidence.HIGH) {
+ 96 10 return EvidenceCollection.HIGH_CONFIDENCE.filter(this .list);
+ 97 24 } else if (confidence == Confidence.MEDIUM) {
+ 98 10 return EvidenceCollection.MEDIUM_CONFIDENCE.filter(this .list);
+ 99
+ } else {
+ 100 14 return EvidenceCollection.LOW_CONFIDENCE.filter(this .list);
+ 101
+ }
102
- private final Set<Evidence> list;
+ }
103
104
-
+
105
106
- private final Set<String> weightedStrings;
+ private final Set<Evidence> list;
107
-
+
108
-
+
109
-
+
110
-
- 111 0 public EvidenceCollection() {
- 112 0 list = new TreeSet<Evidence>();
- 113 0 weightedStrings = new HashSet<String>();
- 114 0 }
- 115
+ private final Set<String> weightedStrings;
+ 111
- 116
+ 112
- 117
-
- 118
-
+ 113
+
+ 114
+
+ 115 115 public EvidenceCollection() {
+ 116 115 list = new TreeSet<Evidence>();
+ 117 115 weightedStrings = new HashSet<String>();
+ 118 115 }
119
-
+
120
-
+
121
- public void addEvidence(Evidence e) {
- 122 0 list.add(e);
- 123 0 }
+
+ 122
+
+ 123
+
124
-
+
125
-
- 126
-
- 127
-
+ public void addEvidence(Evidence e) {
+ 126 13904 list.add(e);
+ 127 13904 }
128
-
+
129
-
+
130
-
+
131
-
+
132
-
+
133
- public void addEvidence(String source, String name, String value, Confidence confidence) {
- 134 0 final Evidence e = new Evidence(source, name, value, confidence);
- 135 0 addEvidence(e);
- 136 0 }
+
+ 134
+
+ 135
+
+ 136
+
137
-
- 138
-
- 139
-
- 140
-
+ public void addEvidence(String source, String name, String value, Confidence confidence) {
+ 138 13897 final Evidence e = new Evidence(source, name, value, confidence);
+ 139 13897 addEvidence(e);
+ 140 13897 }
141
-
+
142
-
+
143
-
+
144
-
+
145
-
+
146
-
+
147
-
+
148
-
+
149
- public void addWeighting(String str) {
- 150 0 weightedStrings.add(str);
- 151 0 }
+
+ 150
+
+ 151
+
152
-
+
153
-
- 154
-
- 155
-
+ public void addWeighting(String str) {
+ 154 15 weightedStrings.add(str);
+ 155 15 }
156
-
+
157
-
+
158
-
+
159
- public Set<String> getWeighting() {
+
160
- return weightedStrings;
+
161
- }
+
162
-
+
163
-
+ public Set<String> getWeighting() {
164
-
+ return weightedStrings;
165
-
+ }
166
-
+
167
-
+
168
- public Set<Evidence> getEvidence() {
+
169
- return list;
+
170
- }
+
171
-
+
172
-
+ public Set<Evidence> getEvidence() {
173
-
+ return list;
174
-
+ }
175
-
+
176
-
+
177
-
+
178
- public Set<Evidence> getEvidence(String source) {
- 179 0 if (source == null ) {
- 180 0 return null ;
- 181
- }
- 182 0 final Set<Evidence> ret = new HashSet<Evidence>();
- 183 0 for (Evidence e : list) {
- 184 0 if (source.equals(e.getSource())) {
- 185 0 ret.add(e);
- 186
- }
- 187 0 }
- 188 0 return ret;
- 189
- }
- 190
-
- 191
-
- 192
-
- 193
- 194
+ 179
- 195
-
- 196
+ 180
+ 181
+
+ 182
+ public Set<Evidence> getEvidence(String source) {
+ 183 0 if (source == null ) {
+ 184 0 return null ;
+ 185
+ }
+ 186 0 final Set<Evidence> ret = new HashSet<Evidence>();
+ 187 0 for (Evidence e : list) {
+ 188 0 if (source.equals(e.getSource())) {
+ 189 0 ret.add(e);
+ 190
+ }
+ 191 0 }
+ 192 0 return ret;
+ 193
+ }
+ 194
+
+ 195
+
+ 196
+
197
-
+
198
- public Set<Evidence> getEvidence(String source, String name) {
- 199 0 if (source == null || name == null ) {
- 200 0 return null ;
+
+ 199
+
+ 200
+
201
+
+ 202
+ public Set<Evidence> getEvidence(String source, String name) {
+ 203 2 if (source == null || name == null ) {
+ 204 0 return null ;
+ 205
}
- 202 0 final Set<Evidence> ret = new HashSet<Evidence>();
- 203 0 for (Evidence e : list) {
- 204 0 if (source.equals(e.getSource()) && name.equals(e.getName())) {
- 205 0 ret.add(e);
- 206
- }
- 207 0 }
- 208 0 return ret;
- 209
- }
+ 206 2 final Set<Evidence> ret = new HashSet<Evidence>();
+ 207 2 for (Evidence e : list) {
+ 208 2 if (source.equals(e.getSource()) && name.equals(e.getName())) {
+ 209 2 ret.add(e);
210
-
- 211
-
- 212
-
+ }
+ 211 2 }
+ 212 2 return ret;
213
-
+ }
214
-
+
215
-
+
216
- public Iterator<Evidence> iterator() {
- 217 0 return list.iterator();
+
+ 217
+
218
- }
+
219
-
+
220
-
- 221
-
+ public Iterator<Evidence> iterator() {
+ 221 117 return list.iterator();
222
-
+ }
223
-
+
224
-
+
225
-
+
226
- public boolean containsUsedString(String text) {
- 227 0 if (text == null ) {
- 228 0 return false ;
- 229
- }
- 230 0 final String textToTest = text.toLowerCase();
- 231
-
- 232 0 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
- 233
-
- 234 0 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
- 235 0 if (value.contains(textToTest)) {
- 236 0 return true ;
- 237
- }
- 238 0 }
- 239 0 return false ;
- 240
- }
- 241
-
- 242
-
- 243
-
- 244
- 245
-
- 246
+ 227
+
+ 228
+ 229
+
+ 230
+ public boolean containsUsedString(String text) {
+ 231 112 if (text == null ) {
+ 232 0 return false ;
+ 233
+ }
+ 234 112 final String textToTest = text.toLowerCase();
+ 235
+
+ 236 112 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
+ 237
+
+ 238 754 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
+ 239 754 if (value.contains(textToTest)) {
+ 240 44 return true ;
+ 241
+ }
+ 242 710 }
+ 243 68 return false ;
+ 244
+ }
+ 245
+
+ 246
+
247
-
+
248
- public boolean containsUsedVersion(DependencyVersion version) {
- 249 0 if (version == null ) {
- 250 0 return false ;
+
+ 249
+
+ 250
+
251
- }
+
252
+ public boolean containsUsedVersion(DependencyVersion version) {
+ 253 0 if (version == null ) {
+ 254 0 return false ;
+ 255
+ }
+ 256
- 253 0 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
- 254 0 final DependencyVersion value = DependencyVersionUtil.parseVersion(e.getValue());
- 255 0 if (value != null && value.matchesAtLeastThreeLevels(version)) {
- 256 0 return true ;
- 257
- }
- 258 0 }
- 259 0 return false ;
- 260
- }
+ 257 0 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
+ 258 0 final DependencyVersion value = DependencyVersionUtil.parseVersion(e.getValue());
+ 259 0 if (value != null && value.matchesAtLeastThreeLevels(version)) {
+ 260 0 return true ;
261
-
- 262
-
- 263
-
- 264
-
- 265
-
- 266
-
- 267
-
- 268
- public boolean contains(Confidence confidence) {
- 269 0 for (Evidence e : list) {
- 270 0 if (e.getConfidence().equals(confidence)) {
- 271 0 return true ;
- 272
}
- 273 0 }
- 274 0 return false ;
- 275
+ 262 0 }
+ 263 0 return false ;
+ 264
}
+ 265
+
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+ public boolean contains(Confidence confidence) {
+ 273 24 for (Evidence e : list) {
+ 274 114 if (e.getConfidence().equals(confidence)) {
+ 275 21 return true ;
276
-
- 277
-
- 278
-
+ }
+ 277 93 }
+ 278 3 return false ;
279
-
+ }
280
-
+
281
-
+
282
-
+
283
- public static EvidenceCollection mergeUsed(EvidenceCollection... ec) {
- 284 0 final EvidenceCollection ret = new EvidenceCollection();
- 285 0 for (EvidenceCollection col : ec) {
- 286 0 for (Evidence e : col.list) {
- 287 0 if (e.isUsed()) {
- 288 0 ret.addEvidence(e);
- 289
- }
- 290 0 }
- 291
- }
- 292 0 return ret;
- 293
- }
- 294
-
- 295
-
- 296
-
- 297
- 298
+ 284
- 299
-
- 300
+ 285
+
+ 286
- 301
- public static EvidenceCollection merge(EvidenceCollection... ec) {
- 302 0 final EvidenceCollection ret = new EvidenceCollection();
- 303 0 for (EvidenceCollection col : ec) {
- 304 0 ret.list.addAll(col.list);
- 305 0 ret.weightedStrings.addAll(col.weightedStrings);
- 306
+ 287
+ public static EvidenceCollection mergeUsed(EvidenceCollection... ec) {
+ 288 1 final EvidenceCollection ret = new EvidenceCollection();
+ 289 4 for (EvidenceCollection col : ec) {
+ 290 3 for (Evidence e : col.list) {
+ 291 2 if (e.isUsed()) {
+ 292 1 ret.addEvidence(e);
+ 293
+ }
+ 294 2 }
+ 295
}
- 307 0 return ret;
- 308
+ 296 1 return ret;
+ 297
}
- 309
+ 298
+ 299
+
+ 300
+
+ 301
+
+ 302
+
+ 303
+
+ 304
+
+ 305
+ public static EvidenceCollection merge(EvidenceCollection... ec) {
+ 306 3 final EvidenceCollection ret = new EvidenceCollection();
+ 307 12 for (EvidenceCollection col : ec) {
+ 308 9 ret.list.addAll(col.list);
+ 309 9 ret.weightedStrings.addAll(col.weightedStrings);
310
-
- 311
-
+ }
+ 311 3 return ret;
312
-
+ }
313
-
+
314
-
+
315
- @Override
+
316
- public String toString() {
- 317 0 final StringBuilder sb = new StringBuilder();
- 318 0 for (Evidence e : this .list) {
- 319 0 sb.append(e.getValue()).append(' ' );
- 320 0 }
- 321 0 return sb.toString();
- 322
- }
- 323
-
- 324
-
- 325
-
- 326
- 327
-
- 328
+ 317
+
+ 318
- 329
- public int size() {
- 330 0 return list.size();
- 331
+ 319
+ @Override
+ 320
+ public String toString() {
+ 321 3 final StringBuilder sb = new StringBuilder();
+ 322 3 for (Evidence e : this .list) {
+ 323 11 sb.append(e.getValue()).append(' ' );
+ 324 11 }
+ 325 3 return sb.toString();
+ 326
}
- 332
+ 327
- 333
+ 328
- 334
-
- 335
-
- 336
-
- 337
-
- 338
-
- 339
-
- 340
+ 329
+
+ 330
+ 331
+
+ 332
+
+ 333
+ public int size() {
+ 334 29 return list.size();
+ 335
+ }
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+
341
342
-
+
343
-
+
344
-
- 345
-
- 346
-
- 347
+ 345
+
+ 346
+
+ 347
+
348
-
+
349
-
+
350
-
+
351
- private String urlCorrection(String value) {
- 352 0 if (value == null || !UrlStringUtils.containsUrl(value)) {
- 353 0 return value;
+
+ 352
+
+ 353
+
354
+
+ 355
+ private String urlCorrection(String value) {
+ 356 754 if (value == null || !UrlStringUtils.containsUrl(value)) {
+ 357 749 return value;
+ 358
}
- 355 0 final StringBuilder sb = new StringBuilder(value.length());
- 356 0 final String[] parts = value.split("\\s" );
- 357 0 for (String part : parts) {
- 358 0 if (UrlStringUtils.isUrl(part)) {
- 359
+ 359 5 final StringBuilder sb = new StringBuilder(value.length());
+ 360 5 final String[] parts = value.split("\\s" );
+ 361 10 for (String part : parts) {
+ 362 5 if (UrlStringUtils.isUrl(part)) {
+ 363
try {
- 360 0 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
- 361 0 sb.append(' ' ).append(StringUtils.join(data, ' ' ));
- 362 0 } catch (MalformedURLException ex) {
- 363 0 Logger.getLogger(EvidenceCollection.class .getName()).log(Level.FINE, "error parsing " + part, ex);
- 364 0 sb.append(' ' ).append(part);
- 365 0 }
- 366
+ 364 5 final List<String> data = UrlStringUtils.extractImportantUrlData(part);
+ 365 5 sb.append(' ' ).append(StringUtils.join(data, ' ' ));
+ 366 0 } catch (MalformedURLException ex) {
+ 367 0 LOGGER.log(Level.FINE, "error parsing " + part, ex);
+ 368 0 sb.append(' ' ).append(part);
+ 369 5 }
+ 370
} else {
- 367 0 sb.append(' ' ).append(part);
- 368
- }
- 369
- }
- 370 0 return sb.toString().trim();
- 371
- }
+ 371 0 sb.append(' ' ).append(part);
372
+ }
+ 373
+ }
+ 374 5 return sb.toString().trim();
+ 375
+ }
+ 376
}
-
+
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 e417ac949..5c1d7700d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
@@ -12,7 +12,7 @@
@@ -63,7 +63,7 @@
23
- 24 0 public class Identifier implements Comparable<Identifier> {
+ 24 18 public class Identifier implements Comparable<Identifier> {
25
26
@@ -373,10 +373,10 @@
@Override
185
public int hashCode() {
- 186 0 int hash = 5;
- 187 0 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
- 188 0 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
- 189 0 return hash;
+ 186 10 int hash = 5;
+ 187 10 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
+ 188 10 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
+ 189 10 return hash;
190
}
191
@@ -414,17 +414,17 @@
208
public int compareTo(Identifier o) {
- 209 0 if (o == null ) {
+ 209 22 if (o == null ) {
210 0 return -1;
211
}
- 212 0 return this .value.compareTo(o.value);
+ 212 22 return this .value.compareTo(o.value);
213
}
214
}
-
+
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 8666bbef1..53e01a713 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
@@ -12,7 +12,7 @@
@@ -69,7 +69,7 @@
26
- 27 0 public class Reference implements Serializable, Comparable<Reference> {
+ 27 276 public class Reference implements Serializable, Comparable<Reference> {
28
29
@@ -271,10 +271,10 @@
136
public int compareTo(Reference o) {
- 137 0 if (source.equals(o.source)) {
- 138 0 if (name.equals(o.name)) {
- 139 0 if (url.equals(o.url)) {
- 140 0 return 0;
+ 137 276 if (source.equals(o.source)) {
+ 138 83 if (name.equals(o.name)) {
+ 139 29 if (url.equals(o.url)) {
+ 140 29 return 0;
141
} else {
142 0 return url.compareTo(o.url);
@@ -282,12 +282,12 @@
}
144
} else {
- 145 0 return name.compareTo(o.name);
+ 145 54 return name.compareTo(o.name);
146
}
147
} else {
- 148 0 return source.compareTo(o.source);
+ 148 193 return source.compareTo(o.source);
149
}
150
@@ -296,6 +296,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 4d7dfe202..bdd5cd760 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
@@ -12,7 +12,7 @@
@@ -75,7 +75,7 @@
29
- 30 0 public class Vulnerability implements Serializable, Comparable<Vulnerability> {
+ 30 31 public class Vulnerability implements Serializable, Comparable<Vulnerability> {
31
32
@@ -180,7 +180,7 @@
82
- 83 0 private SortedSet<Reference> references = new TreeSet<Reference>();
+ 83 31 private SortedSet<Reference> references = new TreeSet<Reference>();
84
85
@@ -231,8 +231,8 @@
108
public void addReference(Reference ref) {
- 109 0 this .references.add(ref);
- 110 0 }
+ 109 90 this .references.add(ref);
+ 110 90 }
111
112
@@ -251,19 +251,19 @@
119
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
- 120 0 final Reference ref = new Reference();
- 121 0 ref.setSource(referenceSource);
- 122 0 ref.setName(referenceName);
- 123 0 ref.setUrl(referenceUrl);
- 124 0 this .references.add(ref);
- 125 0 }
+ 120 36 final Reference ref = new Reference();
+ 121 36 ref.setSource(referenceSource);
+ 122 36 ref.setName(referenceName);
+ 123 36 ref.setUrl(referenceUrl);
+ 124 36 this .references.add(ref);
+ 125 36 }
126
127
128
- 129 0 private SortedSet<VulnerableSoftware> vulnerableSoftware = new TreeSet<VulnerableSoftware>();
+ 129 31 private SortedSet<VulnerableSoftware> vulnerableSoftware = new TreeSet<VulnerableSoftware>();
130
131
@@ -316,7 +316,7 @@
155
public boolean addVulnerableSoftware(String cpe) {
- 156 0 return addVulnerableSoftware(cpe, null );
+ 156 666 return addVulnerableSoftware(cpe, null );
157
}
158
@@ -337,13 +337,13 @@
166
public boolean addVulnerableSoftware(String cpe, String previousVersion) {
- 167 0 final VulnerableSoftware vs = new VulnerableSoftware();
- 168 0 vs.setCpe(cpe);
- 169 0 if (previousVersion != null ) {
- 170 0 vs.setPreviousVersion(previousVersion);
+ 167 668 final VulnerableSoftware vs = new VulnerableSoftware();
+ 168 668 vs.setCpe(cpe);
+ 169 668 if (previousVersion != null ) {
+ 170 2 vs.setPreviousVersion(previousVersion);
171
}
- 172 0 return updateVulnerableSoftware(vs);
+ 172 668 return updateVulnerableSoftware(vs);
173
}
174
@@ -362,11 +362,11 @@
181
public boolean updateVulnerableSoftware(VulnerableSoftware vulnSoftware) {
- 182 0 if (vulnerableSoftware.contains(vulnSoftware)) {
+ 182 668 if (vulnerableSoftware.contains(vulnSoftware)) {
183 0 vulnerableSoftware.remove(vulnSoftware);
184
}
- 185 0 return vulnerableSoftware.add(vulnSoftware);
+ 185 668 return vulnerableSoftware.add(vulnSoftware);
186
}
187
@@ -749,9 +749,9 @@
@Override
380
public int hashCode() {
- 381 0 int hash = 5;
- 382 0 hash = 41 * hash + (this .name != null ? this .name.hashCode() : 0);
- 383 0 return hash;
+ 381 3 int hash = 5;
+ 382 3 hash = 41 * hash + (this .name != null ? this .name.hashCode() : 0);
+ 383 3 return hash;
384
}
385
@@ -811,9 +811,9 @@
413
public void setMatchedCPE(String cpeId, String previous) {
- 414 0 matchedCPE = cpeId;
- 415 0 matchedAllPreviousCPE = previous;
- 416 0 }
+ 414 3 matchedCPE = cpeId;
+ 415 3 matchedAllPreviousCPE = previous;
+ 416 3 }
417
418
@@ -871,6 +871,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 9ad0f90f6..e2ac63dca 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
@@ -12,7 +12,7 @@
@@ -71,7 +71,7 @@
27
- 28 0 public class VulnerabilityComparator implements Comparator<Vulnerability>, Serializable {
+ 28 10 public class VulnerabilityComparator implements Comparator<Vulnerability>, Serializable {
29
30
@@ -100,13 +100,13 @@
42
public int compare(Vulnerability o1, Vulnerability o2) {
- 43 0 return o2.getName().compareTo(o1.getName());
+ 43 10 return o2.getName().compareTo(o1.getName());
44
}
45
}
-
+
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 075419c93..188cdecaa 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
@@ -12,7 +12,7 @@
@@ -79,552 +79,559 @@
31
- 32 0 public class VulnerableSoftware extends IndexEntry implements Serializable, Comparable<VulnerableSoftware> {
+ 32 7937 public class VulnerableSoftware extends IndexEntry implements Serializable, Comparable<VulnerableSoftware> {
33
34
35
-
+
36
- 37
- private static final long serialVersionUID = 307319490326651052L;
+ 37 1 private static final Logger LOGGER = Logger.getLogger(VulnerableSoftware.class .getName());
38
-
+
39
-
+
40
-
- 41
-
- 42
-
- 43
- 44
- public void setCpe(String cpe) {
- 45
- try {
- 46 0 parseName(cpe);
- 47 0 } catch (UnsupportedEncodingException ex) {
- 48 0 final String msg = String.format("Character encoding is unsupported for CPE '%s'." , cpe);
- 49 0 Logger.getLogger(VulnerableSoftware.class .getName()).log(Level.WARNING, msg);
- 50 0 Logger.getLogger(VulnerableSoftware.class .getName()).log(Level.FINE, null , ex);
- 51 0 setName(cpe);
- 52 0 }
- 53 0 }
- 54
+ 41
+ private static final long serialVersionUID = 307319490326651052L;
+ 42
- 55
+ 43
- 56
-
- 57
-
- 58
-
- 59
-
- 60
-
- 61
-
- 62
+ 44
+
+ 45
+ 46
+
+ 47
+
+ 48
+ public void setCpe(String cpe) {
+ 49
+ try {
+ 50 736 parseName(cpe);
+ 51 0 } catch (UnsupportedEncodingException ex) {
+ 52 0 final String msg = String.format("Character encoding is unsupported for CPE '%s'." , cpe);
+ 53 0 LOGGER.log(Level.WARNING, msg);
+ 54 0 LOGGER.log(Level.FINE, null , ex);
+ 55 0 setName(cpe);
+ 56 736 }
+ 57 736 }
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
63
64
-
+
65
-
+
66
67
-
+
68
-
+
69
-
+
70
- @Override
+
71
- public void parseName(String cpeName) throws UnsupportedEncodingException {
- 72 0 this .name = cpeName;
- 73 0 if (cpeName != null && cpeName.length() > 7) {
- 74 0 final String[] data = cpeName.substring(7).split(":" );
- 75 0 if (data.length >= 1) {
- 76 0 this .setVendor(URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" ));
- 77
- }
- 78 0 if (data.length >= 2) {
- 79 0 this .setProduct(URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" ));
- 80
- }
- 81 0 if (data.length >= 3) {
- 82 0 version = URLDecoder.decode(data[2].replace("+" , "%2B" ), "UTF-8" );
- 83
- }
- 84 0 if (data.length >= 4) {
- 85 0 revision = URLDecoder.decode(data[3].replace("+" , "%2B" ), "UTF-8" );
- 86
- }
- 87 0 if (data.length >= 5) {
- 88 0 edition = URLDecoder.decode(data[4].replace("+" , "%2B" ), "UTF-8" );
- 89
- }
- 90
- }
- 91 0 }
- 92
-
- 93
-
- 94
+
+ 72
+
+ 73
- 95
- private String previousVersion;
- 96
-
- 97
-
- 98
-
- 99
-
- 100
-
- 101
-
- 102
- public boolean hasPreviousVersion() {
- 103 0 return previousVersion != null ;
- 104
- }
- 105
-
- 106
-
- 107
-
- 108
-
- 109
-
- 110
-
- 111
- public String getPreviousVersion() {
- 112
- return previousVersion;
- 113
- }
- 114
-
- 115
-
- 116
-
- 117
-
- 118
-
- 119
-
- 120
- public void setPreviousVersion(String previousVersion) {
- 121
- this .previousVersion = previousVersion;
- 122
- }
- 123
-
- 124
-
- 125
-
- 126
-
- 127
-
- 128
-
- 129
-
- 130
+ 74
@Override
+ 75
+ public void parseName(String cpeName) throws UnsupportedEncodingException {
+ 76 760 this .name = cpeName;
+ 77 760 if (cpeName != null && cpeName.length() > 7) {
+ 78 760 final String[] data = cpeName.substring(7).split(":" );
+ 79 760 if (data.length >= 1) {
+ 80 760 this .setVendor(URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" ));
+ 81
+ }
+ 82 760 if (data.length >= 2) {
+ 83 760 this .setProduct(URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" ));
+ 84
+ }
+ 85 760 if (data.length >= 3) {
+ 86 760 version = URLDecoder.decode(data[2].replace("+" , "%2B" ), "UTF-8" );
+ 87
+ }
+ 88 760 if (data.length >= 4) {
+ 89 43 revision = URLDecoder.decode(data[3].replace("+" , "%2B" ), "UTF-8" );
+ 90
+ }
+ 91 760 if (data.length >= 5) {
+ 92 0 edition = URLDecoder.decode(data[4].replace("+" , "%2B" ), "UTF-8" );
+ 93
+ }
+ 94
+ }
+ 95 760 }
+ 96
+
+ 97
+
+ 98
+
+ 99
+ private String previousVersion;
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+ public boolean hasPreviousVersion() {
+ 107 0 return previousVersion != null ;
+ 108
+ }
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+ public String getPreviousVersion() {
+ 116
+ return previousVersion;
+ 117
+ }
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+ public void setPreviousVersion(String previousVersion) {
+ 125
+ this .previousVersion = previousVersion;
+ 126
+ }
+ 127
+
+ 128
+
+ 129
+
+ 130
+
131
- public boolean equals(Object obj) {
- 132 0 if (obj == null ) {
- 133 0 return false ;
+
+ 132
+
+ 133
+
134
+ @Override
+ 135
+ public boolean equals(Object obj) {
+ 136 1 if (obj == null ) {
+ 137 0 return false ;
+ 138
}
- 135 0 if (getClass() != obj.getClass()) {
- 136 0 return false ;
- 137
- }
- 138 0 final VulnerableSoftware other = (VulnerableSoftware) obj;
- 139 0 if ((this .getName() == null ) ? (other.getName() != null ) : !this .getName().equals(other.getName())) {
+ 139 1 if (getClass() != obj.getClass()) {
140 0 return false ;
141
}
- 142 0 return true ;
- 143
- }
- 144
-
+ 142 1 final VulnerableSoftware other = (VulnerableSoftware) obj;
+ 143 1 if ((this .getName() == null ) ? (other.getName() != null ) : !this .getName().equals(other.getName())) {
+ 144 1 return false ;
145
-
- 146
-
+ }
+ 146 0 return true ;
147
-
+ }
148
-
+
149
-
+
150
- @Override
+
151
- public int hashCode() {
- 152 0 int hash = 7;
- 153 0 hash = 83 * hash + (this .getName() != null ? this .getName().hashCode() : 0);
- 154 0 return hash;
+
+ 152
+
+ 153
+
+ 154
+ @Override
155
- }
- 156
-
- 157
-
- 158
-
+ public int hashCode() {
+ 156 63 int hash = 7;
+ 157 63 hash = 83 * hash + (this .getName() != null ? this .getName().hashCode() : 0);
+ 158 63 return hash;
159
-
+ }
160
-
+
161
-
+
162
- @Override
+
163
- public String toString() {
- 164 0 return "VulnerableSoftware{ name=" + name + ", previousVersion=" + previousVersion + '}' ;
+
+ 164
+
165
- }
+
166
-
- 167
-
- 168
-
- 169
-
- 170
-
- 171
-
- 172
-
- 173
@Override
+ 167
+ public String toString() {
+ 168 0 return "VulnerableSoftware{ name=" + name + ", previousVersion=" + previousVersion + '}' ;
+ 169
+ }
+ 170
+
+ 171
+
+ 172
+
+ 173
+
174
+
+ 175
+
+ 176
+
+ 177
+ @Override
+ 178
public int compareTo(VulnerableSoftware vs) {
- 175 0 int result = 0;
- 176 0 final String[] left = this .getName().split(":" );
- 177 0 final String[] right = vs.getName().split(":" );
- 178 0 final int max = (left.length <= right.length) ? left.length : right.length;
- 179 0 if (max > 0) {
- 180 0 for (int i = 0; result == 0 && i < max; i++) {
- 181 0 final String[] subLeft = left[i].split("\\." );
- 182 0 final String[] subRight = right[i].split("\\." );
- 183 0 final int subMax = (subLeft.length <= subRight.length) ? subLeft.length : subRight.length;
- 184 0 if (subMax > 0) {
- 185 0 for (int x = 0; result == 0 && x < subMax; x++) {
- 186 0 if (isPositiveInteger(subLeft[x]) && isPositiveInteger(subRight[x])) {
- 187
- try {
- 188 0 result = Long.valueOf(subLeft[x]).compareTo(Long.valueOf(subRight[x]));
- 189
-
- 190
-
+ 179 7939 int result = 0;
+ 180 7939 final String[] left = this .getName().split(":" );
+ 181 7939 final String[] right = vs.getName().split(":" );
+ 182 7939 final int max = (left.length <= right.length) ? left.length : right.length;
+ 183 7939 if (max > 0) {
+ 184 47603 for (int i = 0; result == 0 && i < max; i++) {
+ 185 39664 final String[] subLeft = left[i].split("\\." );
+ 186 39664 final String[] subRight = right[i].split("\\." );
+ 187 39664 final int subMax = (subLeft.length <= subRight.length) ? subLeft.length : subRight.length;
+ 188 39664 if (subMax > 0) {
+ 189 90802 for (int x = 0; result == 0 && x < subMax; x++) {
+ 190 51138 if (isPositiveInteger(subLeft[x]) && isPositiveInteger(subRight[x])) {
191
-
- 192
-
+ try {
+ 192 18719 result = Long.valueOf(subLeft[x]).compareTo(Long.valueOf(subRight[x]));
193
-
+
194
-
+
195
-
+
196
-
+
197
-
- 198 0 } catch (NumberFormatException ex) {
+
+ 198
+
199
+
+ 200
+
+ 201
+
+ 202 0 } catch (NumberFormatException ex) {
+ 203
- 200 0 if (!subLeft[x].equalsIgnoreCase(subRight[x])) {
- 201 0 result = subLeft[x].compareToIgnoreCase(subRight[x]);
- 202
- }
- 203 0 }
- 204
- } else {
- 205 0 result = subLeft[x].compareToIgnoreCase(subRight[x]);
+ 204 0 if (!subLeft[x].equalsIgnoreCase(subRight[x])) {
+ 205 0 result = subLeft[x].compareToIgnoreCase(subRight[x]);
206
+ }
+ 207 18719 }
+ 208
+ } else {
+ 209 32419 result = subLeft[x].compareToIgnoreCase(subRight[x]);
+ 210
}
- 207
- }
- 208 0 if (result == 0) {
- 209 0 if (subLeft.length > subRight.length) {
- 210 0 result = 2;
211
- }
- 212 0 if (subRight.length > subLeft.length) {
- 213 0 result = -2;
- 214
- }
- 215
}
- 216
- } else {
- 217 0 result = left[i].compareToIgnoreCase(right[i]);
+ 212 39664 if (result == 0) {
+ 213 31803 if (subLeft.length > subRight.length) {
+ 214 18 result = 2;
+ 215
+ }
+ 216 31803 if (subRight.length > subLeft.length) {
+ 217 7 result = -2;
218
- }
+ }
219
- }
- 220 0 if (result == 0) {
- 221 0 if (left.length > right.length) {
- 222 0 result = 2;
+ }
+ 220
+ } else {
+ 221 0 result = left[i].compareToIgnoreCase(right[i]);
+ 222
+ }
223
- }
- 224 0 if (right.length > left.length) {
- 225 0 result = -2;
- 226
- }
+ }
+ 224 7939 if (result == 0) {
+ 225 53 if (left.length > right.length) {
+ 226 22 result = 2;
227
- }
- 228
- } else {
- 229 0 result = this .getName().compareToIgnoreCase(vs.getName());
+ }
+ 228 53 if (right.length > left.length) {
+ 229 10 result = -2;
230
- }
- 231 0 return result;
- 232
- }
- 233
-
- 234
-
- 235
-
- 236
-
- 237
-
- 238
-
- 239
-
- 240
- private static boolean isPositiveInteger(final String str) {
- 241 0 if (str == null || str.isEmpty()) {
- 242 0 return false ;
- 243
- }
- 244 0 for (int i = 0; i < str.length(); i++) {
- 245 0 final char c = str.charAt(i);
- 246 0 if (c < '0' || c > '9' ) {
- 247 0 return false ;
- 248
+ }
+ 231
}
- 249
+ 232
+ } else {
+ 233 0 result = this .getName().compareToIgnoreCase(vs.getName());
+ 234
}
- 250 0 return true ;
- 251
+ 235 7939 return result;
+ 236
}
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+ private static boolean isPositiveInteger(final String str) {
+ 245 69929 if (str == null || str.isEmpty()) {
+ 246 14 return false ;
+ 247
+ }
+ 248 115424 for (int i = 0; i < str.length(); i++) {
+ 249 77914 final char c = str.charAt(i);
+ 250 77914 if (c < '0' || c > '9' ) {
+ 251 32405 return false ;
252
-
+ }
253
-
- 254
-
+ }
+ 254 37510 return true ;
255
- private String name;
+ }
256
-
+
257
-
+
258
-
+
259
-
+ private String name;
260
-
+
261
-
+
262
- public String getName() {
+
263
- return name;
+
264
- }
+
265
-
+
266
-
+ public String getName() {
267
-
+ return name;
268
-
+ }
269
-
+
270
-
+
271
- public void setName(String name) {
+
272
- this .name = name;
+
273
- }
+
274
-
+
275
-
+ public void setName(String name) {
276
-
+ this .name = name;
277
- private String version;
+ }
278
-
+
279
-
+
280
-
+
281
-
+ private String version;
282
-
+
283
-
+
284
- public String getVersion() {
+
285
- return version;
+
286
- }
+
287
-
+
288
-
+ public String getVersion() {
289
-
+ return version;
290
-
+ }
291
-
+
292
-
+
293
- public void setVersion(String version) {
+
294
- this .version = version;
+
295
- }
+
296
-
+
297
-
+ public void setVersion(String version) {
298
-
+ this .version = version;
299
- private String revision;
+ }
300
-
+
301
-
+
302
-
+
303
-
+ private String revision;
304
-
+
305
-
+
306
- public String getRevision() {
+
307
- return revision;
+
308
- }
+
309
-
+
310
-
+ public String getRevision() {
311
-
+ return revision;
312
-
+ }
313
-
+
314
-
+
315
- public void setRevision(String revision) {
+
316
- this .revision = revision;
+
317
- }
+
318
-
+
319
-
+ public void setRevision(String revision) {
320
-
+ this .revision = revision;
321
- private String edition;
+ }
322
-
+
323
-
+
324
-
+
325
-
+ private String edition;
326
-
- 327
-
- 328
- public String getEdition() {
- 329
- return edition;
- 330
- }
- 331
- 332
+ 327
- 333
-
- 334
+ 328
+
+ 329
- 335
-
- 336
+ 330
+
+ 331
- 337
- public void setEdition(String edition) {
- 338
- this .edition = edition;
- 339
+ 332
+ public String getEdition() {
+ 333
+ return edition;
+ 334
}
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
340
+
+ 341
+ public void setEdition(String edition) {
+ 342
+ this .edition = edition;
+ 343
+ }
+ 344
}
-
+
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 8ff897d21..1a8a09cd6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
@@ -155,6 +155,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 f2243b3a8..e80d58b65 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
index 88a7c8cdf..07d95bc26 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
@@ -131,7 +131,7 @@
58
59
-
+
60
61
@@ -139,15 +139,15 @@
62
@Override
63
- public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
- 64 0 super .startElement(NAMESPACE, localName, qName, atts);
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ 64 0 super .startElement(NAMESPACE, localName, qName, attributes);
65 0 }
66
67
68
-
+
69
70
@@ -198,6 +198,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
index 164b1871f..dc96cb24c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
@@ -409,6 +409,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
index fc6a84d43..bb67b55c2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
@@ -233,6 +233,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
index e822869a8..0d5bb8141 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
@@ -347,6 +347,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
index f1e1ab7ac..9410f0aaf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
@@ -233,6 +233,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
index 8a6465ec0..40fd40ab4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
@@ -1635,6 +1635,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
index 979716d59..e11162b58 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
@@ -1145,6 +1145,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
index ee5b21c09..d20aae474 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
@@ -429,6 +429,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
index dfc3ce948..297cd6294 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
@@ -875,6 +875,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
index 710e04457..0343a57b7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
@@ -783,6 +783,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
index 0df0082c7..e2b9966c9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
@@ -317,6 +317,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
index f1c8395ce..d5a245bc4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
@@ -409,6 +409,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
index 93567a57d..01115165a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
@@ -929,6 +929,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
index b0ed9c2e3..ac96a18db 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
@@ -465,6 +465,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
index 7b8d1247f..cd5c0b691 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
@@ -225,6 +225,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
index 354f25ae5..d851052bf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
@@ -283,6 +283,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
index 0fad6af19..ab2a89a3b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
@@ -229,6 +229,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
index 3bf644364..c3da2fc60 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
@@ -349,6 +349,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
index 79419e53e..7b3c01a1a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
@@ -609,6 +609,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
index 9ce968ae0..254136e75 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
@@ -3433,6 +3433,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
index a25697860..19d808be1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
@@ -683,6 +683,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
index d0f6e6847..e6aa6deda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
@@ -1396,6 +1396,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
index afac1330b..d061cff85 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
@@ -225,6 +225,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
index dbf295c99..ace998694 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
@@ -345,6 +345,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
index 67dab1c78..f24a19f0e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
@@ -1217,6 +1217,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
index 325238e81..b1bb67a1b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
@@ -697,6 +697,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
index 1e93521a2..418c93b0e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
@@ -317,6 +317,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
index 89bb6b30d..4734b60ad 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
@@ -171,6 +171,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
index af7107758..db5db9ce7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
@@ -1673,6 +1673,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
index 36de2880f..d6cf68611 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
@@ -343,6 +343,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
index 57e1c3ccd..3faa9e7b7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
@@ -755,6 +755,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
index 178909c6c..9ad6d7a31 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
@@ -639,6 +639,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
index f2637950f..6c39f089a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
@@ -433,6 +433,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
index 402de4c36..aaf5d609f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
@@ -465,6 +465,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
index e5191b395..4930b85c0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
@@ -287,6 +287,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
index 0b0637c70..8cbd612c2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
@@ -697,6 +697,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
index b729bb840..60364ced6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
@@ -345,6 +345,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
index e53284c38..cd2363786 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
@@ -287,6 +287,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
index 3ec17e540..49476451a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
@@ -37,6 +37,6 @@
package org.owasp.dependencycheck.jaxb.pom.generated;
-
+
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 1bad32c4b..c27b43308 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
@@ -12,7 +12,7 @@
@@ -75,366 +75,378 @@
28
import java.io.OutputStreamWriter;
29
- import java.util.List;
+ import java.text.DateFormat;
30
- import java.util.logging.Level;
+ import java.text.SimpleDateFormat;
31
- import java.util.logging.Logger;
+ import java.util.Date;
32
- import org.apache.velocity.app.VelocityEngine;
+ import java.util.List;
33
- import org.apache.velocity.context.Context;
+ import java.util.logging.Level;
34
- import org.apache.velocity.runtime.RuntimeConstants;
+ import java.util.logging.Logger;
35
- import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
+ import org.apache.velocity.VelocityContext;
36
- import org.apache.velocity.tools.ToolManager;
+ import org.apache.velocity.app.VelocityEngine;
37
- import org.apache.velocity.tools.config.EasyFactoryConfiguration;
+ import org.apache.velocity.context.Context;
38
- import org.owasp.dependencycheck.analyzer.Analyzer;
+ import org.apache.velocity.runtime.RuntimeConstants;
39
- import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
+ import org.owasp.dependencycheck.analyzer.Analyzer;
40
- import org.owasp.dependencycheck.dependency.Dependency;
+ import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
41
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.dependency.Dependency;
42
-
+ import org.owasp.dependencycheck.utils.Settings;
43
-
+
44
-
+
45
-
+
46
-
+
47
-
+
48
-
+
49
- public class ReportGenerator {
+
50
-
+ public class ReportGenerator {
51
-
+
52
-
+
53
+
+ 54
- 54 0 public enum Format {
- 55
-
+ 55 0 private static final Logger LOGGER = Logger.getLogger(ReportGenerator.class .getName());
56
-
+
57
-
+
58
-
- 59 0 ALL,
- 60
-
+
+ 59
+
+ 60 0 public enum Format {
61
-
+
62
-
- 63 0 XML,
+
+ 63
+
64
-
- 65
-
+
+ 65 0 ALL,
66
-
- 67 0 HTML,
- 68
- 69
-
- 70
+ 67
+
+ 68
- 71 0 VULN
+ 69 0 XML,
+ 70
+
+ 71
+
72
- }
- 73
-
+
+ 73 0 HTML,
74
-
+
75
-
+
76
- private final VelocityEngine engine;
- 77
-
+
+ 77 0 VULN
78
-
+ }
79
-
+
80
- private final Context context;
+
81
-
+
82
-
+ private final VelocityEngine engine;
83
-
+
84
-
+
85
-
+
86
-
+ private final Context context;
87
-
+
88
-
+
89
-
- 90 0 public ReportGenerator(String applicationName, List<Dependency> dependencies, List<Analyzer> analyzers, DatabaseProperties properties) {
- 91 0 engine = createVelocityEngine();
- 92 0 context = createContext();
+
+ 90
+
+ 91
+
+ 92
+
93
-
- 94 0 engine.init();
+
+ 94
+
95
-
- 96 0 context.put("applicationName" , applicationName);
- 97 0 context.put("dependencies" , dependencies);
- 98 0 context.put("analyzers" , analyzers);
- 99 0 context.put("properties" , properties);
- 100 0 context.put("version" , Settings.getString("application.version" , "Unknown" ));
- 101 0 }
- 102
-
- 103
-
- 104
-
- 105
-
- 106
-
- 107
+ 96 0 public ReportGenerator(String applicationName, List<Dependency> dependencies, List<Analyzer> analyzers, DatabaseProperties properties) {
+ 97 0 engine = createVelocityEngine();
+ 98 0 context = createContext();
+ 99
+
+ 100 0 engine.init();
+ 101
+
+ 102 0 final DateFormat dateFormat = new SimpleDateFormat("MMM d, yyyy 'at' HH:mm:ss z" );
+ 103 0 final DateFormat dateFormatXML = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ" );
+ 104 0 final Date d = new Date();
+ 105 0 final String scanDate = dateFormat.format(d);
+ 106 0 final String scanDateXML = dateFormatXML.format(d);
+ 107 0 final EscapeTool enc = new EscapeTool();
108
- private VelocityEngine createVelocityEngine() {
- 109 0 final VelocityEngine ve = new VelocityEngine();
- 110 0 ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, VelocityLoggerRedirect.class .getName());
- 111 0 ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath" );
- 112 0 ve.setProperty("classpath.resource.loader.class" , ClasspathResourceLoader.class .getName());
- 113 0 return ve;
- 114
- }
- 115
- 116
-
- 117
-
+ 109 0 context.put("applicationName" , applicationName);
+ 110 0 context.put("dependencies" , dependencies);
+ 111 0 context.put("analyzers" , analyzers);
+ 112 0 context.put("properties" , properties);
+ 113 0 context.put("scanDate" , scanDate);
+ 114 0 context.put("scanDateXML" , scanDateXML);
+ 115 0 context.put("enc" , enc);
+ 116 0 context.put("version" , Settings.getString("application.version" , "Unknown" ));
+ 117 0 }
118
-
+
119
-
+
120
-
+
121
- @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "RV_RETURN_VALUE_IGNORED_INFERRED" ,
+
122
- justification = "No plan to fix this style issue" )
+
123
- private Context createContext() {
- 124 0 final ToolManager manager = new ToolManager();
- 125 0 final Context c = manager.createContext();
- 126 0 final EasyFactoryConfiguration config = new EasyFactoryConfiguration();
- 127 0 config.addDefaultTools();
- 128 0 config.toolbox("application" ).tool("esc" , "org.apache.velocity.tools.generic.EscapeTool" ).tool("org.apache.velocity.tools.generic.DateTool" );
- 129 0 manager.configure(config);
- 130 0 return c;
- 131
+
+ 124
+ private VelocityEngine createVelocityEngine() {
+ 125 0 final VelocityEngine engine = new VelocityEngine();
+ 126
+
+ 127 0 engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, VelocityLoggerRedirect.class .getName());
+ 128 0 return engine;
+ 129
}
+ 130
+
+ 131
+
132
-
+
133
-
+
134
-
+
135
-
+
136
-
- 137
-
+ private Context createContext() {
+ 137 0 return new VelocityContext();
138
-
+ }
139
-
+
140
-
+
141
- public void generateReports(String outputDir, Format format) throws IOException, Exception {
- 142 0 if (format == Format.XML || format == Format.ALL) {
- 143 0 generateReport("XmlReport" , outputDir + File.separator + "dependency-check-report.xml" );
- 144
- }
- 145 0 if (format == Format.HTML || format == Format.ALL) {
- 146 0 generateReport("HtmlReport" , outputDir + File.separator + "dependency-check-report.html" );
- 147
- }
- 148 0 if (format == Format.VULN || format == Format.ALL) {
- 149 0 generateReport("VulnerabilityReport" , outputDir + File.separator + "dependency-check-vulnerability.html" );
- 150
- }
- 151 0 }
- 152
-
- 153
-
- 154
- 155
+ 142
- 156
+ 143
- 157
-
- 158
+ 144
+
+ 145
- 159
+ 146
+ 147
+
+ 148
+ public void generateReports(String outputDir, Format format) throws IOException, Exception {
+ 149 0 if (format == Format.XML || format == Format.ALL) {
+ 150 0 generateReport("XmlReport" , outputDir + File.separator + "dependency-check-report.xml" );
+ 151
+ }
+ 152 0 if (format == Format.HTML || format == Format.ALL) {
+ 153 0 generateReport("HtmlReport" , outputDir + File.separator + "dependency-check-report.html" );
+ 154
+ }
+ 155 0 if (format == Format.VULN || format == Format.ALL) {
+ 156 0 generateReport("VulnerabilityReport" , outputDir + File.separator + "dependency-check-vulnerability.html" );
+ 157
+ }
+ 158 0 }
+ 159
+
160
-
- 161
- public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
- 162 0 final String format = outputFormat.toUpperCase();
- 163 0 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
- 164 0 if ("XML" .equalsIgnoreCase(format)) {
- 165 0 generateReports(outputDir, Format.XML);
- 166
- }
- 167 0 if ("HTML" .equalsIgnoreCase(format)) {
- 168 0 generateReports(outputDir, Format.HTML);
- 169
- }
- 170 0 if ("VULN" .equalsIgnoreCase(format)) {
- 171 0 generateReports(outputDir, Format.VULN);
- 172
- }
- 173 0 if ("ALL" .equalsIgnoreCase(format)) {
- 174 0 generateReports(outputDir, Format.ALL);
- 175
- }
- 176
- }
- 177 0 }
- 178
-
- 179
- 180
-
- 181
-
- 182
-
- 183
+ 161
+
+ 162
- 184
-
- 185
-
- 186
-
- 187
-
- 188
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
- 189
- protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
- 190 0 InputStream input = null ;
- 191 0 String templatePath = null ;
- 192 0 final File f = new File(templateName);
- 193 0 if (f.exists() && f.isFile()) {
- 194
- try {
- 195 0 templatePath = templateName;
- 196 0 input = new FileInputStream(f);
- 197 0 } catch (FileNotFoundException ex) {
- 198 0 final String msg = "Unable to generate the report, the report template file could not be found." ;
- 199 0 Logger.getLogger(ReportGenerator.class .getName()).log(Level.SEVERE, msg);
- 200 0 Logger.getLogger(ReportGenerator.class .getName()).log(Level.FINE, null , ex);
- 201 0 }
- 202
- } else {
- 203 0 templatePath = "templates/" + templateName + ".vsl" ;
- 204 0 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
- 205
- }
- 206 0 if (input == null ) {
- 207 0 throw new IOException("Template file doesn't exist" );
- 208
- }
- 209
-
- 210 0 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
- 211 0 OutputStreamWriter writer = null ;
- 212 0 OutputStream outputStream = null ;
- 213
-
- 214
- try {
- 215 0 final File outDir = new File(outFileName).getParentFile();
- 216 0 if (!outDir.exists()) {
- 217 0 final boolean created = outDir.mkdirs();
- 218 0 if (!created) {
- 219 0 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
- 220
- }
- 221
+ 168
+ public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
+ 169 0 final String format = outputFormat.toUpperCase();
+ 170 0 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
+ 171 0 if ("XML" .equalsIgnoreCase(format)) {
+ 172 0 generateReports(outputDir, Format.XML);
+ 173
}
- 222
+ 174 0 if ("HTML" .equalsIgnoreCase(format)) {
+ 175 0 generateReports(outputDir, Format.HTML);
+ 176
+ }
+ 177 0 if ("VULN" .equalsIgnoreCase(format)) {
+ 178 0 generateReports(outputDir, Format.VULN);
+ 179
+ }
+ 180 0 if ("ALL" .equalsIgnoreCase(format)) {
+ 181 0 generateReports(outputDir, Format.ALL);
+ 182
+ }
+ 183
+ }
+ 184 0 }
+ 185
- 223 0 outputStream = new FileOutputStream(outFileName);
- 224 0 writer = new OutputStreamWriter(outputStream, "UTF-8" );
- 225
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+ protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
+ 197 0 InputStream input = null ;
+ 198 0 String templatePath = null ;
+ 199 0 final File f = new File(templateName);
+ 200 0 if (f.exists() && f.isFile()) {
+ 201
+ try {
+ 202 0 templatePath = templateName;
+ 203 0 input = new FileInputStream(f);
+ 204 0 } catch (FileNotFoundException ex) {
+ 205 0 final String msg = "Unable to generate the report, the report template file could not be found." ;
+ 206 0 LOGGER.log(Level.SEVERE, msg);
+ 207 0 LOGGER.log(Level.FINE, null , ex);
+ 208 0 }
+ 209
+ } else {
+ 210 0 templatePath = "templates/" + templateName + ".vsl" ;
+ 211 0 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
+ 212
+ }
+ 213 0 if (input == null ) {
+ 214 0 throw new IOException("Template file doesn't exist" );
+ 215
+ }
+ 216
- 226 0 if (!engine.evaluate(context, writer, templatePath, reader)) {
- 227 0 throw new Exception("Failed to convert the template into html." );
+ 217 0 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
+ 218 0 OutputStreamWriter writer = null ;
+ 219 0 OutputStream outputStream = null ;
+ 220
+
+ 221
+ try {
+ 222 0 final File outDir = new File(outFileName).getParentFile();
+ 223 0 if (!outDir.exists()) {
+ 224 0 final boolean created = outDir.mkdirs();
+ 225 0 if (!created) {
+ 226 0 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
+ 227
+ }
228
}
- 229 0 writer.flush();
- 230
- } finally {
- 231 0 if (writer != null ) {
+ 229
+
+ 230 0 outputStream = new FileOutputStream(outFileName);
+ 231 0 writer = new OutputStreamWriter(outputStream, "UTF-8" );
232
- try {
- 233 0 writer.close();
- 234 0 } catch (IOException ex) {
- 235 0 Logger.getLogger(ReportGenerator.class .getName()).log(Level.FINEST, null , ex);
- 236 0 }
- 237
+
+ 233 0 if (!engine.evaluate(context, writer, templatePath, reader)) {
+ 234 0 throw new Exception("Failed to convert the template into html." );
+ 235
}
- 238 0 if (outputStream != null ) {
+ 236 0 writer.flush();
+ 237
+ } finally {
+ 238 0 if (writer != null ) {
239
try {
- 240 0 outputStream.close();
+ 240 0 writer.close();
241 0 } catch (IOException ex) {
- 242 0 Logger.getLogger(ReportGenerator.class .getName()).log(Level.FINEST, null , ex);
+ 242 0 LOGGER.log(Level.FINEST, null , ex);
243 0 }
244
}
- 245
- try {
- 246 0 reader.close();
- 247 0 } catch (IOException ex) {
- 248 0 Logger.getLogger(ReportGenerator.class .getName()).log(Level.FINEST, null , ex);
- 249 0 }
- 250 0 }
- 251 0 }
+ 245 0 if (outputStream != null ) {
+ 246
+ try {
+ 247 0 outputStream.close();
+ 248 0 } catch (IOException ex) {
+ 249 0 LOGGER.log(Level.FINEST, null , ex);
+ 250 0 }
+ 251
+ }
252
+ try {
+ 253 0 reader.close();
+ 254 0 } catch (IOException ex) {
+ 255 0 LOGGER.log(Level.FINEST, null , ex);
+ 256 0 }
+ 257 0 }
+ 258 0 }
+ 259
}
-
+
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 630b3bb97..a97ce5041 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
@@ -12,7 +12,7 @@
@@ -60,160 +60,167 @@
21
import java.util.logging.Logger;
22
- import org.apache.velocity.app.Velocity;
- 23
import org.apache.velocity.runtime.RuntimeServices;
- 24
+ 23
import org.apache.velocity.runtime.log.LogChute;
+ 24
+
25
-
- 26
- 27
+ 26
- 28
+ 27
- 29
+ 28
- 30
+ 29
- 31
+ 30
- 32
+ 31
- 33
+ 32
- 34
+ 33
- 35
+ 34
- 36
+ 35
- 37
+ 36
- 38
+ 37
public class VelocityLoggerRedirect implements LogChute {
+ 38
+
39
-
+
40
-
+
41
-
- 42
-
+
+ 42 0 private static final Logger LOGGER = Logger.getLogger(VelocityLoggerRedirect.class .getName());
43
-
+
44
-
+
45
- public void init(RuntimeServices rsvc) {
+
46
-
- 47 0 }
+
+ 47
+
48
-
+
49
-
+ public void init(RuntimeServices rsvc) {
50
-
- 51
-
+
+ 51 0 }
52
-
+
53
-
+
54
-
+
55
-
+
56
- public void log(int level, String message) {
- 57 0 Logger.getLogger(Velocity.class .getName()).log(getLevel(level), message);
- 58 0 }
- 59
-
- 60
-
- 61
-
- 62
-
- 63
- 64
+ 57
- 65
+ 58
+ 59
+
+ 60
+ public void log(int level, String message) {
+ 61 0 LOGGER.log(getLevel(level), message);
+ 62 0 }
+ 63
+
+ 64
+
+ 65
+
66
-
+
67
-
+
68
- public void log(int level, String message, Throwable t) {
- 69 0 Logger.getLogger(Velocity.class .getName()).log(getLevel(level), message, t);
- 70 0 }
- 71
-
- 72
-
- 73
-
- 74
-
- 75
- 76
-
- 77
+ 69
+
+ 70
+
+ 71
- 78
- public boolean isLevelEnabled(int level) {
- 79 0 return true ;
- 80
- }
- 81
+ 72
+ public void log(int level, String message, Throwable t) {
+ 73 0 LOGGER.log(getLevel(level), message, t);
+ 74 0 }
+ 75
- 82
+ 76
- 83
-
- 84
+ 77
+
+ 78
- 85
-
- 86
-
- 87
+ 79
+
+ 80
+
+ 81
- 88
- private Level getLevel(int velocityLevel) {
- 89 0 switch (velocityLevel) {
- 90
- case TRACE_ID:
- 91 0 return Level.ALL;
- 92
- case DEBUG_ID:
- 93 0 return Level.FINE;
- 94
- case INFO_ID:
- 95 0 return Level.INFO;
- 96
- case WARN_ID:
- 97 0 return Level.WARNING;
- 98
- case ERROR_ID:
- 99 0 return Level.SEVERE;
- 100
- default :
- 101 0 return Level.INFO;
- 102
- }
- 103
+ 82
+ public boolean isLevelEnabled(int level) {
+ 83 0 return true ;
+ 84
}
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+ private Level getLevel(int velocityLevel) {
+ 93 0 switch (velocityLevel) {
+ 94
+ case TRACE_ID:
+ 95 0 return Level.ALL;
+ 96
+ case DEBUG_ID:
+ 97 0 return Level.FINE;
+ 98
+ case INFO_ID:
+ 99 0 return Level.INFO;
+ 100
+ case WARN_ID:
+ 101 0 return Level.WARNING;
+ 102
+ case ERROR_ID:
+ 103 0 return Level.SEVERE;
104
+ default :
+ 105 0 return Level.INFO;
+ 106
+ }
+ 107
+ }
+ 108
}
-
+
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 7dcc40ab1..fa8d3dbdd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
@@ -12,7 +12,7 @@
@@ -237,28 +237,28 @@
110
public boolean matches(String text) {
- 111 0 if (text == null ) {
+ 111 22 if (text == null ) {
112 0 return false ;
113
}
- 114 0 if (this .regex) {
+ 114 22 if (this .regex) {
115
Pattern rx;
- 116 0 if (this .caseSensitive) {
- 117 0 rx = Pattern.compile(this .value);
+ 116 7 if (this .caseSensitive) {
+ 117 2 rx = Pattern.compile(this .value);
118
} else {
- 119 0 rx = Pattern.compile(this .value, Pattern.CASE_INSENSITIVE);
+ 119 5 rx = Pattern.compile(this .value, Pattern.CASE_INSENSITIVE);
120
}
- 121 0 return rx.matcher(text).matches();
+ 121 7 return rx.matcher(text).matches();
122
} else {
- 123 0 if (this .caseSensitive) {
- 124 0 return value.equals(text);
+ 123 15 if (this .caseSensitive) {
+ 124 2 return value.equals(text);
125
} else {
- 126 0 return value.equalsIgnoreCase(text);
+ 126 13 return value.equalsIgnoreCase(text);
127
}
128
@@ -308,28 +308,28 @@
@Override
153
public boolean equals(Object obj) {
- 154 0 if (obj == null ) {
+ 154 1 if (obj == null ) {
155 0 return false ;
156
}
- 157 0 if (getClass() != obj.getClass()) {
+ 157 1 if (getClass() != obj.getClass()) {
158 0 return false ;
159
}
- 160 0 final PropertyType other = (PropertyType) obj;
- 161 0 if ((this .value == null ) ? (other.value != null ) : !this .value.equals(other.value)) {
+ 160 1 final PropertyType other = (PropertyType) obj;
+ 161 1 if ((this .value == null ) ? (other.value != null ) : !this .value.equals(other.value)) {
162 0 return false ;
163
}
- 164 0 if (this .regex != other.regex) {
+ 164 1 if (this .regex != other.regex) {
165 0 return false ;
166
}
- 167 0 if (this .caseSensitive != other.caseSensitive) {
+ 167 1 if (this .caseSensitive != other.caseSensitive) {
168 0 return false ;
169
}
- 170 0 return true ;
+ 170 1 return true ;
171
}
172
@@ -357,6 +357,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 6fecf18ec..0f0e2acff 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
@@ -12,7 +12,7 @@
@@ -84,110 +84,119 @@
33
34
-
+
35
-
- 36
-
+
+ 36 1 private static final Logger LOGGER = Logger.getLogger(SuppressionErrorHandler.class .getName());
37
-
+
38
-
+
39
- private String getPrettyParseExceptionInfo(SAXParseException ex) {
+
40
-
- 41 0 final StringBuilder sb = new StringBuilder();
+
+ 41
+
42
-
- 43 0 if (ex.getSystemId() != null ) {
- 44 0 sb.append("systemId=" ).append(ex.getSystemId()).append(", " );
+
+ 43
+
+ 44
+ private String getPrettyParseExceptionInfo(SAXParseException ex) {
45
+
+ 46 0 final StringBuilder sb = new StringBuilder();
+ 47
+
+ 48 0 if (ex.getSystemId() != null ) {
+ 49 0 sb.append("systemId=" ).append(ex.getSystemId()).append(", " );
+ 50
}
- 46 0 if (ex.getPublicId() != null ) {
- 47 0 sb.append("publicId=" ).append(ex.getPublicId()).append(", " );
- 48
+ 51 0 if (ex.getPublicId() != null ) {
+ 52 0 sb.append("publicId=" ).append(ex.getPublicId()).append(", " );
+ 53
}
- 49 0 if (ex.getLineNumber() > 0) {
- 50 0 sb.append("Line=" ).append(ex.getLineNumber());
- 51
- }
- 52 0 if (ex.getColumnNumber() > 0) {
- 53 0 sb.append(", Column=" ).append(ex.getColumnNumber());
- 54
- }
- 55 0 sb.append(": " ).append(ex.getMessage());
+ 54 0 if (ex.getLineNumber() > 0) {
+ 55 0 sb.append("Line=" ).append(ex.getLineNumber());
56
-
- 57 0 return sb.toString();
- 58
- }
+ }
+ 57 0 if (ex.getColumnNumber() > 0) {
+ 58 0 sb.append(", Column=" ).append(ex.getColumnNumber());
59
-
- 60
-
+ }
+ 60 0 sb.append(": " ).append(ex.getMessage());
61
-
- 62
-
+
+ 62 0 return sb.toString();
63
-
+ }
64
-
+
65
-
+
66
- @Override
+
67
- public void warning(SAXParseException ex) throws SAXException {
- 68 0 Logger.getLogger(SuppressionErrorHandler.class .getName()).log(Level.FINE, null , ex);
- 69 0 }
+
+ 68
+
+ 69
+
70
-
+
71
-
+ @Override
72
-
- 73
-
- 74
-
+ public void warning(SAXParseException ex) throws SAXException {
+ 73 0 LOGGER.log(Level.FINE, null , ex);
+ 74 0 }
75
-
- 76
-
- 77
- @Override
- 78
- public void error(SAXParseException ex) throws SAXException {
- 79 0 throw new SAXException(getPrettyParseExceptionInfo(ex));
- 80
- }
- 81
- 82
+ 76
- 83
-
- 84
+ 77
+
+ 78
- 85
-
- 86
-
- 87
+ 79
+
+ 80
+
+ 81
- 88
+ 82
@Override
- 89
- public void fatalError(SAXParseException ex) throws SAXException {
- 90 0 throw new SAXException(getPrettyParseExceptionInfo(ex));
- 91
+ 83
+ public void error(SAXParseException ex) throws SAXException {
+ 84 0 throw new SAXException(getPrettyParseExceptionInfo(ex));
+ 85
}
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
92
+
+ 93
+ @Override
+ 94
+ public void fatalError(SAXParseException ex) throws SAXException {
+ 95 0 throw new SAXException(getPrettyParseExceptionInfo(ex));
+ 96
+ }
+ 97
}
-
+
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 9d01a85cc..982216826 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
@@ -12,7 +12,7 @@
@@ -77,7 +77,7 @@
30
- 31 0 public class SuppressionHandler extends DefaultHandler {
+ 31 4 public class SuppressionHandler extends DefaultHandler {
32
33
@@ -142,7 +142,7 @@
63
- 64 0 private List<SuppressionRule> suppressionRules = new ArrayList<SuppressionRule>();
+ 64 4 private List<SuppressionRule> suppressionRules = new ArrayList<SuppressionRule>();
65
66
@@ -209,17 +209,17 @@
@Override
97
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- 98 0 currentAttributes = null ;
- 99 0 currentText = new StringBuffer();
+ 98 80 currentAttributes = null ;
+ 99 80 currentText = new StringBuffer();
100
- 101 0 if (SUPPRESS.equals(qName)) {
- 102 0 rule = new SuppressionRule();
- 103 0 } else if (FILE_PATH.equals(qName)) {
- 104 0 currentAttributes = attributes;
+ 101 80 if (SUPPRESS.equals(qName)) {
+ 102 20 rule = new SuppressionRule();
+ 103 60 } else if (FILE_PATH.equals(qName)) {
+ 104 12 currentAttributes = attributes;
105
}
- 106 0 }
+ 106 80 }
107
108
@@ -242,27 +242,27 @@
@Override
117
public void endElement(String uri, String localName, String qName) throws SAXException {
- 118 0 if (SUPPRESS.equals(qName)) {
- 119 0 suppressionRules.add(rule);
- 120 0 rule = null ;
- 121 0 } else if (FILE_PATH.equals(qName)) {
- 122 0 final PropertyType pt = processPropertyType();
- 123 0 rule.setFilePath(pt);
- 124 0 } else if (SHA1.equals(qName)) {
- 125 0 rule.setSha1(currentText.toString());
- 126 0 } else if (CPE.equals(qName)) {
- 127 0 final PropertyType pt = processPropertyType();
- 128 0 rule.addCpe(pt);
- 129 0 } else if (CWE.equals(qName)) {
+ 118 80 if (SUPPRESS.equals(qName)) {
+ 119 20 suppressionRules.add(rule);
+ 120 20 rule = null ;
+ 121 60 } else if (FILE_PATH.equals(qName)) {
+ 122 12 final PropertyType pt = processPropertyType();
+ 123 12 rule.setFilePath(pt);
+ 124 12 } else if (SHA1.equals(qName)) {
+ 125 4 rule.setSha1(currentText.toString());
+ 126 44 } else if (CPE.equals(qName)) {
+ 127 8 final PropertyType pt = processPropertyType();
+ 128 8 rule.addCpe(pt);
+ 129 8 } else if (CWE.equals(qName)) {
130 0 rule.addCwe(currentText.toString());
- 131 0 } else if (CVE.equals(qName)) {
- 132 0 rule.addCve(currentText.toString());
- 133 0 } else if (CVSS_BELOW.equals(qName)) {
- 134 0 final float cvss = Float.parseFloat(currentText.toString());
- 135 0 rule.addCvssBelow(cvss);
+ 131 36 } else if (CVE.equals(qName)) {
+ 132 8 rule.addCve(currentText.toString());
+ 133 28 } else if (CVSS_BELOW.equals(qName)) {
+ 134 4 final float cvss = Float.parseFloat(currentText.toString());
+ 135 4 rule.addCvssBelow(cvss);
136
}
- 137 0 }
+ 137 80 }
138
139
@@ -285,8 +285,8 @@
@Override
148
public void characters(char [] ch, int start, int length) throws SAXException {
- 149 0 currentText.append(ch, start, length);
- 150 0 }
+ 149 176 currentText.append(ch, start, length);
+ 150 176 }
151
152
@@ -303,28 +303,28 @@
158
private PropertyType processPropertyType() {
- 159 0 final PropertyType pt = new PropertyType();
- 160 0 pt.setValue(currentText.toString());
- 161 0 if (currentAttributes != null && currentAttributes.getLength() > 0) {
- 162 0 final String regex = currentAttributes.getValue("regex" );
- 163 0 if (regex != null ) {
- 164 0 pt.setRegex(Boolean.parseBoolean(regex));
+ 159 20 final PropertyType pt = new PropertyType();
+ 160 20 pt.setValue(currentText.toString());
+ 161 20 if (currentAttributes != null && currentAttributes.getLength() > 0) {
+ 162 12 final String regex = currentAttributes.getValue("regex" );
+ 163 12 if (regex != null ) {
+ 164 12 pt.setRegex(Boolean.parseBoolean(regex));
165
}
- 166 0 final String caseSensitive = currentAttributes.getValue("caseSensitive" );
- 167 0 if (regex != null ) {
- 168 0 pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive));
+ 166 12 final String caseSensitive = currentAttributes.getValue("caseSensitive" );
+ 167 12 if (caseSensitive != null ) {
+ 168 12 pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive));
169
}
170
}
- 171 0 return pt;
+ 171 20 return pt;
172
}
173
}
-
+
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 cf71e72b8..f79040358 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
@@ -155,6 +155,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 6403e6f60..96e709abf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
@@ -12,7 +12,7 @@
@@ -106,93 +106,100 @@
44
45
-
+
46
- 47
- public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage" ;
+ 47 1 private static final Logger LOGGER = Logger.getLogger(SuppressionParser.class .getName());
48
49
-
+
50
51
- public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema" ;
+ public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage" ;
52
53
-
+
54
55
- public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource" ;
+ public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema" ;
56
-
- 57
+ 57
+
58
-
- 59
-
- 60
-
- 61
-
- 62
-
- 63
+ 59
+ public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource" ;
+ 60
+
+ 61
+
+ 62
+
+ 63
+
64
- public List<SuppressionRule> parseSuppressionRules(File file) throws SuppressionParseException {
+
65
- try {
- 66 0 final InputStream schemaStream = this .getClass().getClassLoader().getResourceAsStream("schema/suppression.xsd" );
- 67 0 final SuppressionHandler handler = new SuppressionHandler();
+
+ 66
+
+ 67
+
68
+ public List<SuppressionRule> parseSuppressionRules(File file) throws SuppressionParseException {
+ 69
+ try {
+ 70 3 final InputStream schemaStream = this .getClass().getClassLoader().getResourceAsStream("schema/suppression.xsd" );
+ 71 3 final SuppressionHandler handler = new SuppressionHandler();
+ 72
- 69 0 final SAXParserFactory factory = SAXParserFactory.newInstance();
- 70 0 factory.setNamespaceAware(true );
- 71 0 factory.setValidating(true );
- 72 0 final SAXParser saxParser = factory.newSAXParser();
- 73 0 saxParser.setProperty(SuppressionParser.JAXP_SCHEMA_LANGUAGE, SuppressionParser.W3C_XML_SCHEMA);
- 74 0 saxParser.setProperty(SuppressionParser.JAXP_SCHEMA_SOURCE, new InputSource(schemaStream));
- 75 0 final XMLReader xmlReader = saxParser.getXMLReader();
- 76 0 xmlReader.setErrorHandler(new SuppressionErrorHandler());
- 77 0 xmlReader.setContentHandler(handler);
- 78
-
- 79 0 final InputStream inputStream = new FileInputStream(file);
- 80 0 final Reader reader = new InputStreamReader(inputStream, "UTF-8" );
- 81 0 final InputSource in = new InputSource(reader);
+ 73 3 final SAXParserFactory factory = SAXParserFactory.newInstance();
+ 74 3 factory.setNamespaceAware(true );
+ 75 3 factory.setValidating(true );
+ 76 3 final SAXParser saxParser = factory.newSAXParser();
+ 77 3 saxParser.setProperty(SuppressionParser.JAXP_SCHEMA_LANGUAGE, SuppressionParser.W3C_XML_SCHEMA);
+ 78 3 saxParser.setProperty(SuppressionParser.JAXP_SCHEMA_SOURCE, new InputSource(schemaStream));
+ 79 3 final XMLReader xmlReader = saxParser.getXMLReader();
+ 80 3 xmlReader.setErrorHandler(new SuppressionErrorHandler());
+ 81 3 xmlReader.setContentHandler(handler);
82
+
+ 83 3 final InputStream inputStream = new FileInputStream(file);
+ 84 3 final Reader reader = new InputStreamReader(inputStream, "UTF-8" );
+ 85 3 final InputSource in = new InputSource(reader);
+ 86
- 83
+ 87
- 84 0 xmlReader.parse(in);
- 85
+ 88 3 xmlReader.parse(in);
+ 89
- 86 0 return handler.getSuppressionRules();
- 87 0 } catch (ParserConfigurationException ex) {
- 88 0 Logger.getLogger(SuppressionParser.class .getName()).log(Level.FINE, null , ex);
- 89 0 throw new SuppressionParseException(ex);
- 90 0 } catch (SAXException ex) {
- 91 0 Logger.getLogger(SuppressionParser.class .getName()).log(Level.FINE, null , ex);
- 92 0 throw new SuppressionParseException(ex);
- 93 0 } catch (FileNotFoundException ex) {
- 94 0 Logger.getLogger(SuppressionParser.class .getName()).log(Level.FINE, null , ex);
- 95 0 throw new SuppressionParseException(ex);
- 96 0 } catch (IOException ex) {
- 97 0 Logger.getLogger(SuppressionParser.class .getName()).log(Level.FINE, null , ex);
- 98 0 throw new SuppressionParseException(ex);
- 99
+ 90 3 return handler.getSuppressionRules();
+ 91 0 } catch (ParserConfigurationException ex) {
+ 92 0 LOGGER.log(Level.FINE, null , ex);
+ 93 0 throw new SuppressionParseException(ex);
+ 94 0 } catch (SAXException ex) {
+ 95 0 LOGGER.log(Level.FINE, null , ex);
+ 96 0 throw new SuppressionParseException(ex);
+ 97 0 } catch (FileNotFoundException ex) {
+ 98 0 LOGGER.log(Level.FINE, null , ex);
+ 99 0 throw new SuppressionParseException(ex);
+ 100 0 } catch (IOException ex) {
+ 101 0 LOGGER.log(Level.FINE, null , ex);
+ 102 0 throw new SuppressionParseException(ex);
+ 103
}
- 100
+ 104
}
- 101
+ 105
}
-
+
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 4f252c418..8bd249aa2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
@@ -12,7 +12,7 @@
@@ -77,7 +77,7 @@
30
- 31 0 public class SuppressionRule {
+ 31 33 public class SuppressionRule {
32
33
@@ -174,7 +174,7 @@
79
- 80 0 private List<PropertyType> cpe = new ArrayList<PropertyType>();
+ 80 33 private List<PropertyType> cpe = new ArrayList<PropertyType>();
81
82
@@ -225,8 +225,8 @@
105
public void addCpe(PropertyType cpe) {
- 106 0 this .cpe.add(cpe);
- 107 0 }
+ 106 12 this .cpe.add(cpe);
+ 107 12 }
108
109
@@ -241,7 +241,7 @@
114
public boolean hasCpe() {
- 115 0 return cpe.size() > 0;
+ 115 10 return cpe.size() > 0;
116
}
117
@@ -250,7 +250,7 @@
119
- 120 0 private List<Float> cvssBelow = new ArrayList<Float>();
+ 120 33 private List<Float> cvssBelow = new ArrayList<Float>();
121
122
@@ -301,8 +301,8 @@
145
public void addCvssBelow(Float cvss) {
- 146 0 this .cvssBelow.add(cvss);
- 147 0 }
+ 146 7 this .cvssBelow.add(cvss);
+ 147 7 }
148
149
@@ -317,7 +317,7 @@
154
public boolean hasCvssBelow() {
- 155 0 return cvssBelow.size() > 0;
+ 155 7 return cvssBelow.size() > 0;
156
}
157
@@ -326,7 +326,7 @@
159
- 160 0 private List<String> cwe = new ArrayList<String>();
+ 160 33 private List<String> cwe = new ArrayList<String>();
161
162
@@ -377,8 +377,8 @@
185
public void addCwe(String cwe) {
- 186 0 this .cwe.add(cwe);
- 187 0 }
+ 186 2 this .cwe.add(cwe);
+ 187 2 }
188
189
@@ -393,7 +393,7 @@
194
public boolean hasCwe() {
- 195 0 return cwe.size() > 0;
+ 195 8 return cwe.size() > 0;
196
}
197
@@ -402,7 +402,7 @@
199
- 200 0 private List<String> cve = new ArrayList<String>();
+ 200 33 private List<String> cve = new ArrayList<String>();
201
202
@@ -453,8 +453,8 @@
225
public void addCve(String cve) {
- 226 0 this .cve.add(cve);
- 227 0 }
+ 226 11 this .cve.add(cve);
+ 227 11 }
228
229
@@ -469,7 +469,7 @@
234
public boolean hasCve() {
- 235 0 return cve.size() > 0;
+ 235 10 return cve.size() > 0;
236
}
237
@@ -488,173 +488,175 @@
244
public void process(Dependency dependency) {
- 245 0 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
+ 245 9 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
246 0 return ;
247
}
- 248 0 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
- 249 0 return ;
+ 248 9 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
+ 249 1 return ;
250
}
- 251 0 if (this .hasCpe()) {
- 252 0 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 253 0 while (itr.hasNext()) {
- 254 0 final Identifier i = itr.next();
- 255 0 for (PropertyType c : this .cpe) {
- 256 0 if (cpeMatches(c, i)) {
- 257 0 itr.remove();
- 258 0 break ;
- 259
+ 251 8 if (this .hasCpe()) {
+ 252 3 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 253 8 while (itr.hasNext()) {
+ 254 5 final Identifier i = itr.next();
+ 255 5 for (PropertyType c : this .cpe) {
+ 256 9 if (cpeMatches(c, i)) {
+ 257 4 dependency.addSuppressedIdentifier(i);
+ 258 4 itr.remove();
+ 259 4 break ;
+ 260
}
- 260 0 }
- 261 0 }
- 262
+ 261 5 }
+ 262 5 }
+ 263
}
- 263 0 if (hasCve() || hasCwe() || hasCvssBelow()) {
- 264 0 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
- 265 0 while (itr.hasNext()) {
- 266 0 boolean remove = false ;
- 267 0 final Vulnerability v = itr.next();
- 268 0 for (String entry : this .cve) {
- 269 0 if (entry.equalsIgnoreCase(v.getName())) {
- 270 0 remove = true ;
- 271 0 break ;
- 272
+ 264 8 if (hasCve() || hasCwe() || hasCvssBelow()) {
+ 265 5 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
+ 266 10 while (itr.hasNext()) {
+ 267 5 boolean remove = false ;
+ 268 5 final Vulnerability v = itr.next();
+ 269 5 for (String entry : this .cve) {
+ 270 3 if (entry.equalsIgnoreCase(v.getName())) {
+ 271 1 remove = true ;
+ 272 1 break ;
+ 273
}
- 273 0 }
- 274 0 if (!remove) {
- 275 0 for (String entry : this .cwe) {
- 276 0 if (v.getCwe() != null ) {
- 277 0 final String toMatch = String.format("CWE-%s " , entry);
- 278 0 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
- 279 0 if (toTest.equals(toMatch)) {
- 280 0 remove = true ;
- 281 0 break ;
- 282
- }
+ 274 2 }
+ 275 5 if (!remove) {
+ 276 4 for (String entry : this .cwe) {
+ 277 1 if (v.getCwe() != null ) {
+ 278 1 final String toMatch = String.format("CWE-%s " , entry);
+ 279 1 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
+ 280 1 if (toTest.equals(toMatch)) {
+ 281 1 remove = true ;
+ 282 1 break ;
283
+ }
+ 284
}
- 284 0 }
- 285
+ 285 0 }
+ 286
}
- 286 0 if (!remove) {
- 287 0 for (float cvss : this .cvssBelow) {
- 288 0 if (v.getCvssScore() < cvss) {
- 289 0 remove = true ;
- 290 0 break ;
- 291
+ 287 5 if (!remove) {
+ 288 3 for (float cvss : this .cvssBelow) {
+ 289 3 if (v.getCvssScore() < cvss) {
+ 290 1 remove = true ;
+ 291 1 break ;
+ 292
}
- 292 0 }
- 293
+ 293 2 }
+ 294
}
- 294 0 if (remove) {
- 295 0 itr.remove();
- 296
- }
- 297 0 }
+ 295 5 if (remove) {
+ 296 3 dependency.addSuppressedVulnerability(v);
+ 297 3 itr.remove();
298
- }
- 299 0 }
+ }
+ 299 5 }
300
-
- 301
-
+ }
+ 301 8 }
302
-
+
303
-
+
304
-
+
305
-
+
306
-
+
307
+
+ 308
+
+ 309
boolean cpeHasNoVersion(PropertyType c) {
- 308 0 if (c.isRegex()) {
- 309 0 return false ;
- 310
+ 310 14 if (c.isRegex()) {
+ 311 2 return false ;
+ 312
}
- 311 0 if (countCharacter(c.getValue(), ':' ) == 3) {
- 312 0 return true ;
- 313
- }
- 314 0 return false ;
+ 313 12 if (countCharacter(c.getValue(), ':' ) == 3) {
+ 314 3 return true ;
315
- }
- 316
-
+ }
+ 316 9 return false ;
317
-
+ }
318
-
- 319
-
- 320
-
- 321
-
- 322
-
- 323
-
- 324
- int countCharacter(String str, char c) {
- 325 0 int count = 0;
- 326 0 int pos = str.indexOf(c) + 1;
- 327 0 while (pos > 0) {
- 328 0 count += 1;
- 329 0 pos = str.indexOf(c, pos) + 1;
- 330
- }
- 331 0 return count;
- 332
- }
- 333
- 334
+ 319
- 335
-
- 336
+ 320
+
+ 321
- 337
-
- 338
-
- 339
-
- 340
+ 322
+
+ 323
+
+ 324
+
+ 325
- 341
- boolean cpeMatches(PropertyType cpeEntry, Identifier identifier) {
- 342 0 if (cpeEntry.matches(identifier.getValue())) {
- 343 0 return true ;
- 344 0 } else if (cpeHasNoVersion(cpeEntry)) {
- 345 0 if (cpeEntry.isCaseSensitive()) {
- 346 0 if (identifier.getValue().startsWith(cpeEntry.getValue())) {
- 347 0 return true ;
- 348
- }
- 349
- } else {
- 350 0 final String id = identifier.getValue().toLowerCase();
- 351 0 final String check = cpeEntry.getValue().toLowerCase();
- 352 0 if (id.startsWith(check)) {
- 353 0 return true ;
- 354
- }
- 355
- }
- 356
+ 326
+ int countCharacter(String str, char c) {
+ 327 15 int count = 0;
+ 328 15 int pos = str.indexOf(c) + 1;
+ 329 66 while (pos > 0) {
+ 330 51 count += 1;
+ 331 51 pos = str.indexOf(c, pos) + 1;
+ 332
}
- 357 0 return false ;
- 358
+ 333 15 return count;
+ 334
}
- 359
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+
+ 343
+ boolean cpeMatches(PropertyType cpeEntry, Identifier identifier) {
+ 344 16 if (cpeEntry.matches(identifier.getValue())) {
+ 345 5 return true ;
+ 346 11 } else if (cpeHasNoVersion(cpeEntry)) {
+ 347 2 if (cpeEntry.isCaseSensitive()) {
+ 348 0 if (identifier.getValue().startsWith(cpeEntry.getValue())) {
+ 349 0 return true ;
+ 350
+ }
+ 351
+ } else {
+ 352 2 final String id = identifier.getValue().toLowerCase();
+ 353 2 final String check = cpeEntry.getValue().toLowerCase();
+ 354 2 if (id.startsWith(check)) {
+ 355 2 return true ;
+ 356
+ }
+ 357
+ }
+ 358
+ }
+ 359 9 return false ;
+ 360
+ }
+ 361
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html
index 4903c8256..e48177e09 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html
@@ -12,7 +12,7 @@
@@ -62,165 +62,172 @@
22
public final class Checksum {
23
-
+
24
25
-
+
26
- 27
- private Checksum() {
+ 27 1 private static final Logger LOGGER = Logger.getLogger(Checksum.class .getName());
28
- }
+
29
-
+
30
-
+
31
-
+ private Checksum() {
32
-
+ }
33
-
+
34
-
+
35
-
+
36
-
+
37
-
+
38
-
+
39
-
+
40
-
+
41
-
+
42
- public static byte [] getChecksum(String algorithm, File file) throws NoSuchAlgorithmException, IOException {
- 43 0 InputStream fis = null ;
- 44 0 byte [] buffer = new byte [1024];
- 45 0 MessageDigest complete = MessageDigest.getInstance(algorithm);
+
+ 43
+
+ 44
+
+ 45
+
46
+ public static byte [] getChecksum(String algorithm, File file) throws NoSuchAlgorithmException, IOException {
+ 47 38 InputStream fis = null ;
+ 48 38 byte [] buffer = new byte [1024];
+ 49 38 MessageDigest complete = MessageDigest.getInstance(algorithm);
+ 50
int numRead;
- 47
+ 51
try {
- 48 0 fis = new FileInputStream(file);
- 49
- do {
- 50 0 numRead = fis.read(buffer);
- 51 0 if (numRead > 0) {
- 52 0 complete.update(buffer, 0, numRead);
+ 52 37 fis = new FileInputStream(file);
53
- }
- 54 0 } while (numRead != -1);
- 55
- } finally {
- 56 0 if (fis != null ) {
+ do {
+ 54 13356 numRead = fis.read(buffer);
+ 55 13356 if (numRead > 0) {
+ 56 13323 complete.update(buffer, 0, numRead);
57
+ }
+ 58 13356 } while (numRead != -1);
+ 59
+ } finally {
+ 60 37 if (fis != null ) {
+ 61
try {
- 58 0 fis.close();
- 59 0 } catch (IOException ex) {
- 60 0 Logger.getLogger(Checksum.class .getName()).log(Level.FINEST, "Error closing file '" + file.getName() + "'." , ex);
- 61 0 }
- 62
- }
- 63
- }
- 64 0 return complete.digest();
- 65
- }
+ 62 33 fis.close();
+ 63 0 } catch (IOException ex) {
+ 64 0 LOGGER.log(Level.FINEST, "Error closing file '" + file.getName() + "'." , ex);
+ 65 37 }
66
-
+ }
67
-
- 68
-
- 69
-
- 70
-
- 71
-
- 72
-
- 73
-
- 74
-
- 75
- public static String getMD5Checksum(File file) throws IOException, NoSuchAlgorithmException {
- 76 0 byte [] b = getChecksum("MD5" , file);
- 77 0 return getHex(b);
- 78
- }
- 79
-
- 80
-
- 81
-
- 82
-
- 83
-
- 84
-
- 85
-
- 86
-
- 87
-
- 88
- public static String getSHA1Checksum(File file) throws IOException, NoSuchAlgorithmException {
- 89 0 byte [] b = getChecksum("SHA1" , file);
- 90 0 return getHex(b);
- 91
- }
- 92
- private static final String HEXES = "0123456789ABCDEF" ;
- 93
-
- 94
-
- 95
-
- 96
-
- 97
-
- 98
-
- 99
-
- 100
-
- 101
-
- 102
-
- 103
- public static String getHex(byte [] raw) {
- 104 0 if (raw == null ) {
- 105 0 return null ;
- 106
}
- 107 0 final StringBuilder hex = new StringBuilder(2 * raw.length);
- 108 0 for (final byte b : raw) {
- 109 0 hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
+ 68 33 return complete.digest();
+ 69
+ }
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+ public static String getMD5Checksum(File file) throws IOException, NoSuchAlgorithmException {
+ 80 19 byte [] b = getChecksum("MD5" , file);
+ 81 16 return getHex(b);
+ 82
+ }
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+ public static String getSHA1Checksum(File file) throws IOException, NoSuchAlgorithmException {
+ 93 16 byte [] b = getChecksum("SHA1" , file);
+ 94 16 return getHex(b);
+ 95
+ }
+ 96
+ private static final String HEXES = "0123456789ABCDEF" ;
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+ public static String getHex(byte [] raw) {
+ 108 33 if (raw == null ) {
+ 109 0 return null ;
110
}
- 111 0 return hex.toString();
- 112
+ 111 33 final StringBuilder hex = new StringBuilder(2 * raw.length);
+ 112 626 for (final byte b : raw) {
+ 113 593 hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
+ 114
+ }
+ 115 33 return hex.toString();
+ 116
}
- 113
+ 117
}
-
+
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 3a1d5d1f1..31ed27467 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
@@ -12,7 +12,7 @@
@@ -68,123 +68,126 @@
25
import java.util.logging.Logger;
26
- import org.owasp.dependencycheck.data.nvdcve.CveDB;
- 27
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
+ 27
+
28
-
- 29
- 30
+ 29
- 31
+ 30
- 32
+ 31
- 33
+ 32
public final class DBUtils {
+ 33
+
34
-
+
35
-
+
36
-
- 37
+ 37 1 private static final Logger LOGGER = Logger.getLogger(DBUtils.class .getName());
38
- private DBUtils() {
+
39
- }
+
40
-
+
41
-
+
42
-
+ private DBUtils() {
43
-
- 44
-
- 45
-
- 46
-
- 47
-
- 48
- public static int getGeneratedKey(PreparedStatement statement) throws DatabaseException {
- 49 0 ResultSet rs = null ;
- 50 0 int id = 0;
- 51
- try {
- 52 0 rs = statement.getGeneratedKeys();
- 53 0 rs.next();
- 54 0 id = rs.getInt(1);
- 55 0 } catch (SQLException ex) {
- 56 0 throw new DatabaseException("Unable to get primary key for inserted row" );
- 57
- } finally {
- 58 0 closeResultSet(rs);
- 59 0 }
- 60 0 return id;
- 61
}
- 62
+ 44
- 63
+ 45
- 64
-
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+ public static int getGeneratedKey(PreparedStatement statement) throws DatabaseException {
+ 53 0 ResultSet rs = null ;
+ 54 0 int id = 0;
+ 55
+ try {
+ 56 0 rs = statement.getGeneratedKeys();
+ 57 0 rs.next();
+ 58 0 id = rs.getInt(1);
+ 59 0 } catch (SQLException ex) {
+ 60 0 throw new DatabaseException("Unable to get primary key for inserted row" );
+ 61
+ } finally {
+ 62 0 closeResultSet(rs);
+ 63 0 }
+ 64 0 return id;
65
-
+ }
66
-
- 67
-
- 68
- public static void closeStatement(Statement statement) {
- 69 0 if (statement != null ) {
- 70
- try {
- 71 0 statement.close();
- 72 0 } catch (SQLException ex) {
- 73 0 Logger.getLogger(CveDB.class
- 74
- .getName()).log(Level.FINEST, statement.toString(), ex);
- 75 0 }
- 76
- }
- 77 0 }
- 78
- 79
+ 67
- 80
-
- 81
+ 68
+
+ 69
- 82
-
- 83
+ 70
+
+ 71
- 84
- public static void closeResultSet(ResultSet rs) {
- 85 0 if (rs != null ) {
- 86
+ 72
+ public static void closeStatement(Statement statement) {
+ 73 20 if (statement != null ) {
+ 74
try {
- 87 0 rs.close();
- 88 0 } catch (SQLException ex) {
- 89 0 Logger.getLogger(CveDB.class
- 90
- .getName()).log(Level.FINEST, rs.toString(), ex);
- 91 0 }
- 92
+ 75 20 statement.close();
+ 76 0 } catch (SQLException ex) {
+ 77 0 LOGGER.log(Level.FINEST, statement.toString(), ex);
+ 78 20 }
+ 79
}
- 93 0 }
+ 80 20 }
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+ public static void closeResultSet(ResultSet rs) {
+ 88 22 if (rs != null ) {
+ 89
+ try {
+ 90 22 rs.close();
+ 91 0 } catch (SQLException ex) {
+ 92 0 LOGGER.log(Level.FINEST, rs.toString(), ex);
+ 93 22 }
94
+ }
+ 95 22 }
+ 96
}
-
+
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 84df40056..fbc605838 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
@@ -12,7 +12,7 @@
@@ -95,7 +95,7 @@
39
- 40 0 public class DependencyVersion implements Iterable, Comparable<DependencyVersion> {
+ 40 14 public class DependencyVersion implements Iterable, Comparable<DependencyVersion> {
41
42
@@ -115,18 +115,18 @@
49
50
-
+
51
52
53
-
+
54
- 55 0 public DependencyVersion(String version) {
- 56 0 parseVersion(version);
- 57 0 }
+ 55 327 public DependencyVersion(String version) {
+ 56 327 parseVersion(version);
+ 57 327 }
58
59
@@ -143,21 +143,21 @@
65
public final void parseVersion(String version) {
- 66 0 versionParts = new ArrayList<String>();
- 67 0 if (version != null ) {
- 68 0 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
- 69 0 final Matcher matcher = rx.matcher(version.toLowerCase());
- 70 0 while (matcher.find()) {
- 71 0 versionParts.add(matcher.group());
+ 66 329 versionParts = new ArrayList<String>();
+ 67 329 if (version != null ) {
+ 68 329 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
+ 69 329 final Matcher matcher = rx.matcher(version.toLowerCase());
+ 70 1377 while (matcher.find()) {
+ 71 1048 versionParts.add(matcher.group());
72
}
- 73 0 if (versionParts.isEmpty()) {
- 74 0 versionParts.add(version);
+ 73 329 if (versionParts.isEmpty()) {
+ 74 6 versionParts.add(version);
75
}
76
}
- 77 0 }
+ 77 329 }
78
79
@@ -216,7 +216,7 @@
106
public Iterator iterator() {
- 107 0 return versionParts.iterator();
+ 107 1 return versionParts.iterator();
108
}
109
@@ -235,7 +235,7 @@
@Override
116
public String toString() {
- 117 0 return StringUtils.join(versionParts.toArray(), "." );
+ 117 40 return StringUtils.join(versionParts.toArray(), "." );
118
}
119
@@ -256,30 +256,30 @@
@Override
127
public boolean equals(Object obj) {
- 128 0 if (obj == null ) {
+ 128 268 if (obj == null ) {
129 0 return false ;
130
}
- 131 0 if (getClass() != obj.getClass()) {
+ 131 268 if (getClass() != obj.getClass()) {
132 0 return false ;
133
}
- 134 0 final DependencyVersion other = (DependencyVersion) obj;
- 135 0 final int max = (this .versionParts.size() < other.versionParts.size())
+ 134 268 final DependencyVersion other = (DependencyVersion) obj;
+ 135 268 final int max = (this .versionParts.size() < other.versionParts.size())
136
? this .versionParts.size() : other.versionParts.size();
137
- 138 0 for (int i = 0; i < max; i++) {
- 139 0 final String thisPart = this .versionParts.get(i);
- 140 0 final String otherPart = other.versionParts.get(i);
- 141 0 if (!thisPart.equals(otherPart)) {
- 142 0 return false ;
+ 138 679 for (int i = 0; i < max; i++) {
+ 139 595 final String thisPart = this .versionParts.get(i);
+ 140 595 final String otherPart = other.versionParts.get(i);
+ 141 595 if (!thisPart.equals(otherPart)) {
+ 142 184 return false ;
143
}
144
}
- 145 0 if (this .versionParts.size() > max) {
+ 145 84 if (this .versionParts.size() > max) {
146 0 for (int i = max; i < this .versionParts.size(); i++) {
147 0 if (!"0" .equals(this .versionParts.get(i))) {
148 0 return false ;
@@ -291,10 +291,10 @@
}
152
- 153 0 if (other.versionParts.size() > max) {
- 154 0 for (int i = max; i < other.versionParts.size(); i++) {
- 155 0 if (!"0" .equals(other.versionParts.get(i))) {
- 156 0 return false ;
+ 153 84 if (other.versionParts.size() > max) {
+ 154 57 for (int i = max; i < other.versionParts.size(); i++) {
+ 155 57 if (!"0" .equals(other.versionParts.get(i))) {
+ 156 57 return false ;
157
}
158
@@ -313,7 +313,7 @@
165
- 166 0 return true ;
+ 166 27 return true ;
167
}
168
@@ -332,9 +332,9 @@
@Override
175
public int hashCode() {
- 176 0 int hash = 5;
- 177 0 hash = 71 * hash + (this .versionParts != null ? this .versionParts.hashCode() : 0);
- 178 0 return hash;
+ 176 1 int hash = 5;
+ 177 1 hash = 71 * hash + (this .versionParts != null ? this .versionParts.hashCode() : 0);
+ 178 1 return hash;
179
}
180
@@ -355,35 +355,35 @@
188
public boolean matchesAtLeastThreeLevels(DependencyVersion version) {
- 189 0 if (version == null ) {
+ 189 228 if (version == null ) {
190 0 return false ;
191
}
192
- 193 0 boolean ret = true ;
- 194 0 int max = (this .versionParts.size() < version.versionParts.size())
+ 193 228 boolean ret = true ;
+ 194 228 int max = (this .versionParts.size() < version.versionParts.size())
195
? this .versionParts.size() : version.versionParts.size();
196
- 197 0 if (max > 3) {
- 198 0 max = 3;
+ 197 228 if (max > 3) {
+ 198 2 max = 3;
199
}
200
- 201 0 for (int i = 0; i < max; i++) {
- 202 0 if (this .versionParts.get(i) == null || !this .versionParts.get(i).equals(version.versionParts.get(i))) {
- 203 0 ret = false ;
- 204 0 break ;
+ 201 563 for (int i = 0; i < max; i++) {
+ 202 505 if (this .versionParts.get(i) == null || !this .versionParts.get(i).equals(version.versionParts.get(i))) {
+ 203 170 ret = false ;
+ 204 170 break ;
205
}
206
}
207
- 208 0 return ret;
+ 208 228 return ret;
209
}
210
@@ -392,36 +392,36 @@
@Override
212
public int compareTo(DependencyVersion version) {
- 213 0 if (version == null ) {
+ 213 19 if (version == null ) {
214 0 return 1;
215
}
- 216 0 final List<String> left = this .getVersionParts();
- 217 0 final List<String> right = version.getVersionParts();
- 218 0 final int max = left.size() < right.size() ? left.size() : right.size();
+ 216 19 final List<String> left = this .getVersionParts();
+ 217 19 final List<String> right = version.getVersionParts();
+ 218 19 final int max = left.size() < right.size() ? left.size() : right.size();
219
- 220 0 for (int i = 0; i < max; i++) {
- 221 0 final String lStr = left.get(i);
- 222 0 final String rStr = right.get(i);
- 223 0 if (lStr.equals(rStr)) {
- 224 0 continue ;
+ 220 45 for (int i = 0; i < max; i++) {
+ 221 38 final String lStr = left.get(i);
+ 222 38 final String rStr = right.get(i);
+ 223 38 if (lStr.equals(rStr)) {
+ 224 26 continue ;
225
}
226
try {
- 227 0 final int l = Integer.parseInt(lStr);
- 228 0 final int r = Integer.parseInt(rStr);
- 229 0 if (l < r) {
- 230 0 return -1;
- 231 0 } else if (l > r) {
- 232 0 return 1;
+ 227 12 final int l = Integer.parseInt(lStr);
+ 228 7 final int r = Integer.parseInt(rStr);
+ 229 7 if (l < r) {
+ 230 5 return -1;
+ 231 2 } else if (l > r) {
+ 232 2 return 1;
233
}
- 234 0 } catch (NumberFormatException ex) {
- 235 0 final int comp = left.get(i).compareTo(right.get(i));
- 236 0 if (comp < 0) {
- 237 0 return -1;
+ 234 5 } catch (NumberFormatException ex) {
+ 235 5 final int comp = left.get(i).compareTo(right.get(i));
+ 236 5 if (comp < 0) {
+ 237 5 return -1;
238 0 } else if (comp > 0) {
239 0 return 1;
240
@@ -429,13 +429,13 @@
241 0 }
242
}
- 243 0 if (left.size() < right.size()) {
- 244 0 return -1;
- 245 0 } else if (left.size() > right.size()) {
- 246 0 return 1;
+ 243 7 if (left.size() < right.size()) {
+ 244 3 return -1;
+ 245 4 } else if (left.size() > right.size()) {
+ 246 3 return 1;
247
} else {
- 248 0 return 0;
+ 248 1 return 0;
249
}
250
@@ -444,6 +444,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 f7fc0472b..09cb8295d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
@@ -12,7 +12,7 @@
@@ -85,7 +85,7 @@
34
- 35 0 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
+ 35 1 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
36
37
@@ -94,7 +94,7 @@
39
- 40 0 private static final Pattern RX_SINGLE_VERSION = Pattern.compile("\\d+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
+ 40 1 private static final Pattern RX_SINGLE_VERSION = Pattern.compile("\\d+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
41
42
@@ -131,56 +131,56 @@
58
public static DependencyVersion parseVersion(String text) {
- 59 0 if (text == null ) {
+ 59 298 if (text == null ) {
60 0 return null ;
61
}
62
- 63 0 if ("-" .equals(text)) {
- 64 0 final DependencyVersion dv = new DependencyVersion();
- 65 0 final ArrayList<String> list = new ArrayList<String>();
- 66 0 list.add(text);
- 67 0 dv.setVersionParts(list);
- 68 0 return dv;
+ 63 298 if ("-" .equals(text)) {
+ 64 1 final DependencyVersion dv = new DependencyVersion();
+ 65 1 final ArrayList<String> list = new ArrayList<String>();
+ 66 1 list.add(text);
+ 67 1 dv.setVersionParts(list);
+ 68 1 return dv;
69
}
- 70 0 String version = null ;
- 71 0 Matcher matcher = RX_VERSION.matcher(text);
- 72 0 if (matcher.find()) {
- 73 0 version = matcher.group();
+ 70 297 String version = null ;
+ 71 297 Matcher matcher = RX_VERSION.matcher(text);
+ 72 297 if (matcher.find()) {
+ 73 293 version = matcher.group();
74
}
75
- 76 0 if (matcher.find()) {
- 77 0 return null ;
+ 76 297 if (matcher.find()) {
+ 77 2 return null ;
78
}
- 79 0 if (version == null ) {
- 80 0 matcher = RX_SINGLE_VERSION.matcher(text);
- 81 0 if (matcher.find()) {
- 82 0 version = matcher.group();
+ 79 295 if (version == null ) {
+ 80 4 matcher = RX_SINGLE_VERSION.matcher(text);
+ 81 4 if (matcher.find()) {
+ 82 2 version = matcher.group();
83
} else {
- 84 0 return null ;
+ 84 2 return null ;
85
}
86
- 87 0 if (matcher.find()) {
- 88 0 return null ;
+ 87 2 if (matcher.find()) {
+ 88 1 return null ;
89
}
90
}
- 91 0 return new DependencyVersion(version);
+ 91 292 return new DependencyVersion(version);
92
}
93
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
index 50238f8ce..f3c2fc99c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Downloader.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Downloader.html
index 2c0ec39e3..986cbb85b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Downloader.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Downloader.html
@@ -12,7 +12,7 @@
@@ -98,229 +98,238 @@
40
41
-
+
42
- 43
- private Downloader() {
+ 43 1 private static final Logger LOGGER = Logger.getLogger(Downloader.class .getName());
44
- }
+
45
-
+
46
-
+
47
-
+
48
-
+ private Downloader() {
49
-
- 50
-
- 51
-
- 52
-
- 53
- public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
- 54 0 fetchFile(url, outputPath, true );
- 55 0 }
- 56
-
- 57
-
- 58
-
- 59
-
- 60
-
- 61
-
- 62
-
- 63
-
- 64
-
- 65
- public static void fetchFile(URL url, File outputPath, boolean useProxy) throws DownloadFailedException {
- 66 0 if ("file" .equalsIgnoreCase(url.getProtocol())) {
- 67
- File file;
- 68
- try {
- 69 0 file = new File(url.toURI());
- 70 0 } catch (URISyntaxException ex) {
- 71 0 final String msg = String.format("Download failed, unable to locate '%s'" , url.toString());
- 72 0 throw new DownloadFailedException(msg);
- 73 0 }
- 74 0 if (file.exists()) {
- 75
- try {
- 76 0 org.apache.commons.io.FileUtils.copyFile(file, outputPath);
- 77 0 } catch (IOException ex) {
- 78 0 final String msg = String.format("Download failed, unable to copy '%s'" , url.toString());
- 79 0 throw new DownloadFailedException(msg);
- 80 0 }
- 81
- } else {
- 82 0 final String msg = String.format("Download failed, file does not exist '%s'" , url.toString());
- 83 0 throw new DownloadFailedException(msg);
- 84
- }
- 85 0 } else {
- 86 0 HttpURLConnection conn = null ;
- 87
- try {
- 88 0 conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
- 89 0 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
- 90 0 conn.connect();
- 91 0 } catch (IOException ex) {
- 92
- try {
- 93 0 if (conn != null ) {
- 94 0 conn.disconnect();
- 95
- }
- 96
- } finally {
- 97 0 conn = null ;
- 98 0 }
- 99 0 throw new DownloadFailedException("Error downloading file." , ex);
- 100 0 }
- 101 0 final String encoding = conn.getContentEncoding();
- 102
-
- 103 0 BufferedOutputStream writer = null ;
- 104 0 InputStream reader = null ;
- 105
- try {
- 106 0 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
- 107 0 reader = new GZIPInputStream(conn.getInputStream());
- 108 0 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
- 109 0 reader = new InflaterInputStream(conn.getInputStream());
- 110
- } else {
- 111 0 reader = conn.getInputStream();
- 112
- }
- 113
-
- 114 0 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
- 115 0 final byte [] buffer = new byte [4096];
- 116
- int bytesRead;
- 117 0 while ((bytesRead = reader.read(buffer)) > 0) {
- 118 0 writer.write(buffer, 0, bytesRead);
- 119
- }
- 120 0 } catch (Throwable ex) {
- 121 0 throw new DownloadFailedException("Error saving downloaded file." , ex);
- 122
- } finally {
- 123 0 if (writer != null ) {
- 124
- try {
- 125 0 writer.close();
- 126 0 } catch (Throwable ex) {
- 127 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
- 128
- "Error closing the writer in Downloader." , ex);
- 129 0 }
- 130
- }
- 131 0 if (reader != null ) {
- 132
- try {
- 133 0 reader.close();
- 134 0 } catch (Throwable ex) {
- 135 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
- 136
- "Error closing the reader in Downloader." , ex);
- 137 0 }
- 138
- }
- 139
- try {
- 140 0 conn.disconnect();
- 141
- } finally {
- 142 0 conn = null ;
- 143 0 }
- 144 0 }
- 145
- }
- 146 0 }
- 147
-
- 148
-
- 149
-
- 150
-
- 151
-
- 152
-
- 153
-
- 154
-
- 155
-
- 156
- public static long getLastModified(URL url) throws DownloadFailedException {
- 157 0 long timestamp = 0;
- 158
-
- 159 0 if ("file" .equalsIgnoreCase(url.getProtocol())) {
- 160
- File lastModifiedFile;
- 161
- try {
- 162 0 lastModifiedFile = new File(url.toURI());
- 163 0 } catch (URISyntaxException ex) {
- 164 0 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
- 165 0 throw new DownloadFailedException(msg);
- 166 0 }
- 167 0 timestamp = lastModifiedFile.lastModified();
- 168 0 } else {
- 169 0 HttpURLConnection conn = null ;
- 170
- try {
- 171 0 conn = URLConnectionFactory.createHttpURLConnection(url);
- 172 0 conn.setRequestMethod("HEAD" );
- 173 0 conn.connect();
- 174 0 timestamp = conn.getLastModified();
- 175 0 } catch (URLConnectionFailureException ex) {
- 176 0 throw new DownloadFailedException("Error creating URL Connection for HTTP HEAD request." , ex);
- 177 0 } catch (IOException ex) {
- 178 0 throw new DownloadFailedException("Error making HTTP HEAD request." , ex);
- 179
- } finally {
- 180 0 if (conn != null ) {
- 181
- try {
- 182 0 conn.disconnect();
- 183
- } finally {
- 184 0 conn = null ;
- 185 0 }
- 186
- }
- 187
- }
- 188
- }
- 189 0 return timestamp;
- 190
}
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+ public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
+ 59 0 fetchFile(url, outputPath, true );
+ 60 0 }
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+ public static void fetchFile(URL url, File outputPath, boolean useProxy) throws DownloadFailedException {
+ 71 2 if ("file" .equalsIgnoreCase(url.getProtocol())) {
+ 72
+ File file;
+ 73
+ try {
+ 74 2 file = new File(url.toURI());
+ 75 0 } catch (URISyntaxException ex) {
+ 76 0 final String msg = String.format("Download failed, unable to locate '%s'" , url.toString());
+ 77 0 throw new DownloadFailedException(msg);
+ 78 2 }
+ 79 2 if (file.exists()) {
+ 80
+ try {
+ 81 2 org.apache.commons.io.FileUtils.copyFile(file, outputPath);
+ 82 0 } catch (IOException ex) {
+ 83 0 final String msg = String.format("Download failed, unable to copy '%s'" , url.toString());
+ 84 0 throw new DownloadFailedException(msg);
+ 85 2 }
+ 86
+ } else {
+ 87 0 final String msg = String.format("Download failed, file does not exist '%s'" , url.toString());
+ 88 0 throw new DownloadFailedException(msg);
+ 89
+ }
+ 90 2 } else {
+ 91 0 HttpURLConnection conn = null ;
+ 92
+ try {
+ 93 0 conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 94 0 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
+ 95 0 conn.connect();
+ 96 0 } catch (IOException ex) {
+ 97
+ try {
+ 98 0 if (conn != null ) {
+ 99 0 conn.disconnect();
+ 100
+ }
+ 101
+ } finally {
+ 102 0 conn = null ;
+ 103 0 }
+ 104 0 throw new DownloadFailedException("Error downloading file." , ex);
+ 105 0 }
+ 106 0 final String encoding = conn.getContentEncoding();
+ 107
+
+ 108 0 BufferedOutputStream writer = null ;
+ 109 0 InputStream reader = null ;
+ 110
+ try {
+ 111 0 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
+ 112 0 reader = new GZIPInputStream(conn.getInputStream());
+ 113 0 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
+ 114 0 reader = new InflaterInputStream(conn.getInputStream());
+ 115
+ } else {
+ 116 0 reader = conn.getInputStream();
+ 117
+ }
+ 118
+
+ 119 0 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
+ 120 0 final byte [] buffer = new byte [4096];
+ 121
+ int bytesRead;
+ 122 0 while ((bytesRead = reader.read(buffer)) > 0) {
+ 123 0 writer.write(buffer, 0, bytesRead);
+ 124
+ }
+ 125 0 } catch (Throwable ex) {
+ 126 0 throw new DownloadFailedException("Error saving downloaded file." , ex);
+ 127
+ } finally {
+ 128 0 if (writer != null ) {
+ 129
+ try {
+ 130 0 writer.close();
+ 131 0 } catch (Throwable ex) {
+ 132 0 LOGGER.log(Level.FINEST,
+ 133
+ "Error closing the writer in Downloader." , ex);
+ 134 0 }
+ 135
+ }
+ 136 0 if (reader != null ) {
+ 137
+ try {
+ 138 0 reader.close();
+ 139 0 } catch (Throwable ex) {
+ 140 0 LOGGER.log(Level.FINEST,
+ 141
+ "Error closing the reader in Downloader." , ex);
+ 142 0 }
+ 143
+ }
+ 144
+ try {
+ 145 0 conn.disconnect();
+ 146
+ } finally {
+ 147 0 conn = null ;
+ 148 0 }
+ 149 0 }
+ 150
+ }
+ 151 2 }
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+ public static long getLastModified(URL url) throws DownloadFailedException {
+ 162 10 long timestamp = 0;
+ 163
+
+ 164 10 if ("file" .equalsIgnoreCase(url.getProtocol())) {
+ 165
+ File lastModifiedFile;
+ 166
+ try {
+ 167 10 lastModifiedFile = new File(url.toURI());
+ 168 0 } catch (URISyntaxException ex) {
+ 169 0 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
+ 170 0 throw new DownloadFailedException(msg);
+ 171 10 }
+ 172 10 timestamp = lastModifiedFile.lastModified();
+ 173 10 } else {
+ 174 0 HttpURLConnection conn = null ;
+ 175
+ try {
+ 176 0 conn = URLConnectionFactory.createHttpURLConnection(url);
+ 177 0 conn.setRequestMethod("HEAD" );
+ 178 0 conn.connect();
+ 179 0 timestamp = conn.getLastModified();
+ 180 0 } catch (URLConnectionFailureException ex) {
+ 181 0 throw new DownloadFailedException("Error creating URL Connection for HTTP HEAD request." , ex);
+ 182 0 } catch (IOException ex) {
+ 183 0 throw new DownloadFailedException("Error making HTTP HEAD request." , ex);
+ 184
+ } finally {
+ 185 0 if (conn != null ) {
+ 186
+ try {
+ 187 0 conn.disconnect();
+ 188
+ } finally {
+ 189 0 conn = null ;
+ 190 0 }
191
+ }
+ 192
+ }
+ 193
+ }
+ 194 10 return timestamp;
+ 195
+ }
+ 196
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
index 6fb0770ca..4ea3e1ec7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
index b6f65b15a..2b0e1990e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
@@ -12,7 +12,7 @@
@@ -104,362 +104,362 @@
43
44
-
+
45
- 46
- private static final String BIT_BUCKET_UNIX = "/dev/null" ;
+ 46 1 private static final Logger LOGGER = Logger.getLogger(FileUtils.class .getName());
47
-
+
48
-
+
49
-
+
50
-
+ private static final String BIT_BUCKET_UNIX = "/dev/null" ;
51
- private static final String BIT_BUCKET_WIN = "NUL" ;
+
52
-
+
53
-
+
54
-
+
55
-
+ private static final String BIT_BUCKET_WIN = "NUL" ;
56
- private static final int BUFFER_SIZE = 4096;
+
57
-
+
58
-
+
59
-
+
60
-
+ private static final int BUFFER_SIZE = 4096;
61
- private FileUtils() {
+
62
- }
+
63
-
+
64
-
+
65
-
+ private FileUtils() {
66
-
+ }
67
-
+
68
-
+
69
-
+
70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
public static String getFileExtension(String fileName) {
- 71 0 String ret = null ;
- 72 0 final int pos = fileName.lastIndexOf("." );
- 73 0 if (pos >= 0) {
- 74 0 ret = fileName.substring(pos + 1, fileName.length()).toLowerCase();
- 75
- }
- 76 0 return ret;
- 77
- }
- 78
-
+ 75 871 String ret = null ;
+ 76 871 final int pos = fileName.lastIndexOf("." );
+ 77 871 if (pos >= 0) {
+ 78 868 ret = fileName.substring(pos + 1, fileName.length()).toLowerCase();
79
-
- 80
-
+ }
+ 80 871 return ret;
81
-
+ }
82
-
+
83
-
+
84
-
+
85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
public static boolean delete(File file) {
- 86 0 boolean success = true ;
- 87 0 if (!org.apache.commons.io.FileUtils.deleteQuietly(file)) {
- 88 0 success = false ;
- 89 0 final String msg = String.format("Failed to delete file: %s; attempting to delete on exit." , file.getPath());
- 90 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINE, msg);
- 91 0 file.deleteOnExit();
- 92
- }
- 93 0 return success;
- 94
- }
- 95
-
+ 90 9 boolean success = true ;
+ 91 9 if (!org.apache.commons.io.FileUtils.deleteQuietly(file)) {
+ 92 0 success = false ;
+ 93 0 final String msg = String.format("Failed to delete file: %s; attempting to delete on exit." , file.getPath());
+ 94 0 LOGGER.log(Level.FINE, msg);
+ 95 0 file.deleteOnExit();
96
-
- 97
-
+ }
+ 97 9 return success;
98
-
+ }
99
-
+
100
-
+
101
-
+
102
-
+
103
-
+
104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
public static File getTempFile(String prefix, String extension) throws IOException {
- 105 0 final File dir = Settings.getTempDirectory();
- 106 0 if (!dir.exists()) {
- 107 0 if (!dir.mkdirs()) {
- 108 0 throw new IOException("Unable to create temporary folder" );
- 109
- }
- 110
+ 109 2 final File dir = Settings.getTempDirectory();
+ 110 2 final String tempFileName = String.format("%s%s.%s" , prefix, UUID.randomUUID().toString(), extension);
+ 111 2 final File tempFile = new File(dir, tempFileName);
+ 112 2 if (tempFile.exists()) {
+ 113 0 return getTempFile(prefix, extension);
+ 114
}
- 111 0 final String tempFileName = String.format("%s%s.%s" , prefix, UUID.randomUUID().toString(), extension);
- 112 0 final File tempFile = new File(dir, tempFileName);
- 113 0 if (tempFile.exists()) {
- 114 0 return getTempFile(prefix, extension);
- 115
- }
- 116 0 return tempFile;
+ 115 2 return tempFile;
+ 116
+ }
117
- }
+
118
-
+
119
-
- 120
- 121
+ 120
- 122
+ 121
+ 122
+
123
-
- 124
- 125
+ 124
- 126
+ 125
- 127
+ 126
- 128
+ 127
- 129
+ 128
+ 129
+
130
-
+ @java.lang.Deprecated
131
- @java.lang.Deprecated
- 132
public static File getDataDirectory(String configuredFilePath, Class clazz) throws IOException {
- 133 0 final File file = new File(configuredFilePath);
- 134 0 if (file.isDirectory() && file.canWrite()) {
- 135 0 return new File(file.getCanonicalPath());
- 136
+ 132 0 final File file = new File(configuredFilePath);
+ 133 0 if (file.isDirectory() && file.canWrite()) {
+ 134 0 return new File(file.getCanonicalPath());
+ 135
} else {
- 137 0 final File exePath = getPathToJar(clazz);
- 138 0 return new File(exePath, configuredFilePath);
+ 136 0 final File exePath = getPathToJar(clazz);
+ 137 0 return new File(exePath, configuredFilePath);
+ 138
+ }
139
- }
+ }
140
- }
+
141
-
+
142
-
- 143
- 144
+ 143
+ 144
+
145
-
- 146
- 147
+ 146
- 148
+ 147
- 149
+ 148
+ 149
+
150
-
- 151
@java.lang.Deprecated
- 152
+ 151
public static File getPathToJar(Class clazz) throws UnsupportedEncodingException {
- 153 0 final String filePath = clazz.getProtectionDomain().getCodeSource().getLocation().getPath();
- 154 0 final String decodedPath = URLDecoder.decode(filePath, "UTF-8" );
- 155 0 final File jarPath = new File(decodedPath);
- 156 0 return jarPath.getParentFile();
+ 152 0 final String filePath = clazz.getProtectionDomain().getCodeSource().getLocation().getPath();
+ 153 0 final String decodedPath = URLDecoder.decode(filePath, "UTF-8" );
+ 154 0 final File jarPath = new File(decodedPath);
+ 155 0 return jarPath.getParentFile();
+ 156
+ }
157
- }
+
158
-
+
159
-
- 160
+ 160
+
161
-
+
162
-
+
163
-
- 164
+ 164
+
165
-
- 166
public static void extractFiles(File archive, File extractTo) throws ExtractionException {
- 167 0 extractFiles(archive, extractTo, null );
- 168 0 }
+ 166 0 extractFiles(archive, extractTo, null );
+ 167 0 }
+ 168
+
169
-
+
170
-
- 171
- 172
+ 171
- 173
+ 172
+ 173
+
174
-
- 175
- 176
+ 175
- 177
+ 176
- 178
+ 177
+ 178
+
179
-
- 180
public static void extractFiles(File archive, File extractTo, Engine engine) throws ExtractionException {
- 181 0 if (archive == null || extractTo == null ) {
- 182 0 return ;
+ 180 0 if (archive == null || extractTo == null ) {
+ 181 0 return ;
+ 182
+ }
183
- }
- 184
- 185 0 FileInputStream fis = null ;
- 186 0 ZipInputStream zis = null ;
+ 184 0 FileInputStream fis = null ;
+ 185 0 ZipInputStream zis = null ;
+ 186
+
187
-
- 188
try {
- 189 0 fis = new FileInputStream(archive);
- 190 0 } catch (FileNotFoundException ex) {
- 191 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINE, null , ex);
- 192 0 throw new ExtractionException("Archive file was not found." , ex);
- 193 0 }
- 194 0 zis = new ZipInputStream(new BufferedInputStream(fis));
- 195
+ 188 0 fis = new FileInputStream(archive);
+ 189 0 } catch (FileNotFoundException ex) {
+ 190 0 LOGGER.log(Level.FINE, null , ex);
+ 191 0 throw new ExtractionException("Archive file was not found." , ex);
+ 192 0 }
+ 193 0 zis = new ZipInputStream(new BufferedInputStream(fis));
+ 194
ZipEntry entry;
- 196
+ 195
try {
- 197 0 while ((entry = zis.getNextEntry()) != null ) {
- 198 0 if (entry.isDirectory()) {
- 199 0 final File d = new File(extractTo, entry.getName());
- 200 0 if (!d.exists() && !d.mkdirs()) {
- 201 0 final String msg = String.format("Unable to create '%s'." , d.getAbsolutePath());
- 202 0 throw new ExtractionException(msg);
- 203
+ 196 0 while ((entry = zis.getNextEntry()) != null ) {
+ 197 0 if (entry.isDirectory()) {
+ 198 0 final File d = new File(extractTo, entry.getName());
+ 199 0 if (!d.exists() && !d.mkdirs()) {
+ 200 0 final String msg = String.format("Unable to create '%s'." , d.getAbsolutePath());
+ 201 0 throw new ExtractionException(msg);
+ 202
}
- 204 0 } else {
- 205 0 final File file = new File(extractTo, entry.getName());
- 206 0 final String ext = getFileExtension(file.getName());
- 207 0 if (engine == null || engine.supportsExtension(ext)) {
- 208 0 BufferedOutputStream bos = null ;
- 209
+ 203 0 } else {
+ 204 0 final File file = new File(extractTo, entry.getName());
+ 205 0 final String ext = getFileExtension(file.getName());
+ 206 0 if (engine == null || engine.supportsExtension(ext)) {
+ 207 0 BufferedOutputStream bos = null ;
+ 208
FileOutputStream fos;
- 210
+ 209
try {
- 211 0 fos = new FileOutputStream(file);
- 212 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
- 213
+ 210 0 fos = new FileOutputStream(file);
+ 211 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 212
int count;
- 214 0 final byte data[] = new byte [BUFFER_SIZE];
- 215 0 while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
- 216 0 bos.write(data, 0, count);
- 217
+ 213 0 final byte data[] = new byte [BUFFER_SIZE];
+ 214 0 while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
+ 215 0 bos.write(data, 0, count);
+ 216
}
- 218 0 bos.flush();
- 219 0 } catch (FileNotFoundException ex) {
- 220 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINE, null , ex);
- 221 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
- 222 0 throw new ExtractionException(msg, ex);
- 223 0 } catch (IOException ex) {
- 224 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINE, null , ex);
- 225 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
- 226 0 throw new ExtractionException(msg, ex);
- 227
+ 217 0 bos.flush();
+ 218 0 } catch (FileNotFoundException ex) {
+ 219 0 LOGGER.log(Level.FINE, null , ex);
+ 220 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
+ 221 0 throw new ExtractionException(msg, ex);
+ 222 0 } catch (IOException ex) {
+ 223 0 LOGGER.log(Level.FINE, null , ex);
+ 224 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+ 225 0 throw new ExtractionException(msg, ex);
+ 226
} finally {
- 228 0 if (bos != null ) {
- 229
+ 227 0 if (bos != null ) {
+ 228
try {
- 230 0 bos.close();
- 231 0 } catch (IOException ex) {
- 232 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINEST, null , ex);
- 233 0 }
- 234
+ 229 0 bos.close();
+ 230 0 } catch (IOException ex) {
+ 231 0 LOGGER.log(Level.FINEST, null , ex);
+ 232 0 }
+ 233
}
- 235
+ 234
}
- 236
+ 235
}
- 237 0 }
- 238
+ 236 0 }
+ 237
}
- 239 0 } catch (IOException ex) {
- 240 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
- 241 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINE, msg, ex);
- 242 0 throw new ExtractionException(msg, ex);
- 243
+ 238 0 } catch (IOException ex) {
+ 239 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+ 240 0 LOGGER.log(Level.FINE, msg, ex);
+ 241 0 throw new ExtractionException(msg, ex);
+ 242
} finally {
- 244 0 try {
- 245 0 zis.close();
- 246 0 } catch (IOException ex) {
- 247 0 Logger.getLogger(FileUtils.class .getName()).log(Level.FINEST, null , ex);
- 248 0 }
- 249 0 }
- 250 0 }
- 251
+ 243 0 try {
+ 244 0 zis.close();
+ 245 0 } catch (IOException ex) {
+ 246 0 LOGGER.log(Level.FINEST, null , ex);
+ 247 0 }
+ 248 0 }
+ 249 0 }
+ 250
- 252
+ 251
- 253
+ 252
- 254
+ 253
- 255
+ 254
- 256
+ 255
- 257
+ 256
public static String getBitBucket() {
- 258 0 if (System.getProperty("os.name" ).startsWith("Windows" )) {
- 259 0 return BIT_BUCKET_WIN;
- 260
+ 257 0 if (System.getProperty("os.name" ).startsWith("Windows" )) {
+ 258 0 return BIT_BUCKET_WIN;
+ 259
} else {
- 261 0 return BIT_BUCKET_UNIX;
- 262
+ 260 0 return BIT_BUCKET_UNIX;
+ 261
}
- 263
+ 262
}
- 264
+ 263
}
-
+
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 a0117cc18..fa98aba78 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
@@ -12,9 +12,9 @@
@@ -57,19 +57,19 @@
19
public Iterator<T> filter(Iterator<T> iterator) {
- 20 0 return new FilterIterator(iterator);
+ 20 157 return new FilterIterator(iterator);
21
}
22
23
public Iterable<T> filter(final Iterable<T> iterable) {
- 24 0 return new Iterable<T>() {
+ 24 157 return new Iterable<T>() {
25
26
public Iterator<T> iterator() {
- 27 0 return filter(iterable.iterator());
+ 27 157 return filter(iterable.iterator());
28
}
29
@@ -78,7 +78,7 @@
}
31
- 32 0 private class FilterIterator implements Iterator<T> {
+ 32 157 private class FilterIterator implements Iterator<T> {
33
34
@@ -87,28 +87,28 @@
private T next;
36
- 37 0 private FilterIterator(Iterator<T> iterator) {
- 38 0 this .iterator = iterator;
- 39 0 toNext();
- 40 0 }
+ 37 157 private FilterIterator(Iterator<T> iterator) {
+ 38 157 this .iterator = iterator;
+ 39 157 toNext();
+ 40 157 }
41
42
public boolean hasNext() {
- 43 0 return next != null ;
+ 43 962 return next != null ;
44
}
45
46
public T next() {
- 47 0 if (next == null ) {
+ 47 849 if (next == null ) {
48 0 throw new NoSuchElementException();
49
}
- 50 0 T returnValue = next;
- 51 0 toNext();
- 52 0 return returnValue;
+ 50 849 T returnValue = next;
+ 51 849 toNext();
+ 52 849 return returnValue;
53
}
54
@@ -122,22 +122,22 @@
59
private void toNext() {
- 60 0 next = null ;
- 61 0 while (iterator.hasNext()) {
- 62 0 T item = iterator.next();
- 63 0 if (item != null && passes(item)) {
- 64 0 next = item;
- 65 0 break ;
+ 60 1006 next = null ;
+ 61 1444 while (iterator.hasNext()) {
+ 62 1329 T item = iterator.next();
+ 63 1329 if (item != null && passes(item)) {
+ 64 891 next = item;
+ 65 891 break ;
66
}
- 67 0 }
- 68 0 }
+ 67 438 }
+ 68 1006 }
69
}
70
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
index 0a9db20a7..5ac300a77 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
index 17f4bc160..e35708ea8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
@@ -101,6 +101,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
index 9bf5e3492..7744a350f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
@@ -12,7 +12,7 @@
@@ -88,90 +88,99 @@
35
36
-
+
37
- 38
- private LogUtils() {
+ 38 1 private static final Logger LOGGER = Logger.getLogger(LogUtils.class .getName());
39
- }
+
40
-
+
41
-
+
42
-
+
43
-
+ private LogUtils() {
44
-
+ }
45
-
- 46
-
- 47
- public static void prepareLogger(InputStream in, String verboseLogFile) {
- 48
- try {
- 49 0 LogManager.getLogManager().reset();
- 50 0 LogManager.getLogManager().readConfiguration(in);
- 51 0 if (verboseLogFile != null && !verboseLogFile.isEmpty()) {
- 52 0 verboseLoggingEnabled = true ;
- 53 0 final Logger logger = Logger.getLogger("" );
- 54 0 final FileHandler handler = new FileHandler(verboseLogFile, true );
- 55 0 handler.setFormatter(new SimpleFormatter());
- 56 0 handler.setLevel(Level.FINE);
- 57 0 handler.setFilter(new LogFilter());
- 58 0 logger.addHandler(handler);
- 59 0 logger.setLevel(Level.FINE);
- 60
- }
- 61 0 } catch (IOException ex) {
- 62 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "IO Error preparing the logger" , ex);
- 63 0 } catch (SecurityException ex) {
- 64 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "Error preparing the logger" , ex);
- 65
- } finally {
- 66 0 if (in != null ) {
- 67
- try {
- 68 0 in.close();
- 69 0 } catch (Throwable ex) {
- 70 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINEST, "Error closing resource stream" , ex);
- 71 0 }
- 72
- }
- 73
- }
- 74 0 }
- 75
-
- 76
-
- 77
-
- 78 0 private static boolean verboseLoggingEnabled = false ;
- 79
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+ public static void prepareLogger(InputStream in, String verboseLogFile) {
+ 53
+ try {
+ 54 0 LogManager.getLogManager().reset();
+ 55 0 LogManager.getLogManager().readConfiguration(in);
+ 56 0 if (verboseLogFile != null && !verboseLogFile.isEmpty()) {
+ 57 0 verboseLoggingEnabled = true ;
+ 58 0 final Logger logger = Logger.getLogger("" );
+ 59 0 final FileHandler handler = new FileHandler(verboseLogFile, true );
+ 60 0 handler.setFormatter(new SimpleFormatter());
+ 61 0 handler.setLevel(Level.FINE);
+ 62 0 handler.setFilter(new LogFilter());
+ 63 0 logger.addHandler(handler);
+ 64 0 logger.setLevel(Level.FINE);
+ 65
+ }
+ 66 0 } catch (IOException ex) {
+ 67 0 LOGGER.log(Level.FINE, "IO Error preparing the logger" , ex);
+ 68 0 } catch (SecurityException ex) {
+ 69 0 LOGGER.log(Level.FINE, "Error preparing the logger" , ex);
+ 70
+ } finally {
+ 71 0 if (in != null ) {
+ 72
+ try {
+ 73 0 in.close();
+ 74 0 } catch (Throwable ex) {
+ 75 0 LOGGER.log(Level.FINEST, "Error closing resource stream" , ex);
+ 76 0 }
+ 77
+ }
+ 78
+ }
+ 79 0 }
80
81
-
+
82
-
- 83
-
- 84
+ 83 1 private static boolean verboseLoggingEnabled = false ;
+ 84
+
85
- public static boolean isVerboseLoggingEnabled() {
- 86 0 return verboseLoggingEnabled;
+
+ 86
+
87
- }
+
88
+
+ 89
+
+ 90
+ public static boolean isVerboseLoggingEnabled() {
+ 91 3 return verboseLoggingEnabled;
+ 92
+ }
+ 93
}
-
+
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 4548512f3..ed873cb19 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 @@
@@ -107,11 +107,11 @@
public void close() {
45
- 46 0 }
+ 46 1 }
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 dd2a9dfcf..d7288fdce 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
@@ -12,7 +12,7 @@
@@ -211,10 +211,10 @@
@Override
97
public int hashCode() {
- 98 0 int hash = 3;
- 99 0 hash = 53 * hash + (this .left != null ? this .left.hashCode() : 0);
- 100 0 hash = 53 * hash + (this .right != null ? this .right.hashCode() : 0);
- 101 0 return hash;
+ 98 21505 int hash = 3;
+ 99 21505 hash = 53 * hash + (this .left != null ? this .left.hashCode() : 0);
+ 100 21505 hash = 53 * hash + (this .right != null ? this .right.hashCode() : 0);
+ 101 21505 return hash;
102
}
103
@@ -259,6 +259,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html
index c0e31b4fe..09ae83930 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html
@@ -12,8 +12,8 @@
@@ -99,44 +99,45 @@
40
41
-
+
42
-
- 43
-
- 44 0 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
- 45
-
- 46
- 47
+ 43
- 48
+ 44
- 49
+ 45
public static final class KEYS {
- 50
+ 46
- 51
+ 47
- 52
+ 48
- 53
+ 49
- 54
+ 50
private KEYS() {
- 55
+ 51
- 56
+ 52
}
+ 53
+
+ 54
+
+ 55
+
+ 56
+ public static final String AUTO_UPDATE = "autoupdate" ;
57
58
-
+
59
60
- public static final String AUTO_UPDATE = "autoupdate" ;
+ public static final String DB_DRIVER_NAME = "data.driver_name" ;
61
62
@@ -144,880 +145,974 @@
63
64
- public static final String DB_DRIVER_NAME = "data.driver_name" ;
+ public static final String DB_DRIVER_PATH = "data.driver_path" ;
65
66
-
+
67
68
- public static final String DB_DRIVER_PATH = "data.driver_path" ;
+ public static final String DB_CONNECTION_STRING = "data.connection_string" ;
69
70
-
+
71
72
- public static final String DB_CONNECTION_STRING = "data.connection_string" ;
+ public static final String DB_USER = "data.user" ;
73
74
-
+
75
76
- public static final String DB_USER = "data.user" ;
+ public static final String DB_PASSWORD = "data.password" ;
77
78
-
+
79
80
- public static final String DB_PASSWORD = "data.password" ;
+ public static final String DATA_DIRECTORY = "data.directory" ;
81
82
-
+
83
84
- public static final String DATA_DIRECTORY = "data.directory" ;
+ public static final String CVE_META_URL = "cve.url.meta" ;
85
86
-
+
87
-
- 88
- public static final String CVE_META_URL = "cve.url.meta" ;
- 89
-
- 90
-
- 91
- 92
+ 88
- 93
+ 89
public static final String CVE_MODIFIED_20_URL = "cve.url-2.0.modified" ;
- 94
+ 90
- 95
+ 91
- 96
+ 92
+ 93
+
+ 94
+ public static final String CVE_MODIFIED_12_URL = "cve.url-1.2.modified" ;
+ 95
+
+ 96
+
97
98
- public static final String CVE_MODIFIED_12_URL = "cve.url-1.2.modified" ;
+ public static final String CVE_MODIFIED_VALID_FOR_DAYS = "cve.url.modified.validfordays" ;
99
100
-
- 101
-
- 102
- public static final String CVE_MODIFIED_VALID_FOR_DAYS = "cve.url.modified.validfordays" ;
- 103
-
- 104
- 105
+ 101
+ 102
+
+ 103
+ public static final String CVE_START_YEAR = "cve.startyear" ;
+ 104
+
+ 105
+
106
107
- public static final String CVE_START_YEAR = "cve.startyear" ;
+ public static final String CVE_SCHEMA_1_2 = "cve.url-1.2.base" ;
108
109
-
+
110
111
- public static final String CVE_SCHEMA_1_2 = "cve.url-1.2.base" ;
+ public static final String CVE_SCHEMA_2_0 = "cve.url-2.0.base" ;
112
113
-
+
114
115
- public static final String CVE_SCHEMA_2_0 = "cve.url-2.0.base" ;
+ public static final String PROXY_URL = "proxy.url" ;
116
117
-
+
118
119
- public static final String PROXY_URL = "proxy.url" ;
+ public static final String PROXY_PORT = "proxy.port" ;
120
121
-
+
122
123
- public static final String PROXY_PORT = "proxy.port" ;
+ public static final String PROXY_USERNAME = "proxy.username" ;
124
125
-
+
126
127
- public static final String PROXY_USERNAME = "proxy.username" ;
+ public static final String PROXY_PASSWORD = "proxy.password" ;
128
129
-
+
130
131
- public static final String PROXY_PASSWORD = "proxy.password" ;
+ public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
132
133
-
+
134
135
- public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
+ public static final String TEMP_DIRECTORY = "temp.directory" ;
136
137
-
+
138
139
- public static final String TEMP_DIRECTORY = "temp.directory" ;
+ public static final String MAX_DOWNLOAD_THREAD_POOL_SIZE = "max.download.threads" ;
140
141
-
+
142
143
- public static final String MAX_DOWNLOAD_THREAD_POOL_SIZE = "max.download.threads" ;
+ public static final String SUPPRESSION_FILE = "suppression.file" ;
144
145
-
+
146
147
- public static final String SUPPRESSION_FILE = "suppression.file" ;
+ public static final String ANALYZER_JAR_ENABLED = "analyzer.jar.enabled" ;
148
149
-
+
150
151
- public static final String ANALYZER_JAR_ENABLED = "analyzer.jar.enabled" ;
+ public static final String ANALYZER_ARCHIVE_ENABLED = "analyzer.archive.enabled" ;
152
153
-
+
154
155
- public static final String ANALYZER_ARCHIVE_ENABLED = "analyzer.archive.enabled" ;
+ public static final String ANALYZER_ASSEMBLY_ENABLED = "analyzer.assembly.enabled" ;
156
157
-
+
158
159
- public static final String ANALYZER_ASSEMBLY_ENABLED = "analyzer.assembly.enabled" ;
+ public static final String ANALYZER_NUSPEC_ENABLED = "analyzer.nuspec.enabled" ;
160
161
-
+
162
163
- public static final String ANALYZER_NUSPEC_ENABLED = "analyzer.nuspec.enabled" ;
+ public static final String ANALYZER_JAVASCRIPT_ENABLED = "analyzer.javascript.enabled" ;
164
165
-
+
166
167
- public static final String ANALYZER_JAVASCRIPT_ENABLED = "analyzer.javascript.enabled" ;
+ public static final String ANALYZER_NEXUS_ENABLED = "analyzer.nexus.enabled" ;
168
169
-
+
170
171
- public static final String ANALYZER_NEXUS_ENABLED = "analyzer.nexus.enabled" ;
+ public static final String ANALYZER_NEXUS_URL = "analyzer.nexus.url" ;
172
173
-
+
174
175
- public static final String ANALYZER_NEXUS_URL = "analyzer.nexus.url" ;
+ public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy" ;
176
177
-
+
178
179
- public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy" ;
+ public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
180
181
-
+
182
183
- public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
+ public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
184
185
-
+
186
187
- public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
+ public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
188
189
-
+
190
191
- public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
+ public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
192
193
-
+
194
195
- public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
- 196
-
- 197
-
- 198
-
- 199
public static final String SKIP_PROVIDED_SCOPE = "skip.provided.scope" ;
- 200
+ 196
}
+ 197
+
+ 198
+
+ 199
+
+ 200
+
201
-
- 202
-
+
+ 202 1 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
203
-
+
204
- private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+
205
-
+
206
-
+ private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
207
-
- 208 0 private static final Settings INSTANCE = new Settings();
+
+ 208
+
209
-
- 210
-
+
+ 210 1 private static ThreadLocal<Settings> localSettings = new ThreadLocal();
211
-
- 212 0 private Properties props = null ;
+
+ 212
+
213
-
- 214
-
- 215
-
- 216
- 217 0 private Settings() {
- 218 0 InputStream in = null ;
- 219 0 props = new Properties();
- 220
- try {
- 221 0 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
- 222 0 props.load(in);
- 223 0 } catch (IOException ex) {
- 224 0 Logger.getLogger(Settings.class .getName()).log(Level.SEVERE, "Unable to load default settings." );
- 225 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, null , ex);
- 226
- } finally {
- 227 0 if (in != null ) {
- 228
- try {
- 229 0 in.close();
- 230 0 } catch (IOException ex) {
- 231 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
- 232 0 }
- 233
- }
- 234
- }
- 235 0 logProperties("Properties loaded" , props);
- 236 0 }
- 237
+ 214 15 private Properties props = null ;
+ 215
- 238
+ 216
+ 217
+
+ 218
+
+ 219 15 private Settings() {
+ 220 15 InputStream in = null ;
+ 221 15 props = new Properties();
+ 222
+ try {
+ 223 15 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+ 224 15 props.load(in);
+ 225 0 } catch (IOException ex) {
+ 226 0 LOGGER.log(Level.SEVERE, "Unable to load default settings." );
+ 227 0 LOGGER.log(Level.FINE, null , ex);
+ 228
+ } finally {
+ 229 15 if (in != null ) {
+ 230
+ try {
+ 231 15 in.close();
+ 232 0 } catch (IOException ex) {
+ 233 0 LOGGER.log(Level.FINEST, null , ex);
+ 234 15 }
+ 235
+ }
+ 236
+ }
+ 237 15 logProperties("Properties loaded" , props);
+ 238 15 }
239
-
+
240
-
+
241
-
+
242
-
+
243
244
- private static void logProperties(String header, Properties properties) {
- 245 0 if (LOGGER.isLoggable(Level.FINE)) {
- 246 0 final StringWriter sw = new StringWriter();
- 247 0 PrintWriter pw = null ;
+ public static void initialize() {
+ 245 15 localSettings.set(new Settings());
+ 246 15 }
+ 247
+
248
- try {
- 249 0 pw = new PrintWriter(sw);
- 250 0 pw.format("%s:%n%n" , header);
- 251 0 final Enumeration e = properties.propertyNames();
- 252 0 while (e.hasMoreElements()) {
- 253 0 final String key = (String) e.nextElement();
- 254 0 if (key.contains("password" )) {
- 255 0 pw.format("%s='*****'%n" , key);
- 256
- } else {
- 257 0 final String value = properties.getProperty(key);
- 258 0 if (value != null ) {
- 259 0 pw.format("%s='%s'%n" , key, value);
- 260
- }
+
+ 249
+
+ 250
+
+ 251
+ public static void cleanup() {
+ 252 15 if (tempDirectory != null && tempDirectory.exists()) {
+ 253 4 FileUtils.delete(tempDirectory);
+ 254
+ }
+ 255
+ try {
+ 256 15 localSettings.remove();
+ 257 0 } catch (Throwable ex) {
+ 258 0 LOGGER.log(Level.FINE, "Error cleaning up Settings" , ex);
+ 259 15 }
+ 260 15 }
261
- }
- 262 0 }
- 263 0 pw.flush();
- 264 0 LOGGER.fine(sw.toString());
+
+ 262
+
+ 263
+
+ 264
+
265
- } finally {
- 266 0 if (pw != null ) {
- 267 0 pw.close();
- 268
- }
+
+ 266
+
+ 267
+ public static Settings getInstance() {
+ 268 0 return localSettings.get();
269
- }
+ }
270
271
- }
- 272 0 }
+
+ 272
+
273
-
+
274
-
+
275
-
+
276
-
- 277
-
- 278
-
+ public static void setInstance(Settings instance) {
+ 277 0 localSettings.set(instance);
+ 278 0 }
279
-
+
280
- public static void setString(String key, String value) {
- 281 0 INSTANCE.props.setProperty(key, value);
- 282 0 if (LOGGER.isLoggable(Level.FINE)) {
- 283 0 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
+
+ 281
+
+ 282
+
+ 283
+
284
- }
- 285 0 }
+
+ 285
+
286
-
- 287
-
- 288
-
- 289
-
+ private static void logProperties(String header, Properties properties) {
+ 287 16 if (LOGGER.isLoggable(Level.FINE)) {
+ 288 0 final StringWriter sw = new StringWriter();
+ 289 0 PrintWriter pw = null ;
290
-
- 291
-
- 292
-
- 293
- public static void setBoolean(String key, boolean value) {
- 294 0 if (value) {
- 295 0 INSTANCE.props.setProperty(key, Boolean.TRUE.toString());
- 296
- } else {
- 297 0 INSTANCE.props.setProperty(key, Boolean.FALSE.toString());
+ try {
+ 291 0 pw = new PrintWriter(sw);
+ 292 0 pw.format("%s:%n%n" , header);
+ 293 0 final Enumeration e = properties.propertyNames();
+ 294 0 while (e.hasMoreElements()) {
+ 295 0 final String key = (String) e.nextElement();
+ 296 0 if (key.contains("password" )) {
+ 297 0 pw.format("%s='*****'%n" , key);
298
- }
- 299 0 if (LOGGER.isLoggable(Level.FINE)) {
- 300 0 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
- 301
- }
- 302 0 }
+ } else {
+ 299 0 final String value = properties.getProperty(key);
+ 300 0 if (value != null ) {
+ 301 0 pw.format("%s='%s'%n" , key, value);
+ 302
+ }
303
-
- 304
-
- 305
-
- 306
-
+ }
+ 304 0 }
+ 305 0 pw.flush();
+ 306 0 LOGGER.fine(sw.toString());
307
-
- 308
-
- 309
-
+ } finally {
+ 308 0 if (pw != null ) {
+ 309 0 pw.close();
310
-
+ }
311
-
+ }
312
-
+
313
- public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
- 314 0 final FileInputStream fis = new FileInputStream(filePath);
- 315 0 mergeProperties(fis);
- 316 0 }
+ }
+ 314 16 }
+ 315
+
+ 316
+
317
-
+
318
-
+
319
-
+
320
-
+
321
-
+
322
-
- 323
-
- 324
-
- 325
-
+ public static void setString(String key, String value) {
+ 323 8 localSettings.get().props.setProperty(key, value);
+ 324 8 if (LOGGER.isLoggable(Level.FINE)) {
+ 325 0 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
326
-
- 327
- public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
- 328 0 final FileInputStream fis = new FileInputStream(filePath);
- 329 0 mergeProperties(fis);
- 330 0 }
+ }
+ 327 8 }
+ 328
+
+ 329
+
+ 330
+
331
-
+
332
-
+
333
-
+
334
-
+
335
-
- 336
-
- 337
-
+ public static void setBoolean(String key, boolean value) {
+ 336 2 if (value) {
+ 337 0 localSettings.get().props.setProperty(key, Boolean.TRUE.toString());
338
-
- 339
-
+ } else {
+ 339 2 localSettings.get().props.setProperty(key, Boolean.FALSE.toString());
340
- public static void mergeProperties(InputStream stream) throws IOException {
- 341 0 INSTANCE.props.load(stream);
- 342 0 logProperties("Properties updated via merge" , INSTANCE.props);
- 343 0 }
- 344
-
+ }
+ 341 2 if (LOGGER.isLoggable(Level.FINE)) {
+ 342 0 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
+ 343
+ }
+ 344 2 }
345
-
+
346
-
+
347
-
+
348
-
+
349
-
+
350
-
+
351
-
+
352
-
+
353
- public static File getFile(String key) {
- 354 0 final String file = getString(key);
- 355 0 if (file == null ) {
- 356 0 return null ;
- 357
- }
- 358 0 return new File(file);
- 359
- }
- 360
-
- 361
-
- 362
-
- 363
-
- 364
-
- 365
-
- 366
-
- 367
-
- 368
-
- 369
-
- 370
-
- 371
-
- 372
+
+ 354
- 373
- public static File getDataFile(String key) {
- 374 0 final String file = getString(key);
- 375 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
- 376 0 if (file == null ) {
- 377 0 return null ;
- 378
- }
- 379 0 if (file.startsWith("[JAR]" )) {
- 380 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, "Settings.getDataFile() - transforming filename" );
- 381 0 final File jarPath = getJarPath();
- 382 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
- 383 0 final File retVal = new File(jarPath, file.substring(6));
- 384 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
- 385 0 return retVal;
- 386
- }
- 387 0 return new File(file);
- 388
- }
- 389
+ 355
+ public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
+ 356 0 final FileInputStream fis = new FileInputStream(filePath);
+ 357 0 mergeProperties(fis);
+ 358 0 }
+ 359
- 390
+ 360
- 391
-
- 392
+ 361
+
+ 362
+
+ 363
+
+ 364
+ 365
+
+ 366
+
+ 367
+
+ 368
+
+ 369
+ public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
+ 370 1 final FileInputStream fis = new FileInputStream(filePath);
+ 371 1 mergeProperties(fis);
+ 372 1 }
+ 373
+
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379
+
+ 380
+
+ 381
+
+ 382
+ public static void mergeProperties(InputStream stream) throws IOException {
+ 383 1 localSettings.get().props.load(stream);
+ 384 1 logProperties("Properties updated via merge" , localSettings.get().props);
+ 385 1 }
+ 386
+
+ 387
+
+ 388
+
+ 389
+
+ 390
+
+ 391
+
+ 392
+
393
-
+
394
395
- private static File getJarPath() {
- 396 0 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
- 397 0 String decodedPath = "." ;
- 398
- try {
- 399 0 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
- 400 0 } catch (UnsupportedEncodingException ex) {
- 401 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
- 402 0 }
- 403
-
- 404 0 final File path = new File(decodedPath);
- 405 0 if (path.getName().toLowerCase().endsWith(".jar" )) {
- 406 0 return path.getParentFile();
- 407
- } else {
- 408 0 return new File("." );
- 409
+ public static File getFile(String key) {
+ 396 0 final String file = getString(key);
+ 397 0 if (file == null ) {
+ 398 0 return null ;
+ 399
}
+ 400 0 return new File(file);
+ 401
+ }
+ 402
+
+ 403
+
+ 404
+
+ 405
+
+ 406
+
+ 407
+
+ 408
+
+ 409
+
410
- }
+
411
-
+
412
-
+
413
-
+
414
-
+
415
-
- 416
-
- 417
-
- 418
-
- 419
-
+ public static File getDataFile(String key) {
+ 416 6 final String file = getString(key);
+ 417 6 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
+ 418 6 if (file == null ) {
+ 419 0 return null ;
420
-
- 421
- public static String getString(String key, String defaultValue) {
- 422 0 final String str = System.getProperty(key, INSTANCE.props.getProperty(key, defaultValue));
- 423 0 return str;
- 424
- }
- 425
-
- 426
-
- 427
-
+ }
+ 421 6 if (file.startsWith("[JAR]" )) {
+ 422 0 LOGGER.log(Level.FINE, "Settings.getDataFile() - transforming filename" );
+ 423 0 final File jarPath = getJarPath();
+ 424 0 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
+ 425 0 final File retVal = new File(jarPath, file.substring(6));
+ 426 0 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
+ 427 0 return retVal;
428
-
- 429
-
+ }
+ 429 6 return new File(file);
430
-
+ }
431
- public static File getTempDirectory() {
- 432 0 return new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
+
+ 432
+
433
- }
+
434
-
+
435
-
+
436
-
+
437
-
- 438
-
- 439
-
+ private static File getJarPath() {
+ 438 0 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
+ 439 0 String decodedPath = "." ;
440
-
- 441
-
- 442
-
- 443
- public static String getString(String key) {
- 444 0 return System.getProperty(key, INSTANCE.props.getProperty(key));
+ try {
+ 441 0 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
+ 442 0 } catch (UnsupportedEncodingException ex) {
+ 443 0 LOGGER.log(Level.FINEST, null , ex);
+ 444 0 }
445
- }
- 446
- 447
-
- 448
-
+ 446 0 final File path = new File(decodedPath);
+ 447 0 if (path.getName().toLowerCase().endsWith(".jar" )) {
+ 448 0 return path.getParentFile();
449
-
- 450
-
+ } else {
+ 450 0 return new File("." );
451
-
+ }
452
- public static void removeProperty(String key) {
- 453 0 INSTANCE.props.remove(key);
- 454 0 }
+ }
+ 453
+
+ 454
+
455
-
+
456
-
+
457
-
+
458
-
+
459
-
+
460
-
+
461
-
+
462
-
+
463
-
- 464
-
- 465
- public static int getInt(String key) throws InvalidSettingException {
+ public static String getString(String key, String defaultValue) {
+ 464 17 final String str = System.getProperty(key, localSettings.get().props.getProperty(key, defaultValue));
+ 465 17 return str;
466
- int value;
+ }
467
- try {
- 468 0 value = Integer.parseInt(Settings.getString(key));
- 469 0 } catch (NumberFormatException ex) {
- 470 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 471 0 }
- 472 0 return value;
+
+ 468
+
+ 469
+
+ 470
+
+ 471 1 private static File tempDirectory = null ;
+ 472
+
473
- }
+
474
-
+
475
-
+
476
-
+
477
-
+
478
-
+
479
-
- 480
-
- 481
-
- 482
-
- 483
-
- 484
-
+ public static File getTempDirectory() throws IOException {
+ 480 10 final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
+ 481 10 if (!tmpDir.exists()) {
+ 482 4 if (!tmpDir.mkdirs()) {
+ 483 0 final String msg = String.format("Unable to make a temporary folder '%s'" , tmpDir.getPath());
+ 484 0 throw new IOException(msg);
485
- public static int getInt(String key, int defaultValue) {
- 486
- int value;
+ } else {
+ 486 4 tempDirectory = tmpDir;
487
- try {
- 488 0 value = Integer.parseInt(Settings.getString(key));
- 489 0 } catch (NumberFormatException ex) {
- 490 0 final String msg = String.format("Could not convert property '%s' to an int." , key);
- 491 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, msg, ex);
- 492 0 value = defaultValue;
- 493 0 }
- 494 0 return value;
- 495
- }
- 496
-
- 497
-
- 498
-
- 499
-
- 500
-
- 501
-
- 502
-
- 503
-
- 504
-
- 505
-
- 506
- public static long getLong(String key) throws InvalidSettingException {
- 507
- long value;
- 508
- try {
- 509 0 value = Long.parseLong(Settings.getString(key));
- 510 0 } catch (NumberFormatException ex) {
- 511 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 512 0 }
- 513 0 return value;
- 514
- }
- 515
-
- 516
-
- 517
-
- 518
-
- 519
-
- 520
-
- 521
-
- 522
-
- 523
-
- 524
-
- 525
- public static boolean getBoolean(String key) throws InvalidSettingException {
- 526
- boolean value;
- 527
- try {
- 528 0 value = Boolean.parseBoolean(Settings.getString(key));
- 529 0 } catch (NumberFormatException ex) {
- 530 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 531 0 }
- 532 0 return value;
- 533
- }
- 534
-
- 535
-
- 536
-
- 537
-
- 538
-
- 539
-
- 540
-
- 541
-
- 542
-
- 543
-
- 544
-
- 545
- public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
- 546
- boolean value;
- 547
- try {
- 548 0 final String strValue = Settings.getString(key);
- 549 0 if (strValue == null ) {
- 550 0 return defaultValue;
- 551
}
- 552 0 value = Boolean.parseBoolean(strValue);
- 553 0 } catch (NumberFormatException ex) {
- 554 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 555 0 }
- 556 0 return value;
- 557
+ 488
+ }
+ 489 10 return tmpDir;
+ 490
}
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+ public static String getString(String key) {
+ 501 67 return System.getProperty(key, localSettings.get().props.getProperty(key));
+ 502
+ }
+ 503
+
+ 504
+
+ 505
+
+ 506
+
+ 507
+
+ 508
+
+ 509
+ public static void removeProperty(String key) {
+ 510 1 localSettings.get().props.remove(key);
+ 511 1 }
+ 512
+
+ 513
+
+ 514
+
+ 515
+
+ 516
+
+ 517
+
+ 518
+
+ 519
+
+ 520
+
+ 521
+
+ 522
+ public static int getInt(String key) throws InvalidSettingException {
+ 523
+ int value;
+ 524
+ try {
+ 525 1 value = Integer.parseInt(Settings.getString(key));
+ 526 0 } catch (NumberFormatException ex) {
+ 527 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 528 1 }
+ 529 1 return value;
+ 530
+ }
+ 531
+
+ 532
+
+ 533
+
+ 534
+
+ 535
+
+ 536
+
+ 537
+
+ 538
+
+ 539
+
+ 540
+
+ 541
+
+ 542
+ public static int getInt(String key, int defaultValue) {
+ 543
+ int value;
+ 544
+ try {
+ 545 7 value = Integer.parseInt(Settings.getString(key));
+ 546 7 } catch (NumberFormatException ex) {
+ 547 7 final String msg = String.format("Could not convert property '%s' to an int." , key);
+ 548 7 LOGGER.log(Level.FINEST, msg, ex);
+ 549 7 value = defaultValue;
+ 550 0 }
+ 551 7 return value;
+ 552
+ }
+ 553
+
+ 554
+
+ 555
+
+ 556
+
+ 557
+
558
+
+ 559
+
+ 560
+
+ 561
+
+ 562
+
+ 563
+ public static long getLong(String key) throws InvalidSettingException {
+ 564
+ long value;
+ 565
+ try {
+ 566 1 value = Long.parseLong(Settings.getString(key));
+ 567 0 } catch (NumberFormatException ex) {
+ 568 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 569 1 }
+ 570 1 return value;
+ 571
+ }
+ 572
+
+ 573
+
+ 574
+
+ 575
+
+ 576
+
+ 577
+
+ 578
+
+ 579
+
+ 580
+
+ 581
+
+ 582
+ public static boolean getBoolean(String key) throws InvalidSettingException {
+ 583
+ boolean value;
+ 584
+ try {
+ 585 2 value = Boolean.parseBoolean(Settings.getString(key));
+ 586 0 } catch (NumberFormatException ex) {
+ 587 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 588 2 }
+ 589 2 return value;
+ 590
+ }
+ 591
+
+ 592
+
+ 593
+
+ 594
+
+ 595
+
+ 596
+
+ 597
+
+ 598
+
+ 599
+
+ 600
+
+ 601
+
+ 602
+ public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
+ 603
+ boolean value;
+ 604
+ try {
+ 605 30 final String strValue = Settings.getString(key);
+ 606 30 if (strValue == null ) {
+ 607 28 return defaultValue;
+ 608
+ }
+ 609 2 value = Boolean.parseBoolean(strValue);
+ 610 0 } catch (NumberFormatException ex) {
+ 611 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 612 2 }
+ 613 2 return value;
+ 614
+ }
+ 615
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
index 7b771a68f..3df27dede 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
@@ -12,7 +12,7 @@
@@ -127,7 +127,7 @@
try {
56 0 if (proxyUrl != null ) {
57 0 final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
- 58 0 final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
+ 58 0 final SocketAddress address = new InetSocketAddress(proxyUrl, proxyPort);
59
60 0 final String username = Settings.getString(Settings.KEYS.PROXY_USERNAME);
@@ -152,7 +152,7 @@
}
74
- 75 0 proxy = new Proxy(Proxy.Type.HTTP, addr);
+ 75 0 proxy = new Proxy(Proxy.Type.HTTP, address);
76 0 conn = (HttpURLConnection) url.openConnection(proxy);
77 0 } else {
78 0 conn = (HttpURLConnection) url.openConnection();
@@ -198,26 +198,26 @@
104
public static HttpURLConnection createHttpURLConnection(URL url, boolean proxy) throws URLConnectionFailureException {
- 105 0 if (proxy) {
+ 105 6 if (proxy) {
106 0 return createHttpURLConnection(url);
107
}
- 108 0 HttpURLConnection conn = null ;
+ 108 6 HttpURLConnection conn = null ;
109
try {
- 110 0 conn = (HttpURLConnection) url.openConnection();
- 111 0 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
- 112 0 conn.setConnectTimeout(timeout);
+ 110 6 conn = (HttpURLConnection) url.openConnection();
+ 111 6 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
+ 112 6 conn.setConnectTimeout(timeout);
113 0 } catch (IOException ioe) {
114 0 throw new URLConnectionFailureException("Error getting connection." , ioe);
- 115 0 }
- 116 0 return conn;
+ 115 6 }
+ 116 6 return conn;
117
}
118
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
index c635dd8df..d2273e73b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
@@ -155,6 +155,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 17751a29a..37d08ad54 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
@@ -12,7 +12,7 @@
@@ -99,14 +99,14 @@
41
- 42 0 private static final Pattern CONTAINS_URL_TEST = Pattern.compile("^.*(ht|f)tps?://.*$" , Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
+ 42 1 private static final Pattern CONTAINS_URL_TEST = Pattern.compile("^.*(ht|f)tps?://.*$" , Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
43
44
45
- 46 0 private static final Pattern IS_URL_TEST = Pattern.compile("^(ht|f)tps?://.*" , Pattern.CASE_INSENSITIVE);
+ 46 1 private static final Pattern IS_URL_TEST = Pattern.compile("^(ht|f)tps?://.*" , Pattern.CASE_INSENSITIVE);
47
48
@@ -125,7 +125,7 @@
55
public static boolean containsUrl(String text) {
- 56 0 return CONTAINS_URL_TEST.matcher(text).matches();
+ 56 18230 return CONTAINS_URL_TEST.matcher(text).matches();
57
}
58
@@ -144,7 +144,7 @@
65
public static boolean isUrl(String text) {
- 66 0 return IS_URL_TEST.matcher(text).matches();
+ 66 7 return IS_URL_TEST.matcher(text).matches();
67
}
68
@@ -153,7 +153,7 @@
70
- 71 0 private static final HashSet<String> IGNORE_LIST = new HashSet<String>(
+ 71 1 private static final HashSet<String> IGNORE_LIST = new HashSet<String>(
72
Arrays.asList("www" , "com" , "org" , "gov" , "info" , "name" , "net" , "pro" , "tel" , "mobi" , "xxx" ));
73
@@ -188,40 +188,40 @@
88
public static List<String> extractImportantUrlData(String text) throws MalformedURLException {
- 89 0 final ArrayList<String> importantParts = new ArrayList<String>();
- 90 0 final URL url = new URL(text);
- 91 0 final String[] domain = url.getHost().split("\\." );
+ 89 7 final ArrayList<String> importantParts = new ArrayList<String>();
+ 90 7 final URL url = new URL(text);
+ 91 7 final String[] domain = url.getHost().split("\\." );
92
- 93 0 for (int i = 0; i < domain.length - 1; i++) {
- 94 0 final String sub = domain[i];
- 95 0 if (!IGNORE_LIST.contains(sub.toLowerCase())) {
- 96 0 importantParts.add(sub);
+ 93 20 for (int i = 0; i < domain.length - 1; i++) {
+ 94 13 final String sub = domain[i];
+ 95 13 if (!IGNORE_LIST.contains(sub.toLowerCase())) {
+ 96 12 importantParts.add(sub);
97
}
98
}
- 99 0 final String document = url.getPath();
- 100 0 final String[] pathParts = document.split("[\\//]" );
- 101 0 for (int i = 0; i < pathParts.length - 2; i++) {
- 102 0 if (!pathParts[i].isEmpty()) {
+ 99 7 final String document = url.getPath();
+ 100 7 final String[] pathParts = document.split("[\\//]" );
+ 101 12 for (int i = 0; i < pathParts.length - 2; i++) {
+ 102 5 if (!pathParts[i].isEmpty()) {
103 0 importantParts.add(pathParts[i]);
104
}
105
}
- 106 0 if (pathParts.length > 0 && !pathParts[pathParts.length - 1].isEmpty()) {
- 107 0 final String fileNameNoExt = pathParts[pathParts.length - 1].replaceAll("\\..*{0,5}$" , "" );
- 108 0 importantParts.add(fileNameNoExt);
+ 106 7 if (pathParts.length > 0 && !pathParts[pathParts.length - 1].isEmpty()) {
+ 107 6 final String fileNameNoExt = pathParts[pathParts.length - 1].replaceAll("\\..*{0,5}$" , "" );
+ 108 6 importantParts.add(fileNameNoExt);
109
}
- 110 0 return importantParts;
+ 110 7 return importantParts;
111
}
112
}
-
+
diff --git a/dependency-check-core/cpd.html b/dependency-check-core/cpd.html
index 041628ea0..00f42cbc3 100644
--- a/dependency-check-core/cpd.html
+++ b/dependency-check-core/cpd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - CPD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -147,6 +147,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,18 +168,18 @@
Checkstyle
-
-
- CPD Report
-
-
-
+
- PMD Report
+ PMD
+
+
+ CPD
+
+
@@ -232,7 +239,7 @@
CPD Results
-
The following document contains the results of PMD's CPD 5.0.2.
+The following document contains the results of PMD's CPD 5.0.5.
Duplications
@@ -241,21 +248,15 @@
Line
org\owasp\dependencycheck\analyzer\ArchiveAnalyzer.java
-157
+157
org\owasp\dependencycheck\analyzer\JarAnalyzer.java
-924
+920
@Override
public void initializeFileTypeAnalyzer() throws Exception {
final File baseDir = Settings.getTempDirectory();
- if (!baseDir.exists()) {
- if (!baseDir.mkdirs()) {
- final String msg = String.format("Unable to make a temporary folder '%s'", baseDir.getPath());
- throw new AnalysisException(msg);
- }
- }
tempFileLocation = File.createTempFile("check", "tmp", baseDir);
if (!tempFileLocation.delete()) {
final String msg = String.format("Unable to delete temporary file '%s'.", tempFileLocation.getAbsolutePath());
diff --git a/dependency-check-core/dependency-updates-report.html b/dependency-check-core/dependency-updates-report.html
index e6969a97e..70a08a4cd 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
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-03-29
+
| Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -145,6 +145,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -237,7 +244,7 @@
# of dependencies using the latest version available
-7
+9
# of dependencies where the next version available is smaller than an incremental version update
@@ -249,7 +256,7 @@
# of dependencies where the next version available is a minor version update
-11
+10
# of dependencies where the next version available is a major version update
@@ -285,6 +292,18 @@
+
+com.google.inject
+guice
+3.0
+provided
+
+jar
+
+
+
+
+
com.h2database
h2
@@ -294,9 +313,9 @@
jar
1.3.173
-
+1.4.177
-
+
com.hazelcast
hazelcast
@@ -308,7 +327,7 @@
2.5.1
2.6
3.0
-
+
commons-cli
commons-cli
@@ -320,7 +339,7 @@
-
+
commons-io
commons-io
@@ -332,7 +351,7 @@
-
+
commons-lang
commons-lang
@@ -344,7 +363,7 @@
2.6
-
+
junit
junit
@@ -356,7 +375,7 @@
-
+
net.sf.ehcache
ehcache-core
@@ -368,7 +387,7 @@
2.3.0
-
+
org.apache.axis2
axis2-adb
@@ -380,7 +399,7 @@
1.5
-
+
org.apache.axis2
axis2-spring
@@ -392,19 +411,19 @@
1.5
-
-
+
+
org.apache.commons
commons-compress
-1.5
+1.8
compile
jar
-1.6
+
-
+
org.apache.geronimo.daytrader
daytrader-ear
@@ -416,7 +435,7 @@
-
+
org.apache.lucene
lucene-analyzers-common
@@ -428,7 +447,7 @@
4.6.0
-
+
org.apache.lucene
lucene-core
@@ -440,7 +459,7 @@
4.6.0
-
+
org.apache.lucene
lucene-queryparser
@@ -452,7 +471,7 @@
4.6.0
-
+
org.apache.lucene
lucene-test-framework
@@ -464,7 +483,7 @@
4.4.0
-
+
org.apache.maven.scm
maven-scm-provider-cvsexe
@@ -476,7 +495,7 @@
1.9
-
+
org.apache.openjpa
openjpa
@@ -488,7 +507,7 @@
2.1.0
-
+
org.apache.struts
struts2-core
@@ -500,7 +519,7 @@
2.1.6
2.2.1
-
+
org.apache.velocity
velocity
@@ -512,7 +531,7 @@
-
+
org.apache.velocity
velocity-tools
@@ -524,7 +543,7 @@
-
+
org.dojotoolkit
dojo-war
@@ -536,7 +555,7 @@
1.3.1
1.4.2
-
+
org.glassfish.main.admingui
war
@@ -548,7 +567,7 @@
-
+
org.jsoup
jsoup
@@ -560,7 +579,7 @@
1.7.3
-
+
org.mortbay.jetty
jetty
@@ -572,7 +591,7 @@
6.1.17
-
+
org.springframework
spring-webmvc
@@ -584,7 +603,7 @@
2.5.6
3.0.0.RELEASE
-
+
Status
Group Id
Artifact Id
@@ -602,31 +621,55 @@
com.google.code.findbugs:annotations
-
+
Status
There is at least one newer incremental version available. Incremental updates are typically passive.
-
+
Group Id
com.google.code.findbugs
-
+
Artifact Id
annotations
-
+
Current Version
2.0.1
-
+
Scope
compile
-
+
Classifier
-
+
Type
jar
-
+
Newer versions
2.0.2 Next Incremental 2.0.3 Latest Incremental
+
com.google.inject:guice
+
+
+Status
+ No newer versions available.
+
+Group Id
+com.google.inject
+
+Artifact Id
+guice
+
+Current Version
+3.0
+
+Scope
+provided
+
+Classifier
+
+
+Type
+jar
+
com.h2database:h2
@@ -652,7 +695,7 @@
jar
Newer versions
-1.3.173 Next Incremental 1.3.1741.3.175 Latest Incremental
+1.3.173 Next Incremental 1.3.174 1.3.1751.3.176 Latest Incremental 1.4.177 Next Minor
com.hazelcast:hazelcast
@@ -679,7 +722,7 @@
jar
Newer versions
-2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2-RC1 3.2-RC23.2 Latest Major
+ 2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2-RC1 3.2-RC23.2 Latest Major
commons-cli:commons-cli
@@ -805,7 +848,7 @@
jar
Newer versions
-2.3.0 Next Minor 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.2 2.6.3 2.6.5 2.6.62.6.8 Latest Minor
+2.3.0 Next Minor 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.2 2.6.3 2.6.5 2.6.6 2.6.82.6.9 Latest Minor
org.apache.axis2:axis2-adb
@@ -865,7 +908,7 @@
Status
- There is at least one newer minor version available. Minor updates are sometimes passive.
+ No newer versions available.
Group Id
org.apache.commons
@@ -874,7 +917,7 @@
commons-compress
Current Version
-1.5
+1.8
Scope
compile
@@ -883,10 +926,7 @@
Type
-jar
-
-Newer versions
-1.6 Next Minor 1.71.8 Latest Minor
+jar
org.apache.geronimo.daytrader:daytrader-ear
@@ -937,7 +977,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.14.7.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.24.8.0 Latest Minor
org.apache.lucene:lucene-core
@@ -964,7 +1004,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.14.7.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.24.8.0 Latest Minor
org.apache.lucene:lucene-queryparser
@@ -991,7 +1031,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.14.7.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.24.8.0 Latest Minor
org.apache.lucene:lucene-test-framework
@@ -1018,7 +1058,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 4.5.1 4.6.0 4.6.14.7.0 Latest Minor
+4.4.0 Next Minor 4.5.0 4.5.1 4.6.0 4.6.1 4.7.0 4.7.1 4.7.24.8.0 Latest Minor
org.apache.maven.scm:maven-scm-provider-cvsexe
@@ -1099,7 +1139,7 @@
jar
Newer versions
-2.1.6 Next Incremental 2.1.82.1.8.1 Latest Incremental 2.2.1 Next Minor 2.2.1.1 2.2.3 2.2.3.1 2.3.1 2.3.1.1 2.3.1.2 2.3.3 2.3.4 2.3.4.1 2.3.7 2.3.8 2.3.12 2.3.14 2.3.14.1 2.3.14.2 2.3.14.3 2.3.15 2.3.15.1 2.3.15.2 2.3.15.3 2.3.162.3.16.1 Latest Minor
+2.1.6 Next Incremental 2.1.82.1.8.1 Latest Incremental 2.2.1 Next Minor 2.2.1.1 2.2.3 2.2.3.1 2.3.1 2.3.1.1 2.3.1.2 2.3.3 2.3.4 2.3.4.1 2.3.7 2.3.8 2.3.12 2.3.14 2.3.14.1 2.3.14.2 2.3.14.3 2.3.15 2.3.15.1 2.3.15.2 2.3.15.3 2.3.16 2.3.16.12.3.16.2 Latest Minor
org.apache.velocity:velocity
@@ -1174,7 +1214,7 @@
war
Newer versions
-1.3.1 Next Incremental 1.3.2 Latest Incremental 1.4.2 Next Minor 1.4.3 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0b2 1.9.0 1.9.11.9.2 Latest Minor
+1.3.1 Next Incremental 1.3.2 Latest Incremental 1.4.2 Next Minor 1.4.3 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0b2 1.9.0 1.9.1 1.9.21.9.3 Latest Minor
org.glassfish.main.admingui:war
diff --git a/dependency-check-core/failsafe-report.html b/dependency-check-core/failsafe-report.html
index 93b553d65..0dbc5ac29 100644
--- a/dependency-check-core/failsafe-report.html
+++ b/dependency-check-core/failsafe-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-10
+ | Last Published: 2014-04-28
- Version: 1.1.3
+ Version: 1.2.0
@@ -168,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -268,12 +268,12 @@ function toggleDisplay(elementId) {
Success Rate
Time
-8
+36
0
0
0
100%
-382.652
+
526.61
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
org.owasp.dependencycheck.utils
@@ -353,7 +398,46 @@ function toggleDisplay(elementId) {
0
0
100%
-149.292
+0
+
+
org.owasp.dependencycheck.analyzer
+
org.owasp.dependencycheck.data.update
@@ -374,7 +458,7 @@ function toggleDisplay(elementId) {
0
0
100%
-175.736
+26.089
StandardUpdateIntegrationTest
@@ -383,54 +467,214 @@ function toggleDisplay(elementId) {
0
0
100%
-4.214
+9.792
+
+
org.owasp.dependencycheck.data.nvdcve
+
Test Cases
[Summary ] [Package List ] [Test Cases ]
+
+
+
VulnerabilitySuppressionAnalyzerIntegrationTest
+
+
+
+testAnalyze
+18.651
+
+
+testGetAnalysisPhase
+3.416
+
+
+testGetName
+2.808
+
+
CveDBIntegrationTest
+
+
+
+testOpen
+16.649
+
+
+testGetCPEs
+21.171
+
+
+testGetVulnerabilities
+17.425
+
+
NvdCveUpdaterIntegrationTest
testUpdate
-175.736
+
26.089
StandardUpdateIntegrationTest
testOpenDataStores
-0.94
+4.41
testUpdatesNeeded
-2.021
+1.485
testWithinRange
-0.613
+1.903
testUpdate
-0.64
+1.994
EngineIntegrationTest
testScan
-53.41
+3.813
+
+
+testEngine
+93.09
+
+
ReportGeneratorIntegrationTest
+
+
+
+testGenerateXMLReport
+26.079
+
+
+testGenerateReport
+3.529
DownloaderIntegrationTest
testGetLastModified
-0.696
+0
testFetchFile
-148.596
+0
diff --git a/dependency-check-core/findbugs.html b/dependency-check-core/findbugs.html
index 710c445b1..e59e51986 100644
--- a/dependency-check-core/findbugs.html
+++ b/dependency-check-core/findbugs.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - FindBugs Bug Detector Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -147,6 +147,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -163,16 +170,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -245,8 +252,8 @@
Errors
Missing Classes
-209
-9
+210
+6
0
0
@@ -283,93 +284,57 @@
Line
Priority
-Found reliance on default encoding in org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.analyzeFileType(Dependency, Engine): new java.io.InputStreamReader(InputStream)
-I18N
-DM_DEFAULT_ENCODING
-120
-High
-
-Found reliance on default encoding in org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer(): new java.io.InputStreamReader(InputStream)
-I18N
-DM_DEFAULT_ENCODING
-232
-High
+org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer() discards result of readLine after checking if it is nonnull
+STYLE
+RV_DONT_JUST_NULL_CHECK_READLINE
+233
+Medium
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
-
+
Bug
Category
Details
Line
Priority
-
-Possible null pointer dereference of currentVersion in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
-CORRECTNESS
-NP_NULL_ON_SOME_PATH
-141
-Medium
+Possible null pointer dereference of currentVersion on branch that might be infeasible in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
+STYLE
+NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE
+144
+Medium
+
Possible null pointer dereference of nextVersion on branch that might be infeasible in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
STYLE
NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE
-141
+144
Medium
org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer
-
+
Bug
Category
Details
Line
Priority
-
+
Found reliance on default encoding in org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.analyzeFileType(Dependency, Engine): new java.io.FileReader(File)
I18N
DM_DEFAULT_ENCODING
115
-High
-
-
org.owasp.dependencycheck.data.update.task.CallableDownloadTask
-
-
-Bug
-Category
-Details
-Line
-Priority
-
-new org.owasp.dependencycheck.data.update.task.CallableDownloadTask(NvdCveInfo, ExecutorService, CveDB) might ignore java.io.IOException
-BAD_PRACTICE
-DE_MIGHT_IGNORE
-59
-Medium
-
-
org.owasp.dependencycheck.utils.LogUtils
-
-
-Bug
-Category
-Details
-Line
-Priority
-
-Changes to logger could be lost in org.owasp.dependencycheck.utils.LogUtils.prepareLogger(InputStream, String)
-EXPERIMENTAL
-LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
-58
High
org.owasp.dependencycheck.utils.URLConnectionFactory
-
+
Bug
Category
Details
Line
Priority
-
+
Redundant nullcheck of conn which is known to be null in org.owasp.dependencycheck.utils.URLConnectionFactory.createHttpURLConnection(URL)
STYLE
RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE
diff --git a/dependency-check-core/index.html b/dependency-check-core/index.html
index 17b62b403..0fa25891c 100644
--- a/dependency-check-core/index.html
+++ b/dependency-check-core/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - About
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -111,7 +111,7 @@
-
+
diff --git a/dependency-check-core/javancss.html b/dependency-check-core/javancss.html
index 08a6a4e75..3f96fe10d 100644
--- a/dependency-check-core/javancss.html
+++ b/dependency-check-core/javancss.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - JavaNCSS Metric Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -147,6 +147,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -163,16 +170,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -252,11 +259,11 @@
org.owasp.dependencycheck.analyzer
23
169
-2131
+2138
187
-1260
+1266
164
-631
+640
org.owasp.dependencycheck.jaxb.pom.generated
86
@@ -269,48 +276,48 @@
org.owasp.dependencycheck.utils
22
-102
-845
-109
-679
-8
-454
+106
+866
+113
+697
+10
+472
org.owasp.dependencycheck.data.nvdcve
9
61
-788
+795
68
413
30
-266
+281
org.owasp.dependencycheck.dependency
14
-161
-725
-158
-1000
+167
+744
+164
+1036
13
-222
+231
org.owasp.dependencycheck.suppression
6
48
-326
+330
54
338
6
-145
+151
org.owasp.dependencycheck.data.update.xml
4
35
-315
+316
34
222
5
-124
+127
org.owasp.dependencycheck.agent
1
@@ -319,70 +326,70 @@
65
442
0
-32
+35
org.owasp.dependencycheck.data.update
6
-35
-272
-40
-267
+34
+269
+39
+266
5
-125
+128
org.owasp.dependencycheck.data.lucene
11
30
-264
+265
41
259
20
-228
+231
org.owasp.dependencycheck
1
-21
-218
-21
-118
+22
+223
+22
+127
6
-42
+45
org.owasp.dependencycheck.data.cpe
4
30
-205
+206
32
218
0
-99
+102
org.owasp.dependencycheck.data.update.task
2
17
-158
+171
18
-121
+132
0
-54
+60
org.owasp.dependencycheck.reporting
+3
+14
+159
+17
+118
2
-11
-138
-13
-94
-1
-65
+91
org.owasp.dependencycheck.data.nexus
2
15
-102
+106
17
-102
+108
11
-62
+53
org.owasp.dependencycheck.data.nuget
4
@@ -396,11 +403,11 @@
org.owasp.dependencycheck.data.cwe
2
5
-47
+48
6
29
1
-50
+53
org.owasp.dependencycheck.exception
2
@@ -447,13 +454,13 @@
Single lines comment
Multi lines comment
-206
-1391
-8778
-1545
-12940
-498
-2865
+207
+1404
+8880
+1559
+13049
+501
+2966
[ package ] [ object ] [ method ] [ explanation ]
@@ -467,13 +474,13 @@
Javadocs
org.owasp.dependencycheck.analyzer.JarAnalyzer
-643
+639
31
1
37
org.owasp.dependencycheck.data.nvdcve.CveDB
-402
+403
20
0
21
@@ -485,7 +492,7 @@
65
org.owasp.dependencycheck.analyzer.CPEAnalyzer
-259
+260
17
2
30
@@ -497,16 +504,28 @@
83
org.owasp.dependencycheck.data.update.xml.NvdCve20Handler
-208
+209
8
1
24
org.owasp.dependencycheck.Engine
-189
-21
+194
+22
0
-21
+
22
+
+org.owasp.dependencycheck.dependency.Dependency
+190
+47
+0
+48
+
+org.owasp.dependencycheck.utils.Settings
+189
+23
+1
+26
org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory
175
@@ -515,61 +534,49 @@
88
org.owasp.dependencycheck.analyzer.ArchiveAnalyzer
-173
+169
11
0
12
-org.owasp.dependencycheck.dependency.Dependency
-173
-41
-0
-42
-
-org.owasp.dependencycheck.utils.Settings
-169
-19
-1
-22
-
org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer
-156
+157
11
0
12
org.owasp.dependencycheck.data.nvdcve.ConnectionFactory
-148
+151
9
0
10
org.owasp.dependencycheck.data.update.StandardUpdate
-140
+141
8
0
9
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer
-128
+130
8
0
8
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
-119
+120
9
0
10
org.owasp.dependencycheck.dependency.EvidenceCollection
-118
+119
18
5
19
org.owasp.dependencycheck.suppression.SuppressionRule
-111
+113
24
0
25
@@ -581,13 +588,13 @@
35
org.owasp.dependencycheck.dependency.VulnerableSoftware
-107
+108
18
0
19
org.owasp.dependencycheck.data.cpe.CpeMemoryIndex
-106
+107
14
0
15
@@ -598,17 +605,17 @@
5
39
-org.owasp.dependencycheck.utils.FileUtils
-99
-9
-0
-10
-
org.owasp.dependencycheck.jaxb.pom.generated.Profile
97
24
6
37
+
+org.owasp.dependencycheck.utils.FileUtils
+97
+9
+0
+10
org.owasp.dependencycheck.utils.DependencyVersion
91
@@ -617,13 +624,13 @@
11
org.owasp.dependencycheck.reporting.ReportGenerator
-86
+88
6
1
7
org.owasp.dependencycheck.utils.Downloader
-84
+85
4
0
5
@@ -634,17 +641,17 @@
1
10
+org.owasp.dependencycheck.data.update.task.CallableDownloadTask
+75
+11
+0
+11
+
org.owasp.dependencycheck.jaxb.pom.generated.Plugin
70
18
4
-27
-
-org.owasp.dependencycheck.data.update.task.CallableDownloadTask
-69
-11
-0
-11
+
27
TOP 30 classes containing the most methods.
@@ -673,10 +680,10 @@
83
org.owasp.dependencycheck.dependency.Dependency
-173
-41
+190
+47
0
-42
+48
org.owasp.dependencycheck.dependency.Vulnerability
108
@@ -685,7 +692,7 @@
35
org.owasp.dependencycheck.analyzer.JarAnalyzer
-643
+639
31
1
37
@@ -703,37 +710,37 @@
37
org.owasp.dependencycheck.suppression.SuppressionRule
-111
+113
24
0
25
-org.owasp.dependencycheck.Engine
+org.owasp.dependencycheck.utils.Settings
189
-21
-0
-21
+23
+1
+26
+org.owasp.dependencycheck.Engine
+194
+22
+0
+22
+
org.owasp.dependencycheck.data.nvdcve.CveDB
-402
+403
20
0
21
-
-org.owasp.dependencycheck.utils.Settings
-169
-19
-1
-22
org.owasp.dependencycheck.dependency.EvidenceCollection
-118
+119
18
5
19
org.owasp.dependencycheck.dependency.VulnerableSoftware
-107
+108
18
0
19
@@ -757,7 +764,7 @@
27
org.owasp.dependencycheck.analyzer.CPEAnalyzer
-259
+260
17
2
30
@@ -799,7 +806,7 @@
14
org.owasp.dependencycheck.data.cpe.CpeMemoryIndex
-106
+107
14
0
15
@@ -842,11 +849,11 @@
Methods average
Javadocs average
-39.33
-8,778.00
-0.32
-6.75
-7.93
+39.60
+8,880.00
+0.31
+6.78
+7.96
[ package ] [ object ] [ method ] [ explanation ]
@@ -904,35 +911,35 @@
9
1
+org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer()
+52
+20
+1
+
org.owasp.dependencycheck.utils.FileUtils.extractFiles(File,File,Engine)
51
23
1
-
-org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer()
-50
-18
-1
+org.owasp.dependencycheck.agent.DependencyCheckScanAgent.populateSettings()
+49
+38
+1
+
org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.extractArchive(ArchiveInputStream,File,Engine)
49
23
1
-
+
org.owasp.dependencycheck.analyzer.JarAnalyzer.extractPom(String,JarFile,Dependency)
49
9
1
-
+
org.owasp.dependencycheck.analyzer.JarAnalyzer.setPomEvidence(Dependency,Model,Properties,ClassNameInformation)
49
22
1
-
-org.owasp.dependencycheck.agent.DependencyCheckScanAgent.populateSettings()
-48
-38
-1
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.analyzeFileType(Dependency,Engine)
48
@@ -949,20 +956,20 @@
14
1
+org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.loadSuppressionData()
+43
+16
+1
+
org.owasp.dependencycheck.analyzer.JarAnalyzer.analyzePOM(Dependency,ClassNameInformation,Engine)
42
11
1
-
+
org.owasp.dependencycheck.data.update.StandardUpdate.updatesNeeded()
42
17
1
-
-org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.loadSuppressionData()
-41
-16
-1
org.owasp.dependencycheck.reporting.ReportGenerator.generateReport(String,String)
41
@@ -980,7 +987,7 @@
0
org.owasp.dependencycheck.suppression.SuppressionRule.process(Dependency)
-37
+39
25
1
@@ -1017,9 +1024,9 @@
CCN average
Javadocs average
-8,778.00
+8,880.00
4.83
-2.31
+2.30
0.97
diff --git a/dependency-check-core/license.html b/dependency-check-core/license.html
index c26213e90..ddf4910fc 100644
--- a/dependency-check-core/license.html
+++ b/dependency-check-core/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-03-29
+
| Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -111,7 +111,7 @@
-
+
diff --git a/dependency-check-core/plugin-updates-report.html b/dependency-check-core/plugin-updates-report.html
index 3931b37c6..62fcc3430 100644
--- a/dependency-check-core/plugin-updates-report.html
+++ b/dependency-check-core/plugin-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Plugin Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -145,6 +145,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
diff --git a/dependency-check-core/pmd.html b/dependency-check-core/pmd.html
index 4e27c2302..1f787f156 100644
--- a/dependency-check-core/pmd.html
+++ b/dependency-check-core/pmd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - PMD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-03-29
+
| Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -147,6 +147,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,18 +168,18 @@
Checkstyle
-
-
-
-
- CPD Report
-
-
- PMD Report
+ PMD
+
+
+
+
+ CPD
+
+
@@ -232,7 +239,7 @@
PMD Results
-
The following document contains the results of PMD 5.0.2.
+The following document contains the results of PMD 5.0.5.
Files
@@ -243,25 +250,19 @@
Line
These nested if statements could be combined
-161 - 164
+
320–323
These nested if statements could be combined
-326 - 329
-
-These nested if statements could be combined
-340 - 343
+
334–337
org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
-
+
Violation
Line
-
-Avoid unused local variables such as 'line'.
-233
Avoid empty while statements
-234 - 236
+233–235
org/owasp/dependencycheck/analyzer/CPEAnalyzer.java
@@ -270,16 +271,16 @@
Line
Useless parentheses.
-213
+216
These nested if statements could be combined
-531 - 536
+534–539
These nested if statements could be combined
-532 - 535
+535–538
These nested if statements could be combined
-541 - 544
+544–547
org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
@@ -288,7 +289,7 @@
Line
These nested if statements could be combined
-223 - 225
+228–230
org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.java
@@ -297,7 +298,7 @@
Line
These nested if statements could be combined
-129 - 150
+133–153
org/owasp/dependencycheck/analyzer/JarAnalyzer.java
@@ -306,22 +307,16 @@
Line
Useless parentheses.
-374
-
-These nested if statements could be combined
-928 - 931
+374
org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
-
+
Violation
Line
-
-An empty statement (semicolon) not part of a loop
-110
Avoid unused local variables such as 'extractComments'.
-113
+113
org/owasp/dependencycheck/analyzer/NvdCveAnalyzer.java
@@ -330,7 +325,7 @@
Line
Useless parentheses.
-76
+76
org/owasp/dependencycheck/data/cpe/IndexEntry.java
@@ -339,10 +334,10 @@
Line
Useless parentheses.
-172
+172
Useless parentheses.
-175
+175
org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java
@@ -351,7 +346,7 @@
Line
These nested if statements could be combined
-242 - 244
+248–250
org/owasp/dependencycheck/data/nvdcve/CveDB.java
@@ -360,13 +355,13 @@
Line
Avoid unused private fields such as 'SELECT_PROPERTY'.
-247
+250
Avoid unused private fields such as 'DELETE_PROPERTY'.
-259
+262
Useless parentheses.
-737
+740
org/owasp/dependencycheck/data/nvdcve/DriverShim.java
@@ -375,7 +370,7 @@
Line
Useless parentheses.
-188
+192
org/owasp/dependencycheck/data/update/StandardUpdate.java
@@ -384,7 +379,7 @@
Line
Useless parentheses.
-114
+118
org/owasp/dependencycheck/dependency/Dependency.java
@@ -393,28 +388,28 @@
Line
Useless parentheses.
-494
+563
Useless parentheses.
-497
+566
Useless parentheses.
-500
+569
Useless parentheses.
-503
+572
Useless parentheses.
-506
+575
Useless parentheses.
-509
+578
Useless parentheses.
-524
+593
Useless parentheses.
-527
+596
org/owasp/dependencycheck/dependency/Evidence.java
@@ -423,7 +418,7 @@
Line
Useless parentheses.
-202
+202
org/owasp/dependencycheck/dependency/Identifier.java
@@ -432,10 +427,10 @@
Line
Useless parentheses.
-175
+175
Useless parentheses.
-178
+178
org/owasp/dependencycheck/dependency/Reference.java
@@ -444,13 +439,13 @@
Line
Useless parentheses.
-109
+109
Useless parentheses.
-112
+112
Useless parentheses.
-115
+115
org/owasp/dependencycheck/dependency/Vulnerability.java
@@ -459,7 +454,7 @@
Line
Useless parentheses.
-373
+373
org/owasp/dependencycheck/dependency/VulnerableSoftware.java
@@ -468,13 +463,13 @@
Line
Useless parentheses.
-139
+143
Useless parentheses.
-178
+182
Useless parentheses.
-183
+187
org/owasp/dependencycheck/suppression/PropertyType.java
@@ -483,7 +478,7 @@
Line
Useless parentheses.
-161
+161
org/owasp/dependencycheck/utils/Checksum.java
@@ -492,7 +487,7 @@
Line
Useless parentheses.
-109
+113
org/owasp/dependencycheck/utils/DependencyVersion.java
@@ -501,19 +496,10 @@
Line
Useless parentheses.
-135
+135
Useless parentheses.
-194
-
-
org/owasp/dependencycheck/utils/FileUtils.java
-
-
-Violation
-Line
-
-These nested if statements could be combined
-107 - 109
+194
diff --git a/dependency-check-core/project-info.html b/dependency-check-core/project-info.html
index 18eb2ed95..82fa3943c 100644
--- a/dependency-check-core/project-info.html
+++ b/dependency-check-core/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -111,7 +111,7 @@
-
+
diff --git a/dependency-check-core/project-reports.html b/dependency-check-core/project-reports.html
index c8b4f35cf..0cc9b8aa9 100644
--- a/dependency-check-core/project-reports.html
+++ b/dependency-check-core/project-reports.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Generated Reports
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
Project Reports
@@ -145,6 +145,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -261,21 +268,24 @@
Surefire Report
Report on the test results of the project.
+Failsafe Report
+Report on the integration test results of the project.
+
Tag List
Report on various tags found in the code.
-
+
Checkstyle
Report on coding style conventions.
-
-CPD Report
-Duplicate code detection.
-PMD Report
+PMD
Verification of coding rules.
+CPD
+Duplicate code detection.
+
FindBugs Report
Generates a source code report with the FindBugs Library.
-
+
JavaNCSS Report
Code metric analysis.
diff --git a/dependency-check-core/project-summary.html b/dependency-check-core/project-summary.html
index 10dee0583..d8b2bebd8 100644
--- a/dependency-check-core/project-summary.html
+++ b/dependency-check-core/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -111,7 +111,7 @@
-
+
@@ -203,7 +203,7 @@
dependency-check-core
Version
-1.1.4
+1.2.0
Type
jar
diff --git a/dependency-check-core/surefire-report.html b/dependency-check-core/surefire-report.html
index 625a6e660..520dbdac4 100644
--- a/dependency-check-core/surefire-report.html
+++ b/dependency-check-core/surefire-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -145,6 +145,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
@@ -161,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -250,7 +257,8 @@ function toggleDisplay(elementId) {
-
Summary
+
Summary
+
[Summary ] [Package List ] [Test Cases ]
Tests
@@ -260,13 +268,1388 @@ function toggleDisplay(elementId) {
Success Rate
Time
+165
0
0
-0
-0
-0%
-0
+
1
+
99.394%
+
51.533
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
+
+
Package List
+
[Summary ] [Package List ] [Test Cases ]
+
+
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+
+
org.owasp.dependencycheck.data.cwe
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+CweDBTest
+1
+0
+0
+0
+100%
+0
+
+
org.owasp.dependencycheck.data.nuget
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+XPathNuspecParserTest
+3
+0
+0
+0
+100%
+0.117
+
+
org.owasp.dependencycheck.data.nexus
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+NexusSearchTest
+4
+0
+0
+0
+100%
+1.324
+
+
org.owasp.dependencycheck.dependency
+
+
+
org.owasp.dependencycheck.utils
+
+
+
org.owasp.dependencycheck.data.update.xml
+
+
+
org.owasp.dependencycheck.analyzer
+
+
+
org.owasp.dependencycheck.data.update
+
+
+
org.owasp.dependencycheck.data.nvdcve
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+DriverLoaderTest
+6
+0
+0
+0
+100%
+0.597
+
+
org.owasp.dependencycheck.suppression
+
+
+
org.owasp.dependencycheck.data.lucene
+
+
+
org.owasp.dependencycheck.data.cpe
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+IndexEntryTest
+1
+0
+0
+0
+100%
+0
+
+
Test Cases
+
[Summary ] [Package List ] [Test Cases ]
+
+
AbstractFileTypeAnalyzerTest
+
+
+
+testNewHashSet
+0.009
+
+
AbstractSuppressionAnalyzerTest
+
+
+
+testGetRules
+0.887
+
+
+testInitialize
+0.029
+
+
+testGetSupportedExtensions
+0.003
+
+
AnalyzerServiceTest
+
+
+
+testGetAnalyzers
+0.778
+
+
+
+
FalsePositiveAnalyzerTest
+
+
+
+testAnalyze
+0
+
+
+testGetAnalysisPhase
+0
+
+
+testGetName
+0
+
+
+
HintAnalyzerTest
+
+
+
+testAnalyze
+34.827
+
+
+testGetAnalysisPhase
+3.124
+
+
+testGetName
+2.684
+
+
+
+
+
IndexEntryTest
+
+
+
+testSetName
+0
+
+
CweDBTest
+
+
+
+testGetCweName
+0
+
+
FieldAnalyzerTest
+
+
+
+testAnalyzers
+0.252
+
+
+
TokenPairConcatenatingFilterTest
+
+
+
+testClear
+0.084
+
+
+testExamples
+0.006
+
+
UrlTokenizingFilterTest
+
+
+
+testRandomStrings
+0.625
+
+
+testExamples
+0.009
+
+
+testEmptyTerm
+0.007
+
+
+
XPathNuspecParserTest
+
+
+
+testGoodDocument
+0.009
+
+
+testMissingDocument
+0.079
+
+
+testNotNuspec
+0.029
+
+
+
+
+
NvdCve_1_2_HandlerTest
+
+
+
+testParse
+0.046
+
+
NvdCve_2_0_HandlerTest
+
+
+
+testParse
+0.139
+
+
+
VulnerableSoftwareTest
+
+
+
+testCompareTo
+0
+
+
+testHashCode
+0
+
+
+testEquals
+0
+
+
+
SuppressionHandlerTest
+
+
+
+testHandler
+0.008
+
+
SuppressionParserTest
+
+
+
+testParseSuppressionRules
+0
+
+
+
+
+
DependencyVersionUtilTest
+
+
+
+testParseVersionFromFileName
+0
+
+
DownloaderTest
+
+
+
+testGetLastModified_file
+0
+
+
FileUtilsTest
+
+
+
+testGetFileExtension
+0
+
+
+testDelete
+0
+
+
FilterTest
+
+
+
+testFilter_Iterable
+0
+
+
+testPasses
+0
+
+
diff --git a/dependency-check-core/taglist.html b/dependency-check-core/taglist.html
index 83b95cf31..8392c6e4f 100644
--- a/dependency-check-core/taglist.html
+++ b/dependency-check-core/taglist.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Tag List report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-03-29
+ | Last Published: 2014-04-28
- Version: 1.1.4
+ Version: 1.2.0
@@ -90,7 +90,7 @@
Project Information
-
+
@@ -147,6 +147,13 @@
Surefire Report
+
+
+
+
+ Failsafe Report
+
+
Tag List
@@ -161,16 +168,16 @@
-
+
- CPD Report
+ PMD
-
+
- PMD Report
+ CPD
@@ -252,58 +259,58 @@
Line
- can we get more evidence from the parent? EAR contains module name, etc. analyze the dependency (i.e. extract files) if it is a supported type.
-229
+223
org.owasp.dependencycheck.analyzer.CPEAnalyzer
Line
- likely need to change the split... not sure if this will work for CPE with special chars
-442
+445
the following isn't quite right is it? need to think about this guessing game a bit more.
-528
+531
-org.owasp.dependencycheck.analyzer.CPEAnalyzerTest
+org.owasp.dependencycheck.analyzer.CPEAnalyzerIntegrationTest
Line
- yeah, not a very good test as the results are the same with or without weighting...
-222
+198
fix this assert Assert.assertEquals(expResult, result.get(0).getName());
-230
+206
org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest
Line
review the generated test code and remove the default call to fail. fail("The test case is a prototype.");
-84
+62
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
Line
fix the version problem below
-127
+131
- can we utilize the pom's groupid and artifactId to filter??? most of these are due to low quality data. Other idea would be to say any CPE found based on LOW confidence evidence should have a different CPE type? (this might be a better solution then just removing the URL for "best-guess" matches).
-236
+239
-move this startswith expression to a configuration file?
-245
+move this startsWith expression to a configuration file?
+248
org.owasp.dependencycheck.analyzer.JarAnalyzer
Line
remove weighting
-650
+647
change this to a regex?
-769
+765
org.owasp.dependencycheck.analyzer.JavaScriptAnalyzerTest
Line
improve the assertions assertTrue(depJQ6.getEvidence().size() > 0); assertTrue(depJQ10.getEvidence().size() > 0); assertTrue(depJQ10min.getEvidence().size() > 0);
-125
+103
org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer
Line
@@ -327,19 +334,19 @@
Line
consider utilizing the matchThreeVersion method to get additional results. However, this might also introduce false positives.
-747
+750
org.owasp.dependencycheck.data.update.StandardUpdateIntegrationTest
Line
make this an actual test
-100
+78
org.owasp.dependencycheck.dependency.EvidenceCollection
Line
consider changing the regex to only compare alpha-numeric (i.e. strip everything else)
-233
+237
org.owasp.dependencycheck.utils.DependencyVersion
Line
@@ -351,7 +358,7 @@
Line
add the FTP protocol?
-158
+163
diff --git a/dependency-check-core/xref-test/allclasses-frame.html b/dependency-check-core/xref-test/allclasses-frame.html
index 11fcf00a9..c58b9c26c 100644
--- a/dependency-check-core/xref-test/allclasses-frame.html
+++ b/dependency-check-core/xref-test/allclasses-frame.html
@@ -27,7 +27,7 @@
AnalyzerServiceTest
- ArchiveAnalyzerTest
+ ArchiveAnalyzerIntegrationTest
AssemblyAnalyzerTest
@@ -36,22 +36,25 @@
BaseDBTestCase
- CPEAnalyzerTest
+ BaseTest
+
+
+ CPEAnalyzerIntegrationTest
ChecksumTest
- CveDBMySQLTest
+ CveDBIntegrationTest
- CveDBTest
+ CveDBMySQLTest
CweDBTest
- DatabasePropertiesTest
+ DatabasePropertiesIntegrationTest
DependencyBundlingAnalyzerTest
@@ -91,6 +94,9 @@
FilterTest
+
+
+ HintAnalyzerTest
IndexEntryTest
@@ -126,7 +132,7 @@
PropertyTypeTest
- ReportGeneratorTest
+ ReportGeneratorIntegrationTest
SettingsTest
@@ -153,7 +159,7 @@
UrlTokenizingFilterTest
- VulnerabilitySuppressionAnalyzerTest
+ VulnerabilitySuppressionAnalyzerIntegrationTest
VulnerableSoftwareTest
diff --git a/dependency-check-core/xref-test/index.html b/dependency-check-core/xref-test/index.html
index e68cdab66..617b8c267 100644
--- a/dependency-check-core/xref-test/index.html
+++ b/dependency-check-core/xref-test/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Core 1.1.4 Reference
+ Dependency-Check Core 1.2.0 Reference
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
index 3b21c63f5..09e9e88e1 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
@@ -26,82 +26,75 @@
18 package org.owasp.dependencycheck;
19
20 import org.junit.After;
-21 import org.junit.AfterClass;
-22 import static org.junit.Assert.assertTrue;
-23 import org.junit.Before;
-24 import org.junit.BeforeClass;
-25 import org.junit.Test;
-26 import org.owasp.dependencycheck.data.nvdcve.CveDB;
-27 import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
-28 import org.owasp.dependencycheck.dependency.Dependency;
-29 import org.owasp.dependencycheck.reporting.ReportGenerator;
-30 import org.owasp.dependencycheck.utils.Settings;
-31
-32
-33
-34
-35
-36 public class EngineIntegrationTest {
-37
-38 @BeforeClass
-39 public static void setUpClass() throws Exception {
-40 }
-41
-42 @AfterClass
-43 public static void tearDownClass() throws Exception {
-44 }
-45
-46 @Before
-47 public void setUp() throws Exception {
-48 org.owasp.dependencycheck.data.nvdcve.BaseDBTestCase.ensureDBExists();
-49 }
-50
-51 @After
-52 public void tearDown() {
-53 }
-54
-55
-56
-57
-58
-59
-60 @Test
-61 public void testScan() throws Exception {
-62 String testClasses = "target/test-classes/*.zip" ;
-63 boolean autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
-64 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
-65 Engine instance = new Engine();
-66 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
-67 instance.scan(testClasses);
-68 assertTrue(instance.getDependencies().size() > 0);
-69 for (Dependency d : instance.getDependencies()) {
-70 assertTrue("non-zip file collected " + d.getFileName(), d.getFileName().toLowerCase().endsWith(".zip" ));
-71 }
-72 instance.cleanup();
-73 }
-74
-75
-76
-77
-78
-79
-80 @Test
-81 public void testEngine() throws Exception {
-82 String testClasses = "target/test-classes" ;
-83 Engine instance = new Engine();
-84 instance.scan(testClasses);
-85 assertTrue(instance.getDependencies().size() > 0);
-86 instance.analyzeDependencies();
-87 CveDB cveDB = new CveDB();
-88 cveDB.open();
-89 DatabaseProperties dbProp = cveDB.getDatabaseProperties();
-90 cveDB.close();
-91 ReportGenerator rg = new ReportGenerator("DependencyCheck" ,
-92 instance.getDependencies(), instance.getAnalyzers(), dbProp);
-93 rg.generateReports("./target/" , "ALL" );
-94 instance.cleanup();
-95 }
-96 }
+21 import static org.junit.Assert.assertTrue;
+22 import org.junit.Before;
+23 import org.junit.Test;
+24 import org.owasp.dependencycheck.data.nvdcve.CveDB;
+25 import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
+26 import org.owasp.dependencycheck.dependency.Dependency;
+27 import org.owasp.dependencycheck.reporting.ReportGenerator;
+28 import org.owasp.dependencycheck.utils.Settings;
+29
+30
+31
+32
+33
+34 public class EngineIntegrationTest extends BaseTest {
+35
+36 @Before
+37 public void setUp() throws Exception {
+38 org.owasp.dependencycheck.data.nvdcve.BaseDBTestCase.ensureDBExists();
+39 }
+40
+41 @After
+42 public void tearDown() {
+43 }
+44
+45
+46
+47
+48
+49
+50 @Test
+51 public void testScan() throws Exception {
+52 String testClasses = "target/test-classes/*.zip" ;
+53 boolean autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+54 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+55 Engine instance = new Engine();
+56 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+57 instance.scan(testClasses);
+58 assertTrue(instance.getDependencies().size() > 0);
+59 for (Dependency d : instance.getDependencies()) {
+60 assertTrue("non-zip file collected " + d.getFileName(), d.getFileName().toLowerCase().endsWith(".zip" ));
+61 }
+62 instance.cleanup();
+63 }
+64
+65
+66
+67
+68
+69
+70 @Test
+71 public void testEngine() throws Exception {
+72 String testClasses = "target/test-classes" ;
+73
+74
+75 Engine instance = new Engine();
+76
+77 instance.scan(testClasses);
+78 assertTrue(instance.getDependencies().size() > 0);
+79 instance.analyzeDependencies();
+80 CveDB cveDB = new CveDB();
+81 cveDB.open();
+82 DatabaseProperties dbProp = cveDB.getDatabaseProperties();
+83 cveDB.close();
+84 ReportGenerator rg = new ReportGenerator("DependencyCheck" ,
+85 instance.getDependencies(), instance.getAnalyzers(), dbProp);
+86 rg.generateReports("./target/" , "ALL" );
+87 instance.cleanup();
+88 }
+89 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzerTest.html
index 39b4f0aed..efea6734a 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzerTest.html
@@ -26,50 +26,28 @@
18 package org.owasp.dependencycheck.analyzer;
19
20 import java.util.Set;
-21 import org.junit.After;
-22 import org.junit.AfterClass;
-23 import static org.junit.Assert.assertEquals;
-24 import static org.junit.Assert.assertTrue;
-25 import org.junit.Before;
-26 import org.junit.BeforeClass;
-27 import org.junit.Test;
-28
-29
-30
-31
-32
-33 public class AbstractFileTypeAnalyzerTest {
-34
-35 public AbstractFileTypeAnalyzerTest () {
-36 }
-37
-38 @BeforeClass
-39 public static void setUpClass() throws Exception {
-40 }
-41
-42 @AfterClass
-43 public static void tearDownClass() throws Exception {
-44 }
-45
-46 @Before
-47 public void setUp() {
-48 }
-49
-50 @After
-51 public void tearDown() {
-52 }
-53
-54
-55
-56
-57 @Test
-58 public void testNewHashSet() {
-59 Set result = AbstractFileTypeAnalyzer.newHashSet("one" , "two" );
-60 assertEquals(2, result.size());
-61 assertTrue(result.contains("one" ));
-62 assertTrue(result.contains("two" ));
-63 }
-64 }
+21 import static org.junit.Assert.assertEquals;
+22 import static org.junit.Assert.assertTrue;
+23 import org.junit.Test;
+24 import org.owasp.dependencycheck.BaseTest;
+25
+26
+27
+28
+29
+30 public class AbstractFileTypeAnalyzerTest extends BaseTest {
+31
+32
+33
+34
+35 @Test
+36 public void testNewHashSet() {
+37 Set result = AbstractFileTypeAnalyzer.newHashSet("one" , "two" );
+38 assertEquals(2, result.size());
+39 assertTrue(result.contains("one" ));
+40 assertTrue(result.contains("two" ));
+41 }
+42 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzerTest.html
index d9f06300b..d813ef709 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzerTest.html
@@ -31,102 +31,85 @@
23 import java.util.Set;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
-26 import org.junit.After;
-27 import org.junit.AfterClass;
-28 import static org.junit.Assert.assertEquals;
-29 import static org.junit.Assert.assertNull;
-30 import org.junit.Before;
-31 import org.junit.BeforeClass;
-32 import org.junit.Test;
-33 import org.owasp.dependencycheck.Engine;
-34 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
-35 import org.owasp.dependencycheck.dependency.Dependency;
-36 import org.owasp.dependencycheck.suppression.SuppressionRule;
-37 import org.owasp.dependencycheck.utils.Settings;
-38
-39
-40
-41
-42
-43 public class AbstractSuppressionAnalyzerTest {
-44
-45 public AbstractSuppressionAnalyzerTest () {
-46 }
-47
-48 @BeforeClass
-49 public static void setUpClass() {
-50 }
-51
-52 @AfterClass
-53 public static void tearDownClass() {
-54 }
-55
-56 @Before
-57 public void setUp() {
-58 try {
-59 final String uri = this .getClass().getClassLoader().getResource("suppressions.xml" ).toURI().toURL().toString();
-60 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, uri);
-61 } catch (URISyntaxException ex) {
-62 Logger.getLogger(AbstractSuppressionAnalyzerTest.class .getName()).log(Level.SEVERE, null , ex);
-63 } catch (MalformedURLException ex) {
-64 Logger.getLogger(AbstractSuppressionAnalyzerTest.class .getName()).log(Level.SEVERE, null , ex);
-65 }
-66 }
-67
-68 @After
-69 public void tearDown() {
-70 }
-71
-72
-73
-74
-75 @Test
-76 public void testGetSupportedExtensions() {
-77 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
-78 Set<String> result = instance.getSupportedExtensions();
-79 assertNull(result);
-80 }
-81
-82
-83
-84
-85 @Test
-86 public void testInitialize() throws Exception {
-87 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
-88 instance.initialize();
-89 }
-90
-91
-92
-93
-94 @Test
-95 public void testGetRules() throws Exception {
-96 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
-97 instance.initialize();
-98 int expCount = 5;
-99 List<SuppressionRule> result = instance.getRules();
-100 assertEquals(expCount, result.size());
-101 }
-102
-103 public class AbstractSuppressionAnalyzerImpl extends AbstractSuppressionAnalyzer {
-104
-105 @Override
-106 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
-107 throw new UnsupportedOperationException("Not supported yet." );
-108 }
-109
-110 @Override
-111 public String getName() {
-112 throw new UnsupportedOperationException("Not supported yet." );
-113 }
-114
-115 @Override
-116 public AnalysisPhase getAnalysisPhase() {
-117 throw new UnsupportedOperationException("Not supported yet." );
-118 }
-119 }
-120
-121 }
+26 import static org.junit.Assert.assertEquals;
+27 import static org.junit.Assert.assertNull;
+28 import org.junit.Before;
+29 import org.junit.Test;
+30 import org.owasp.dependencycheck.BaseTest;
+31 import org.owasp.dependencycheck.Engine;
+32 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
+33 import org.owasp.dependencycheck.dependency.Dependency;
+34 import org.owasp.dependencycheck.suppression.SuppressionRule;
+35 import org.owasp.dependencycheck.utils.Settings;
+36
+37
+38
+39
+40
+41 public class AbstractSuppressionAnalyzerTest extends BaseTest {
+42
+43 @Before
+44 public void setUp() throws Exception {
+45 try {
+46 final String uri = this .getClass().getClassLoader().getResource("suppressions.xml" ).toURI().toURL().toString();
+47 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, uri);
+48 } catch (URISyntaxException ex) {
+49 Logger.getLogger(AbstractSuppressionAnalyzerTest.class .getName()).log(Level.SEVERE, null , ex);
+50 } catch (MalformedURLException ex) {
+51 Logger.getLogger(AbstractSuppressionAnalyzerTest.class .getName()).log(Level.SEVERE, null , ex);
+52 }
+53 }
+54
+55
+56
+57
+58 @Test
+59 public void testGetSupportedExtensions() {
+60 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
+61 Set<String> result = instance.getSupportedExtensions();
+62 assertNull(result);
+63 }
+64
+65
+66
+67
+68 @Test
+69 public void testInitialize() throws Exception {
+70 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
+71 instance.initialize();
+72 }
+73
+74
+75
+76
+77 @Test
+78 public void testGetRules() throws Exception {
+79 AbstractSuppressionAnalyzer instance = new AbstractSuppressionAnalyzerImpl ();
+80 instance.initialize();
+81 int expCount = 5;
+82 List<SuppressionRule> result = instance.getRules();
+83 assertEquals(expCount, result.size());
+84 }
+85
+86 public class AbstractSuppressionAnalyzerImpl extends AbstractSuppressionAnalyzer {
+87
+88 @Override
+89 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+90 throw new UnsupportedOperationException("Not supported yet." );
+91 }
+92
+93 @Override
+94 public String getName() {
+95 throw new UnsupportedOperationException("Not supported yet." );
+96 }
+97
+98 @Override
+99 public AnalysisPhase getAnalysisPhase() {
+100 throw new UnsupportedOperationException("Not supported yet." );
+101 }
+102 }
+103
+104 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AnalyzerServiceTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AnalyzerServiceTest.html
index ad10b55a4..f7112af8a 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AnalyzerServiceTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AnalyzerServiceTest.html
@@ -26,56 +26,34 @@
18 package org.owasp.dependencycheck.analyzer;
19
20 import java.util.Iterator;
-21 import org.junit.After;
-22 import org.junit.AfterClass;
-23 import static org.junit.Assert.assertTrue;
-24 import org.junit.Before;
-25 import org.junit.BeforeClass;
-26 import org.junit.Test;
-27
-28
-29
-30
-31
-32 public class AnalyzerServiceTest {
-33
-34 public AnalyzerServiceTest () {
-35 }
-36
-37 @BeforeClass
-38 public static void setUpClass() throws Exception {
-39 }
-40
-41 @AfterClass
-42 public static void tearDownClass() throws Exception {
-43 }
-44
-45 @Before
-46 public void setUp() {
+21 import static org.junit.Assert.assertTrue;
+22 import org.junit.Test;
+23 import org.owasp.dependencycheck.BaseTest;
+24
+25
+26
+27
+28
+29 public class AnalyzerServiceTest extends BaseTest {
+30
+31
+32
+33
+34 @Test
+35 public void testGetAnalyzers() {
+36 AnalyzerService instance = new AnalyzerService(Thread.currentThread().getContextClassLoader());
+37 Iterator<Analyzer> result = instance.getAnalyzers();
+38
+39 boolean found = false;
+40 while (result.hasNext()) {
+41 Analyzer a = result.next();
+42 if ("Jar Analyzer" .equals(a.getName())) {
+43 found = true ;
+44 }
+45 }
+46 assertTrue("JarAnalyzer loaded" , found);
47 }
-48
-49 @After
-50 public void tearDown() {
-51 }
-52
-53
-54
-55
-56 @Test
-57 public void testGetAnalyzers() {
-58 AnalyzerService instance = AnalyzerService.getInstance();
-59 Iterator<Analyzer> result = instance.getAnalyzers();
-60
-61 boolean found = false;
-62 while (result.hasNext()) {
-63 Analyzer a = result.next();
-64 if ("Jar Analyzer" .equals(a.getName())) {
-65 found = true ;
-66 }
-67 }
-68 assertTrue("JarAnalyzer loaded" , found);
-69 }
-70 }
+48 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AssemblyAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AssemblyAnalyzerTest.html
index 5a964fa74..13eeeff5c 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AssemblyAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/AssemblyAnalyzerTest.html
@@ -25,162 +25,165 @@
17
18 package org.owasp.dependencycheck.analyzer;
19
-20 import static org.junit.Assert.assertEquals;
-21 import static org.junit.Assert.assertTrue;
-22 import static org.junit.Assert.fail;
-23 import static org.junit.Assume.assumeFalse;
-24
-25 import java.io.File;
-26 import java.util.logging.Level;
-27 import java.util.logging.Logger;
-28
-29 import org.junit.After;
-30 import org.junit.Assume;
-31 import org.junit.Before;
-32 import org.junit.Test;
-33 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
-34 import org.owasp.dependencycheck.dependency.Confidence;
-35 import org.owasp.dependencycheck.dependency.Dependency;
-36 import org.owasp.dependencycheck.dependency.Evidence;
-37 import org.owasp.dependencycheck.utils.Settings;
-38
-39
-40
-41
-42
-43
-44
-45 public class AssemblyAnalyzerTest {
-46
-47 private static final Logger LOGGER = Logger.getLogger(AssemblyAnalyzerTest.class .getName());
-48
-49 AssemblyAnalyzer analyzer;
-50
-51
-52
-53
-54
-55
-56 @Before
-57 public void setUp() {
-58 try {
-59 analyzer = new AssemblyAnalyzer();
-60 analyzer.supportsExtension("dll" );
-61 analyzer.initialize();
-62 } catch (Exception e) {
-63 LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete" , e);
-64 Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE" , e);
-65 }
-66 }
-67
-68
-69
-70
-71 @Test
-72 public void testGetName() {
-73 assertEquals("Assembly Analyzer" , analyzer.getName());
-74 }
-75
-76 @Test
-77 public void testAnalysis() throws Exception {
-78 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("GrokAssembly.exe" ).getPath());
-79 Dependency d = new Dependency(f);
-80 analyzer.analyze(d, null );
-81 boolean foundVendor = false;
-82 for (Evidence e : d.getVendorEvidence().getEvidence("grokassembly" , "vendor" )) {
-83 if ("OWASP" .equals(e.getValue())) {
-84 foundVendor = true ;
-85 }
-86 }
-87 assertTrue(foundVendor);
-88
-89 boolean foundProduct = false;
-90 for (Evidence e : d.getProductEvidence().getEvidence("grokassembly" , "product" )) {
-91 if ("GrokAssembly" .equals(e.getValue())) {
-92 foundProduct = true ;
-93 }
-94 }
-95 assertTrue(foundProduct);
-96 }
-97
-98 @Test
-99 public void testLog4Net() throws Exception {
-100 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("log4net.dll" ).getPath());
-101 Dependency d = new Dependency(f);
-102 analyzer.analyze(d, null );
-103 assertTrue(d.getVersionEvidence().getEvidence().contains(new Evidence("grokassembly" , "version" , "1.2.13.0" , Confidence.HIGHEST)));
-104 assertTrue(d.getVendorEvidence().getEvidence().contains(new Evidence("grokassembly" , "vendor" , "The Apache Software Foundation" , Confidence.HIGH)));
-105 assertTrue(d.getProductEvidence().getEvidence().contains(new Evidence("grokassembly" , "product" , "log4net" , Confidence.HIGH)));
-106 }
-107
-108 @Test
-109 public void testNonexistent() {
-110 Level oldLevel = Logger.getLogger(AssemblyAnalyzer.class .getName()).getLevel();
-111 Level oldDependency = Logger.getLogger(Dependency.class .getName()).getLevel();
-112
-113 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(Level.OFF);
-114 Logger.getLogger(Dependency.class .getName()).setLevel(Level.OFF);
-115 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("log4net.dll" ).getPath());
-116 File test = new File(f.getParent(), "nonexistent.dll" );
-117 Dependency d = new Dependency(test);
-118
-119 try {
-120 analyzer.analyze(d, null );
-121 fail("Expected an AnalysisException" );
-122 } catch (AnalysisException ae) {
-123 assertEquals("File does not exist" , ae.getMessage());
-124 } finally {
-125 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(oldLevel);
-126 Logger.getLogger(Dependency.class .getName()).setLevel(oldDependency);
-127 }
-128 }
-129
-130 @Test
-131 public void testWithSettingMono() throws Exception {
+20 import java.io.File;
+21 import java.util.logging.Level;
+22 import java.util.logging.Logger;
+23 import org.junit.After;
+24 import static org.junit.Assert.assertEquals;
+25 import static org.junit.Assert.assertTrue;
+26 import static org.junit.Assert.fail;
+27 import org.junit.Assume;
+28 import static org.junit.Assume.assumeFalse;
+29 import org.junit.Before;
+30 import org.junit.Test;
+31 import org.owasp.dependencycheck.BaseTest;
+32 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
+33 import org.owasp.dependencycheck.dependency.Confidence;
+34 import org.owasp.dependencycheck.dependency.Dependency;
+35 import org.owasp.dependencycheck.dependency.Evidence;
+36 import org.owasp.dependencycheck.utils.Settings;
+37
+38
+39
+40
+41
+42
+43
+44 public class AssemblyAnalyzerTest extends BaseTest {
+45
+46 private static final Logger LOGGER = Logger.getLogger(AssemblyAnalyzerTest.class .getName());
+47
+48 AssemblyAnalyzer analyzer;
+49
+50
+51
+52
+53
+54
+55 @Before
+56 public void setUp() throws Exception {
+57 try {
+58 analyzer = new AssemblyAnalyzer();
+59 analyzer.supportsExtension("dll" );
+60 analyzer.initialize();
+61 } catch (Exception e) {
+62 if (e.getMessage().contains("Could not execute .NET AssemblyAnalyzer" )) {
+63 LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete" );
+64 } else {
+65 LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete" , e);
+66 }
+67 Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE" , e);
+68 }
+69 }
+70
+71
+72
+73
+74 @Test
+75 public void testGetName() {
+76 assertEquals("Assembly Analyzer" , analyzer.getName());
+77 }
+78
+79 @Test
+80 public void testAnalysis() throws Exception {
+81 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("GrokAssembly.exe" ).getPath());
+82 Dependency d = new Dependency(f);
+83 analyzer.analyze(d, null );
+84 boolean foundVendor = false;
+85 for (Evidence e : d.getVendorEvidence().getEvidence("grokassembly" , "vendor" )) {
+86 if ("OWASP" .equals(e.getValue())) {
+87 foundVendor = true ;
+88 }
+89 }
+90 assertTrue(foundVendor);
+91
+92 boolean foundProduct = false;
+93 for (Evidence e : d.getProductEvidence().getEvidence("grokassembly" , "product" )) {
+94 if ("GrokAssembly" .equals(e.getValue())) {
+95 foundProduct = true ;
+96 }
+97 }
+98 assertTrue(foundProduct);
+99 }
+100
+101 @Test
+102 public void testLog4Net() throws Exception {
+103 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("log4net.dll" ).getPath());
+104 Dependency d = new Dependency(f);
+105 analyzer.analyze(d, null );
+106 assertTrue(d.getVersionEvidence().getEvidence().contains(new Evidence("grokassembly" , "version" , "1.2.13.0" , Confidence.HIGHEST)));
+107 assertTrue(d.getVendorEvidence().getEvidence().contains(new Evidence("grokassembly" , "vendor" , "The Apache Software Foundation" , Confidence.HIGH)));
+108 assertTrue(d.getProductEvidence().getEvidence().contains(new Evidence("grokassembly" , "product" , "log4net" , Confidence.HIGH)));
+109 }
+110
+111 @Test
+112 public void testNonexistent() {
+113 Level oldLevel = Logger.getLogger(AssemblyAnalyzer.class .getName()).getLevel();
+114 Level oldDependency = Logger.getLogger(Dependency.class .getName()).getLevel();
+115
+116 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(Level.OFF);
+117 Logger.getLogger(Dependency.class .getName()).setLevel(Level.OFF);
+118 File f = new File(AssemblyAnalyzerTest.class .getClassLoader().getResource("log4net.dll" ).getPath());
+119 File test = new File(f.getParent(), "nonexistent.dll" );
+120 Dependency d = new Dependency(test);
+121
+122 try {
+123 analyzer.analyze(d, null );
+124 fail("Expected an AnalysisException" );
+125 } catch (AnalysisException ae) {
+126 assertEquals("File does not exist" , ae.getMessage());
+127 } finally {
+128 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(oldLevel);
+129 Logger.getLogger(Dependency.class .getName()).setLevel(oldDependency);
+130 }
+131 }
132
-133
-134 assumeFalse(System.getProperty("os.name" ).startsWith("Windows" ));
+133 @Test
+134 public void testWithSettingMono() throws Exception {
135
-136 String oldValue = Settings.getString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH);
-137
-138
-139
-140
-141 if (oldValue == null ) {
-142 System.setProperty(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, "/yooser/bine/mono" );
-143 } else {
-144 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, "/yooser/bine/mono" );
-145 }
-146
-147 Level oldLevel = Logger.getLogger(AssemblyAnalyzer.class .getName()).getLevel();
-148 try {
-149
-150 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(Level.OFF);
-151
-152 AssemblyAnalyzer aanalyzer = new AssemblyAnalyzer();
-153 aanalyzer.supportsExtension("dll" );
-154 aanalyzer.initialize();
-155 fail("Expected an AnalysisException" );
-156 } catch (AnalysisException ae) {
-157 assertEquals("An error occured with the .NET AssemblyAnalyzer" , ae.getMessage());
-158 } finally {
-159
-160 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(oldLevel);
-161
-162
-163 if (oldValue == null ) {
-164 System.getProperties().remove(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH);
-165 } else {
-166 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, oldValue);
-167 }
-168 }
-169 }
-170
-171 @After
-172 public void tearDown() throws Exception {
-173 analyzer.close();
-174 }
-175 }
+136
+137 assumeFalse(System.getProperty("os.name" ).startsWith("Windows" ));
+138
+139 String oldValue = Settings.getString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH);
+140
+141
+142
+143
+144 if (oldValue == null ) {
+145 System.setProperty(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, "/yooser/bine/mono" );
+146 } else {
+147 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, "/yooser/bine/mono" );
+148 }
+149
+150 Level oldLevel = Logger.getLogger(AssemblyAnalyzer.class .getName()).getLevel();
+151 try {
+152
+153 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(Level.OFF);
+154
+155 AssemblyAnalyzer aanalyzer = new AssemblyAnalyzer();
+156 aanalyzer.supportsExtension("dll" );
+157 aanalyzer.initialize();
+158 fail("Expected an AnalysisException" );
+159 } catch (AnalysisException ae) {
+160 assertEquals("An error occured with the .NET AssemblyAnalyzer" , ae.getMessage());
+161 } finally {
+162
+163 Logger.getLogger(AssemblyAnalyzer.class .getName()).setLevel(oldLevel);
+164
+165
+166 if (oldValue == null ) {
+167 System.getProperties().remove(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH);
+168 } else {
+169 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, oldValue);
+170 }
+171 }
+172 }
+173
+174 @After
+175 public void tearDown() throws Exception {
+176 analyzer.close();
+177 }
+178 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
index 1e7f1efad..21c8f9093 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
@@ -25,98 +25,76 @@
17
18 package org.owasp.dependencycheck.analyzer;
19
-20 import org.junit.After;
-21 import org.junit.AfterClass;
-22 import static org.junit.Assert.assertEquals;
-23 import org.junit.Before;
-24 import org.junit.BeforeClass;
-25 import org.junit.Test;
-26 import org.owasp.dependencycheck.dependency.Dependency;
-27
-28
-29
-30
-31
-32 public class DependencyBundlingAnalyzerTest {
-33
-34 public DependencyBundlingAnalyzerTest () {
-35 }
-36
-37 @BeforeClass
-38 public static void setUpClass() {
-39 }
-40
-41 @AfterClass
-42 public static void tearDownClass() {
-43 }
-44
-45 @Before
-46 public void setUp() {
-47 }
-48
-49 @After
-50 public void tearDown() {
+20 import static org.junit.Assert.assertEquals;
+21 import org.junit.Test;
+22 import org.owasp.dependencycheck.BaseTest;
+23 import org.owasp.dependencycheck.dependency.Dependency;
+24
+25
+26
+27
+28
+29 public class DependencyBundlingAnalyzerTest extends BaseTest {
+30
+31
+32
+33
+34 @Test
+35 public void testGetName() {
+36 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
+37 String expResult = "Dependency Bundling Analyzer" ;
+38 String result = instance.getName();
+39 assertEquals(expResult, result);
+40 }
+41
+42
+43
+44
+45 @Test
+46 public void testGetAnalysisPhase() {
+47 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
+48 AnalysisPhase expResult = AnalysisPhase.PRE_FINDING_ANALYSIS;
+49 AnalysisPhase result = instance.getAnalysisPhase();
+50 assertEquals(expResult, result);
51 }
52
53
-54
+54
55
56 @Test
-57 public void testGetName() {
-58 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
-59 String expResult = "Dependency Bundling Analyzer" ;
-60 String result = instance.getName();
-61 assertEquals(expResult, result);
-62 }
-63
-64
-65
-66
-67 @Test
-68 public void testGetAnalysisPhase() {
-69 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
-70 AnalysisPhase expResult = AnalysisPhase.PRE_FINDING_ANALYSIS;
-71 AnalysisPhase result = instance.getAnalysisPhase();
-72 assertEquals(expResult, result);
-73 }
-74
-75
-76
-77
-78 @Test
-79 public void testAnalyze() throws Exception {
-80
-81
-82
-83
-84
-85
-86 }
-87
-88
-89
-90
-91 @Test
-92 public void testIsCore() {
-93 Dependency left = new Dependency();
-94 Dependency right = new Dependency();
-95
-96 left.setFileName("axis2-kernel-1.4.1.jar" );
-97 right.setFileName("axis2-adb-1.4.1.jar" );
-98 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
-99 boolean expResult = true ;
-100 boolean result = instance.isCore(left, right);
-101 assertEquals(expResult, result);
-102
-103 left.setFileName("struts-1.2.7.jar" );
-104 right.setFileName("file.tar.gz\\file.tar\\struts.jar" );
-105
-106 expResult = true ;
-107 result = instance.isCore(left, right);
-108 assertEquals(expResult, result);
-109 }
-110
-111 }
+57 public void testAnalyze() throws Exception {
+58
+59
+60
+61
+62
+63
+64 }
+65
+66
+67
+68
+69 @Test
+70 public void testIsCore() {
+71 Dependency left = new Dependency();
+72 Dependency right = new Dependency();
+73
+74 left.setFileName("axis2-kernel-1.4.1.jar" );
+75 right.setFileName("axis2-adb-1.4.1.jar" );
+76 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
+77 boolean expResult = true ;
+78 boolean result = instance.isCore(left, right);
+79 assertEquals(expResult, result);
+80
+81 left.setFileName("struts-1.2.7.jar" );
+82 right.setFileName("file.tar.gz\\file.tar\\struts.jar" );
+83
+84 expResult = true ;
+85 result = instance.isCore(left, right);
+86 assertEquals(expResult, result);
+87 }
+88
+89 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzerTest.html
index c3645d231..81ee03a6b 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzerTest.html
@@ -23,80 +23,57 @@
15
16 package org.owasp.dependencycheck.analyzer;
17
-18 import org.junit.After;
-19 import org.junit.AfterClass;
-20 import static org.junit.Assert.assertEquals;
-21 import static org.junit.Assert.assertTrue;
-22 import org.junit.Before;
-23 import org.junit.BeforeClass;
-24 import org.junit.Test;
-25 import org.owasp.dependencycheck.Engine;
-26 import org.owasp.dependencycheck.dependency.Dependency;
-27
-28
-29
-30
-31
-32 public class FalsePositiveAnalyzerTest {
-33
-34 public FalsePositiveAnalyzerTest () {
-35 }
-36
-37 @BeforeClass
-38 public static void setUpClass() {
+18 import static org.junit.Assert.assertEquals;
+19 import static org.junit.Assert.assertTrue;
+20 import org.junit.Test;
+21 import org.owasp.dependencycheck.Engine;
+22 import org.owasp.dependencycheck.dependency.Dependency;
+23
+24
+25
+26
+27
+28 public class FalsePositiveAnalyzerTest {
+29
+30
+31
+32
+33 @Test
+34 public void testGetName() {
+35 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
+36 String expResult = "False Positive Analyzer" ;
+37 String result = instance.getName();
+38 assertEquals(expResult, result);
39 }
40
-41 @AfterClass
-42 public static void tearDownClass() {
-43 }
-44
-45 @Before
-46 public void setUp() {
-47 }
-48
-49 @After
-50 public void tearDown() {
-51 }
-52
-53
-54
-55
-56 @Test
-57 public void testGetName() {
-58 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
-59 String expResult = "False Positive Analyzer" ;
-60 String result = instance.getName();
-61 assertEquals(expResult, result);
-62 }
-63
-64
-65
-66
-67 @Test
-68 public void testGetAnalysisPhase() {
-69 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
-70 AnalysisPhase expResult = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
-71 AnalysisPhase result = instance.getAnalysisPhase();
-72 assertEquals(expResult, result);
-73 }
-74
-75
-76
-77
-78 @Test
-79 public void testAnalyze() throws Exception {
-80 Dependency dependency = new Dependency();
-81 dependency.setFileName("pom.xml" );
-82 dependency.addIdentifier("cpe" , "cpe:/a:file:file:1.2.1" , "http://some.org/url" );
-83 Engine engine = null ;
-84 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
-85 int before = dependency.getIdentifiers().size();
-86 instance.analyze(dependency, engine);
-87 int after = dependency.getIdentifiers().size();
-88 assertTrue(before > after);
-89 }
-90
-91 }
+41
+42
+43
+44 @Test
+45 public void testGetAnalysisPhase() {
+46 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
+47 AnalysisPhase expResult = AnalysisPhase.POST_IDENTIFIER_ANALYSIS;
+48 AnalysisPhase result = instance.getAnalysisPhase();
+49 assertEquals(expResult, result);
+50 }
+51
+52
+53
+54
+55 @Test
+56 public void testAnalyze() throws Exception {
+57 Dependency dependency = new Dependency();
+58 dependency.setFileName("pom.xml" );
+59 dependency.addIdentifier("cpe" , "cpe:/a:file:file:1.2.1" , "http://some.org/url" );
+60 Engine engine = null ;
+61 FalsePositiveAnalyzer instance = new FalsePositiveAnalyzer();
+62 int before = dependency.getIdentifiers().size();
+63 instance.analyze(dependency, engine);
+64 int after = dependency.getIdentifiers().size();
+65 assertTrue(before > after);
+66 }
+67
+68 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FileNameAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FileNameAnalyzerTest.html
index 8152d5296..ad1279db5 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FileNameAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/FileNameAnalyzerTest.html
@@ -26,100 +26,77 @@
18 package org.owasp.dependencycheck.analyzer;
19
20 import java.io.File;
-21 import org.junit.After;
-22 import org.junit.AfterClass;
-23 import static org.junit.Assert.assertEquals;
-24 import static org.junit.Assert.assertTrue;
-25 import org.junit.Before;
-26 import org.junit.BeforeClass;
-27 import org.junit.Test;
-28 import org.owasp.dependencycheck.dependency.Dependency;
-29
-30
-31
-32
-33
-34 public class FileNameAnalyzerTest {
-35
-36 public FileNameAnalyzerTest () {
-37 }
-38
-39 @BeforeClass
-40 public static void setUpClass() throws Exception {
+21 import static org.junit.Assert.assertEquals;
+22 import static org.junit.Assert.assertTrue;
+23 import org.junit.Test;
+24 import org.owasp.dependencycheck.dependency.Dependency;
+25
+26
+27
+28
+29
+30 public class FileNameAnalyzerTest {
+31
+32
+33
+34
+35 @Test
+36 public void testGetName() {
+37 FileNameAnalyzer instance = new FileNameAnalyzer();
+38 String expResult = "File Name Analyzer" ;
+39 String result = instance.getName();
+40 assertEquals(expResult, result);
41 }
42
-43 @AfterClass
-44 public static void tearDownClass() throws Exception {
-45 }
-46
-47 @Before
-48 public void setUp() {
-49 }
-50
-51 @After
-52 public void tearDown() {
-53 }
-54
-55
-56
-57
-58 @Test
-59 public void testGetName() {
-60 FileNameAnalyzer instance = new FileNameAnalyzer();
-61 String expResult = "File Name Analyzer" ;
-62 String result = instance.getName();
-63 assertEquals(expResult, result);
-64 }
-65
-66
-67
-68
-69 @Test
-70 public void testGetAnalysisPhase() {
-71 FileNameAnalyzer instance = new FileNameAnalyzer();
-72 AnalysisPhase expResult = AnalysisPhase.INFORMATION_COLLECTION;
-73 AnalysisPhase result = instance.getAnalysisPhase();
-74 assertEquals(expResult, result);
-75 }
-76
-77
-78
-79
-80 @Test
-81 public void testAnalyze() throws Exception {
-82 File struts = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
-83 Dependency resultStruts = new Dependency(struts);
-84 File axis = new File(this .getClass().getClassLoader().getResource("axis2-adb-1.4.1.jar" ).getPath());
-85 Dependency resultAxis = new Dependency(axis);
-86 FileNameAnalyzer instance = new FileNameAnalyzer();
-87 instance.analyze(resultStruts, null );
-88 assertTrue(resultStruts.getVendorEvidence().toString().toLowerCase().contains("struts" ));
-89
-90 instance.analyze(resultAxis, null );
-91 assertTrue(resultStruts.getVersionEvidence().toString().toLowerCase().contains("2.1.2" ));
-92
-93 }
-94
-95
-96
-97
-98 @Test
-99 public void testInitialize() throws Exception {
-100 FileNameAnalyzer instance = new FileNameAnalyzer();
-101 instance.initialize();
-102 assertTrue(true );
-103 }
-104
-105
-106
-107
-108 @Test
-109 public void testClose() throws Exception {
-110 FileNameAnalyzer instance = new FileNameAnalyzer();
-111 instance.close();
-112 assertTrue(true );
-113 }
-114 }
+43
+44
+45
+46 @Test
+47 public void testGetAnalysisPhase() {
+48 FileNameAnalyzer instance = new FileNameAnalyzer();
+49 AnalysisPhase expResult = AnalysisPhase.INFORMATION_COLLECTION;
+50 AnalysisPhase result = instance.getAnalysisPhase();
+51 assertEquals(expResult, result);
+52 }
+53
+54
+55
+56
+57 @Test
+58 public void testAnalyze() throws Exception {
+59 File struts = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
+60 Dependency resultStruts = new Dependency(struts);
+61 File axis = new File(this .getClass().getClassLoader().getResource("axis2-adb-1.4.1.jar" ).getPath());
+62 Dependency resultAxis = new Dependency(axis);
+63 FileNameAnalyzer instance = new FileNameAnalyzer();
+64 instance.analyze(resultStruts, null );
+65 assertTrue(resultStruts.getVendorEvidence().toString().toLowerCase().contains("struts" ));
+66
+67 instance.analyze(resultAxis, null );
+68 assertTrue(resultStruts.getVersionEvidence().toString().toLowerCase().contains("2.1.2" ));
+69
+70 }
+71
+72
+73
+74
+75 @Test
+76 public void testInitialize() throws Exception {
+77 FileNameAnalyzer instance = new FileNameAnalyzer();
+78 instance.initialize();
+79 assertTrue(true );
+80 }
+81
+82
+83
+84
+85 @Test
+86 public void testClose() throws Exception {
+87 FileNameAnalyzer instance = new FileNameAnalyzer();
+88 instance.close();
+89 assertTrue(true );
+90 }
+91 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
index 472251c72..f3a8d55fc 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
@@ -29,142 +29,120 @@
21 import java.util.HashSet;
22 import java.util.Properties;
23 import java.util.Set;
-24 import org.junit.After;
-25 import org.junit.AfterClass;
-26 import static org.junit.Assert.assertEquals;
-27 import static org.junit.Assert.assertTrue;
-28 import org.junit.Before;
-29 import org.junit.BeforeClass;
-30 import org.junit.Test;
-31 import org.owasp.dependencycheck.dependency.Dependency;
-32 import org.owasp.dependencycheck.dependency.Evidence;
-33
-34
-35
-36
-37
-38 public class JarAnalyzerTest {
-39
-40 public JarAnalyzerTest () {
-41 }
-42
-43 @BeforeClass
-44 public static void setUpClass() throws Exception {
-45 }
-46
-47 @AfterClass
-48 public static void tearDownClass() throws Exception {
-49 }
+24 import static org.junit.Assert.assertEquals;
+25 import static org.junit.Assert.assertTrue;
+26 import org.junit.Test;
+27 import org.owasp.dependencycheck.BaseTest;
+28 import org.owasp.dependencycheck.dependency.Dependency;
+29 import org.owasp.dependencycheck.dependency.Evidence;
+30
+31
+32
+33
+34
+35 public class JarAnalyzerTest extends BaseTest {
+36
+37
+38
+39
+40
+41
+42 @Test
+43 public void testAnalyze() throws Exception {
+44 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
+45 Dependency result = new Dependency(file);
+46 JarAnalyzer instance = new JarAnalyzer();
+47 instance.analyze(result, null );
+48 assertTrue(result.getVendorEvidence().toString().toLowerCase().contains("apache" ));
+49 assertTrue(result.getVendorEvidence().getWeighting().contains("apache" ));
50
-51 @Before
-52 public void setUp() {
-53 }
-54
-55 @After
-56 public void tearDown() {
-57 }
-58
-59
-60
-61
-62
-63
-64 @Test
-65 public void testAnalyze() throws Exception {
-66 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
-67 Dependency result = new Dependency(file);
-68 JarAnalyzer instance = new JarAnalyzer();
-69 instance.analyze(result, null );
-70 assertTrue(result.getVendorEvidence().toString().toLowerCase().contains("apache" ));
-71 assertTrue(result.getVendorEvidence().getWeighting().contains("apache" ));
-72
-73 file = new File(this .getClass().getClassLoader().getResource("org.mortbay.jetty.jar" ).getPath());
-74 result = new Dependency(file);
-75 instance.analyze(result, null );
-76 boolean found = false;
-77 for (Evidence e : result.getProductEvidence()) {
-78 if (e.getName().equalsIgnoreCase("package-title" )
-79 && e.getValue().equalsIgnoreCase("org.mortbay.http" )) {
-80 found = true ;
-81 break ;
-82 }
-83 }
-84 assertTrue("package-title of org.mortbay.http not found in org.mortbay.jetty.jar" , found);
-85
-86 found = false;
-87 for (Evidence e : result.getVendorEvidence()) {
-88 if (e.getName().equalsIgnoreCase("implementation-url" )
-89 && e.getValue().equalsIgnoreCase("http://jetty.mortbay.org" )) {
-90 found = true ;
-91 break ;
-92 }
-93 }
-94 assertTrue("implementation-url of http://jetty.mortbay.org not found in org.mortbay.jetty.jar" , found);
-95
-96 found = false;
-97 for (Evidence e : result.getVersionEvidence()) {
-98 if (e.getName().equalsIgnoreCase("Implementation-Version" )
-99 && e.getValue().equalsIgnoreCase("4.2.27" )) {
-100 found = true ;
-101 break ;
-102 }
-103 }
-104 assertTrue("implementation-version of 4.2.27 not found in org.mortbay.jetty.jar" , found);
-105
-106 file = new File(this .getClass().getClassLoader().getResource("org.mortbay.jmx.jar" ).getPath());
-107 result = new Dependency(file);
-108 instance.analyze(result, null );
-109 assertEquals("org.mortbar,jmx.jar has version evidence?" , result.getVersionEvidence().size(), 0);
-110 }
-111
-112
-113
-114
-115 @Test
-116 public void testGetSupportedExtensions() {
-117 JarAnalyzer instance = new JarAnalyzer();
-118 Set expResult = new HashSet();
-119 expResult.add("jar" );
-120 expResult.add("war" );
-121 Set result = instance.getSupportedExtensions();
-122 assertEquals(expResult, result);
-123 }
-124
-125
-126
-127
-128 @Test
-129 public void testGetName() {
-130 JarAnalyzer instance = new JarAnalyzer();
-131 String expResult = "Jar Analyzer" ;
-132 String result = instance.getName();
-133 assertEquals(expResult, result);
-134 }
-135
-136
-137
-138
-139 @Test
-140 public void testSupportsExtension() {
-141 String extension = "jar" ;
-142 JarAnalyzer instance = new JarAnalyzer();
-143 boolean expResult = true ;
-144 boolean result = instance.supportsExtension(extension);
-145 assertEquals(expResult, result);
-146 }
-147
-148 @Test
-149 public void testInterpolateString() {
-150 Properties prop = new Properties();
-151 prop.setProperty("key" , "value" );
-152 prop.setProperty("nested" , "nested ${key}" );
-153 String text = "This is a test of '${key}' '${nested}'" ;
-154 String expResults = "This is a test of 'value' 'nested value'" ;
-155 JarAnalyzer instance = new JarAnalyzer();
-156 String results = instance.interpolateString(text, prop);
-157 assertEquals(expResults, results);
-158 }
-159 }
+51 file = new File(this .getClass().getClassLoader().getResource("org.mortbay.jetty.jar" ).getPath());
+52 result = new Dependency(file);
+53 instance.analyze(result, null );
+54 boolean found = false;
+55 for (Evidence e : result.getProductEvidence()) {
+56 if (e.getName().equalsIgnoreCase("package-title" )
+57 && e.getValue().equalsIgnoreCase("org.mortbay.http" )) {
+58 found = true ;
+59 break ;
+60 }
+61 }
+62 assertTrue("package-title of org.mortbay.http not found in org.mortbay.jetty.jar" , found);
+63
+64 found = false;
+65 for (Evidence e : result.getVendorEvidence()) {
+66 if (e.getName().equalsIgnoreCase("implementation-url" )
+67 && e.getValue().equalsIgnoreCase("http://jetty.mortbay.org" )) {
+68 found = true ;
+69 break ;
+70 }
+71 }
+72 assertTrue("implementation-url of http://jetty.mortbay.org not found in org.mortbay.jetty.jar" , found);
+73
+74 found = false;
+75 for (Evidence e : result.getVersionEvidence()) {
+76 if (e.getName().equalsIgnoreCase("Implementation-Version" )
+77 && e.getValue().equalsIgnoreCase("4.2.27" )) {
+78 found = true ;
+79 break ;
+80 }
+81 }
+82 assertTrue("implementation-version of 4.2.27 not found in org.mortbay.jetty.jar" , found);
+83
+84 file = new File(this .getClass().getClassLoader().getResource("org.mortbay.jmx.jar" ).getPath());
+85 result = new Dependency(file);
+86 instance.analyze(result, null );
+87 assertEquals("org.mortbar,jmx.jar has version evidence?" , result.getVersionEvidence().size(), 0);
+88 }
+89
+90
+91
+92
+93 @Test
+94 public void testGetSupportedExtensions() {
+95 JarAnalyzer instance = new JarAnalyzer();
+96 Set expResult = new HashSet();
+97 expResult.add("jar" );
+98 expResult.add("war" );
+99 Set result = instance.getSupportedExtensions();
+100 assertEquals(expResult, result);
+101 }
+102
+103
+104
+105
+106 @Test
+107 public void testGetName() {
+108 JarAnalyzer instance = new JarAnalyzer();
+109 String expResult = "Jar Analyzer" ;
+110 String result = instance.getName();
+111 assertEquals(expResult, result);
+112 }
+113
+114
+115
+116
+117 @Test
+118 public void testSupportsExtension() {
+119 String extension = "jar" ;
+120 JarAnalyzer instance = new JarAnalyzer();
+121 boolean expResult = true ;
+122 boolean result = instance.supportsExtension(extension);
+123 assertEquals(expResult, result);
+124 }
+125
+126 @Test
+127 public void testInterpolateString() {
+128 Properties prop = new Properties();
+129 prop.setProperty("key" , "value" );
+130 prop.setProperty("nested" , "nested ${key}" );
+131 String text = "This is a test of '${key}' '${nested}'" ;
+132 String expResults = "This is a test of 'value' 'nested value'" ;
+133 JarAnalyzer instance = new JarAnalyzer();
+134 String results = instance.interpolateString(text, prop);
+135 assertEquals(expResults, results);
+136 }
+137 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
index 995507a97..7ce034ce8 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
@@ -28,129 +28,107 @@
20 import java.io.File;
21 import java.util.HashSet;
22 import java.util.Set;
-23 import org.junit.After;
-24 import org.junit.AfterClass;
-25 import static org.junit.Assert.assertEquals;
-26 import org.junit.Before;
-27 import org.junit.BeforeClass;
-28 import org.junit.Test;
-29 import org.owasp.dependencycheck.Engine;
-30 import org.owasp.dependencycheck.dependency.Dependency;
-31
-32
-33
-34
-35
-36 public class JavaScriptAnalyzerTest {
-37
-38 public JavaScriptAnalyzerTest () {
-39 }
-40
-41 @BeforeClass
-42 public static void setUpClass() {
-43 }
-44
-45 @AfterClass
-46 public static void tearDownClass() {
-47 }
-48
-49 @Before
-50 public void setUp() {
-51 }
-52
-53 @After
-54 public void tearDown() {
-55 }
-56
-57
-58
-59
-60 @Test
-61 public void testGetSupportedExtensions() {
-62 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-63 Set expResult = new HashSet<String>();
-64 expResult.add("js" );
-65 Set result = instance.getSupportedExtensions();
-66 assertEquals(expResult, result);
-67 }
-68
-69
-70
-71
-72 @Test
-73 public void testGetName() {
-74 System.out.println("getName" );
-75 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-76 String expResult = "JavaScript Analyzer" ;
-77 String result = instance.getName();
-78 assertEquals(expResult, result);
-79 }
-80
-81
-82
-83
-84 @Test
-85 public void testSupportsExtension() {
-86 String extension = "js" ;
-87 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-88 boolean expResult = true ;
-89 boolean result = instance.supportsExtension(extension);
-90 assertEquals(expResult, result);
-91 }
-92
-93
-94
-95
-96 @Test
-97 public void testGetAnalysisPhase() {
-98 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-99 AnalysisPhase expResult = AnalysisPhase.INFORMATION_COLLECTION;
-100 AnalysisPhase result = instance.getAnalysisPhase();
-101 assertEquals(expResult, result);
-102 }
-103
-104
-105
-106
-107 @Test
-108 public void testAnalyze() throws Exception {
-109 File jq6 = new File(this .getClass().getClassLoader().getResource("jquery-1.6.2.min.js" ).getPath());
-110 File jq10 = new File(this .getClass().getClassLoader().getResource("jquery-1.10.2.js" ).getPath());
-111 File jq10min = new File(this .getClass().getClassLoader().getResource("jquery-1.10.2.min.js" ).getPath());
-112 Dependency depJQ6 = new Dependency(jq6);
-113 Dependency depJQ10 = new Dependency(jq10);
-114 Dependency depJQ10min = new Dependency(jq10min);
-115 Engine engine = null ;
-116 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129 }
-130
-131
-132
-133
-134 @Test
-135 public void testInitialize() throws Exception {
-136 }
-137
-138
-139
-140
-141 @Test
-142 public void testClose() throws Exception {
-143
-144 }
-145 }
+23 import static org.junit.Assert.assertEquals;
+24 import org.junit.Test;
+25 import org.owasp.dependencycheck.BaseTest;
+26 import org.owasp.dependencycheck.Engine;
+27 import org.owasp.dependencycheck.dependency.Dependency;
+28
+29
+30
+31
+32
+33 public class JavaScriptAnalyzerTest extends BaseTest {
+34
+35
+36
+37
+38 @Test
+39 public void testGetSupportedExtensions() {
+40 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
+41 Set expResult = new HashSet<String>();
+42 expResult.add("js" );
+43 Set result = instance.getSupportedExtensions();
+44 assertEquals(expResult, result);
+45 }
+46
+47
+48
+49
+50 @Test
+51 public void testGetName() {
+52 System.out.println("getName" );
+53 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
+54 String expResult = "JavaScript Analyzer" ;
+55 String result = instance.getName();
+56 assertEquals(expResult, result);
+57 }
+58
+59
+60
+61
+62 @Test
+63 public void testSupportsExtension() {
+64 String extension = "js" ;
+65 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
+66 boolean expResult = true ;
+67 boolean result = instance.supportsExtension(extension);
+68 assertEquals(expResult, result);
+69 }
+70
+71
+72
+73
+74 @Test
+75 public void testGetAnalysisPhase() {
+76 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
+77 AnalysisPhase expResult = AnalysisPhase.INFORMATION_COLLECTION;
+78 AnalysisPhase result = instance.getAnalysisPhase();
+79 assertEquals(expResult, result);
+80 }
+81
+82
+83
+84
+85 @Test
+86 public void testAnalyze() throws Exception {
+87 File jq6 = new File(this .getClass().getClassLoader().getResource("jquery-1.6.2.min.js" ).getPath());
+88 File jq10 = new File(this .getClass().getClassLoader().getResource("jquery-1.10.2.js" ).getPath());
+89 File jq10min = new File(this .getClass().getClassLoader().getResource("jquery-1.10.2.min.js" ).getPath());
+90 Dependency depJQ6 = new Dependency(jq6);
+91 Dependency depJQ10 = new Dependency(jq10);
+92 Dependency depJQ10min = new Dependency(jq10min);
+93 Engine engine = null ;
+94 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107 }
+108
+109
+110
+111
+112 @Test
+113 public void testInitialize() throws Exception {
+114 }
+115
+116
+117
+118
+119 @Test
+120 public void testClose() throws Exception {
+121
+122 }
+123 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/NuspecAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/NuspecAnalyzerTest.html
index 02b058ef3..001c52f32 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/NuspecAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/NuspecAnalyzerTest.html
@@ -30,41 +30,42 @@
22 import static org.junit.Assert.assertTrue;
23 import org.junit.Before;
24 import org.junit.Test;
-25
-26 public class NuspecAnalyzerTest {
-27
-28 private NuspecAnalyzer instance;
-29
-30 @Before
-31 public void setUp() {
-32 instance = new NuspecAnalyzer();
-33 instance.setEnabled(true );
-34 }
-35
-36 @Test
-37 public void testGetAnalyzerName() {
-38 assertEquals("Nuspec Analyzer" , instance.getName());
-39 }
-40
-41 @Test
-42 public void testGetSupportedExtensions() {
-43 assertTrue(instance.getSupportedExtensions().contains("nuspec" ));
-44 assertFalse(instance.getSupportedExtensions().contains("nupkg" ));
-45 }
-46
-47 @Test
-48 public void testSupportsExtension() {
-49 assertTrue(instance.supportsExtension("nuspec" ));
-50 assertFalse(instance.supportsExtension("nupkg" ));
-51 }
-52
-53 @Test
-54 public void testGetAnalysisPhaze() {
-55 assertEquals(AnalysisPhase.INFORMATION_COLLECTION, instance.getAnalysisPhase());
-56 }
-57 }
-58
-59
+25 import org.owasp.dependencycheck.BaseTest;
+26
+27 public class NuspecAnalyzerTest extends BaseTest {
+28
+29 private NuspecAnalyzer instance;
+30
+31 @Before
+32 public void setUp() throws Exception {
+33 instance = new NuspecAnalyzer();
+34 instance.setEnabled(true );
+35 }
+36
+37 @Test
+38 public void testGetAnalyzerName() {
+39 assertEquals("Nuspec Analyzer" , instance.getName());
+40 }
+41
+42 @Test
+43 public void testGetSupportedExtensions() {
+44 assertTrue(instance.getSupportedExtensions().contains("nuspec" ));
+45 assertFalse(instance.getSupportedExtensions().contains("nupkg" ));
+46 }
+47
+48 @Test
+49 public void testSupportsExtension() {
+50 assertTrue(instance.supportsExtension("nuspec" ));
+51 assertFalse(instance.supportsExtension("nupkg" ));
+52 }
+53
+54 @Test
+55 public void testGetAnalysisPhaze() {
+56 assertEquals(AnalysisPhase.INFORMATION_COLLECTION, instance.getAnalysisPhase());
+57 }
+58 }
+59
+60
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
index 5ac0c139a..791201f0f 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.1.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.0 Reference Package org.owasp.dependencycheck.analyzer
@@ -28,13 +28,13 @@
AnalyzerServiceTest
- ArchiveAnalyzerTest
+ ArchiveAnalyzerIntegrationTest
AssemblyAnalyzerTest
- CPEAnalyzerTest
+ CPEAnalyzerIntegrationTest
DependencyBundlingAnalyzerTest
@@ -44,6 +44,9 @@
FileNameAnalyzerTest
+
+
+ HintAnalyzerTest
JarAnalyzerTest
@@ -55,7 +58,7 @@
NuspecAnalyzerTest
- VulnerabilitySuppressionAnalyzerTest
+ VulnerabilitySuppressionAnalyzerIntegrationTest
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
index 9481a9ef9..b299601ad 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.1.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.0 Reference Package org.owasp.dependencycheck.analyzer
@@ -57,7 +57,7 @@
- ArchiveAnalyzerTest
+ ArchiveAnalyzerIntegrationTest
@@ -67,7 +67,7 @@
- CPEAnalyzerTest
+ CPEAnalyzerIntegrationTest
@@ -84,6 +84,11 @@
FileNameAnalyzerTest
+
+
+
+ HintAnalyzerTest
+
@@ -102,7 +107,7 @@
- VulnerabilitySuppressionAnalyzerTest
+ VulnerabilitySuppressionAnalyzerIntegrationTest
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/AbstractDatabaseTestCase.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/AbstractDatabaseTestCase.html
index fac6d587a..24c4ea538 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/AbstractDatabaseTestCase.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/AbstractDatabaseTestCase.html
@@ -25,42 +25,24 @@