CachedWebDataSource 1.0; 1
+ NoDataException 1.0; 1
+
UpdateException 1.0; 1
UpdateService 1.3333333333333333; 1.333
@@ -46,6 +48,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
index 2019cb2e7..8ec4c2670 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
@@ -57,6 +57,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
index 0ad70fa7e..347651b65 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.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
index e83aa9186..bcb21a23b 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
@@ -53,6 +53,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
index 6ad5295e9..222362d3a 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
@@ -57,6 +57,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 9992ff5c4..ca7d465f5 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
@@ -16,20 +16,20 @@
-
+
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 976a75ccb..d4448914d 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 c2b934d4d..1fbe623a6 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 2fa039d9a..35f5850ff 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
@@ -40,6 +40,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
index 45bac2f51..48e0c7025 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 4d91cc7d6..bf7f8a67a 100644
--- a/dependency-check-core/cobertura/frame-summary.html
+++ b/dependency-check-core/cobertura/frame-summary.html
@@ -16,21 +16,21 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
index da6621010..dc39852a4 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 @@
@@ -62,621 +62,691 @@
22
import java.io.File;
23
- import java.util.ArrayList;
+ import java.io.IOException;
24
- import java.util.HashSet;
+ import java.util.ArrayList;
25
- import java.util.Iterator;
+ import java.util.HashSet;
26
- import java.util.List;
+ import java.util.Iterator;
27
- import java.util.Set;
+ import java.util.List;
28
- import java.util.logging.Level;
+ import java.util.Set;
29
- import java.util.logging.Logger;
+ import java.util.logging.Level;
30
- import org.owasp.dependencycheck.analyzer.AnalysisException;
+ import java.util.logging.Logger;
31
- import org.owasp.dependencycheck.analyzer.AnalysisPhase;
+ import org.owasp.dependencycheck.analyzer.AnalysisException;
32
- import org.owasp.dependencycheck.analyzer.Analyzer;
+ import org.owasp.dependencycheck.analyzer.AnalysisPhase;
33
- import org.owasp.dependencycheck.analyzer.AnalyzerService;
+ import org.owasp.dependencycheck.analyzer.Analyzer;
34
- import org.owasp.dependencycheck.data.CachedWebDataSource;
+ import org.owasp.dependencycheck.analyzer.AnalyzerService;
35
- import org.owasp.dependencycheck.data.UpdateException;
+ import org.owasp.dependencycheck.data.CachedWebDataSource;
36
- import org.owasp.dependencycheck.data.UpdateService;
+ import org.owasp.dependencycheck.data.NoDataException;
37
- import org.owasp.dependencycheck.dependency.Dependency;
+ import org.owasp.dependencycheck.data.UpdateException;
38
- import org.owasp.dependencycheck.utils.FileUtils;
+ import org.owasp.dependencycheck.data.UpdateService;
39
- import org.owasp.dependencycheck.utils.InvalidSettingException;
+ import org.owasp.dependencycheck.data.cpe.CpeIndexReader;
40
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.dependency.Dependency;
41
-
+ import org.owasp.dependencycheck.utils.FileUtils;
42
-
+ import org.owasp.dependencycheck.utils.InvalidSettingException;
43
-
+ import org.owasp.dependencycheck.utils.Settings;
44
-
+
45
-
+
46
-
+
47
-
+
48
-
+
49
-
+
50
- public class Engine {
+
51
-
+
52
-
+
53
-
+ public class Engine {
54
-
- 55 3 private final List<Dependency> dependencies = new ArrayList<Dependency>();
+
+ 55
+
56
-
+
57
-
- 58
- 59 3 private final EnumMap<AnalysisPhase, List<Analyzer>> analyzers =
+ 58 6 private final List<Dependency> dependencies = new ArrayList<Dependency>();
+ 59
+
60
- new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+
61
-
- 62
-
+
+ 62 6 private final EnumMap<AnalysisPhase, List<Analyzer>> analyzers =
63
-
- 64 3 private final Set<String> extensions = new HashSet<String>();
+ new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+ 64
+
65
-
+
66
-
- 67
-
+
+ 67 6 private final Set<String> extensions = new HashSet<String>();
68
-
- 69 3 public Engine() {
- 70 3 boolean autoUpdate = true ;
- 71
- try {
- 72 3 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
- 73 0 } catch (InvalidSettingException ex) {
- 74 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "Invalid setting for auto-update; using true." );
- 75 3 }
- 76 3 if (autoUpdate) {
- 77 0 doUpdates();
- 78
- }
- 79 3 loadAnalyzers();
- 80 3 }
- 81
- 82
+ 69
- 83
+ 70
+ 71
+
+ 72 6 public Engine() {
+ 73 6 boolean autoUpdate = true ;
+ 74
+ try {
+ 75 6 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+ 76 0 } catch (InvalidSettingException ex) {
+ 77 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "Invalid setting for auto-update; using true." );
+ 78 6 }
+ 79 6 if (autoUpdate) {
+ 80 0 doUpdates();
+ 81
+ }
+ 82 6 loadAnalyzers();
+ 83 6 }
84
-
+
85
-
+
86
-
+
87
-
+
88
-
+
89
-
+
90
-
+
91
+
+ 92
+
+ 93
+
+ 94
@Deprecated
- 92 0 public Engine(boolean autoUpdate) {
- 93 0 if (autoUpdate) {
- 94 0 doUpdates();
- 95
- }
- 96 0 loadAnalyzers();
- 97 0 }
+ 95 0 public Engine(boolean autoUpdate) {
+ 96 0 if (autoUpdate) {
+ 97 0 doUpdates();
98
-
- 99
-
- 100
-
+ }
+ 99 0 loadAnalyzers();
+ 100 0 }
101
-
+
102
-
+
103
- private void loadAnalyzers() {
+
104
-
- 105 30 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 106 27 analyzers.put(phase, new ArrayList<Analyzer>());
+
+ 105
+
+ 106
+ private void loadAnalyzers() {
107
- }
- 108
- 109 3 final AnalyzerService service = AnalyzerService.getInstance();
- 110 3 final Iterator<Analyzer> iterator = service.getAnalyzers();
- 111 27 while (iterator.hasNext()) {
- 112 24 final Analyzer a = iterator.next();
- 113 24 analyzers.get(a.getAnalysisPhase()).add(a);
- 114 24 if (a.getSupportedExtensions() != null ) {
- 115 6 extensions.addAll(a.getSupportedExtensions());
- 116
- }
- 117 24 }
- 118 3 }
+ 108 60 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 109 54 analyzers.put(phase, new ArrayList<Analyzer>());
+ 110
+ }
+ 111
+
+ 112 6 final AnalyzerService service = AnalyzerService.getInstance();
+ 113 6 final Iterator<Analyzer> iterator = service.getAnalyzers();
+ 114 54 while (iterator.hasNext()) {
+ 115 48 final Analyzer a = iterator.next();
+ 116 48 analyzers.get(a.getAnalysisPhase()).add(a);
+ 117 48 if (a.getSupportedExtensions() != null ) {
+ 118 12 extensions.addAll(a.getSupportedExtensions());
119
-
- 120
-
- 121
-
+ }
+ 120 48 }
+ 121 6 }
122
-
+
123
-
+
124
-
+
125
-
+
126
- public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
- 127 0 return analyzers.get(phase);
+
+ 127
+
128
- }
+
129
-
- 130
-
+ public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
+ 130 0 return analyzers.get(phase);
131
-
+ }
132
-
+
133
-
+
134
-
+
135
- public List<Dependency> getDependencies() {
- 136 17 return dependencies;
+
+ 136
+
137
- }
+
138
-
- 139
-
+ public List<Dependency> getDependencies() {
+ 139 38 return dependencies;
140
-
+ }
141
-
+
142
-
+
143
-
- 144
-
- 145
-
- 146
-
- 147
-
- 148
- public void scan(String[] paths) {
- 149 0 for (String path : paths) {
- 150 0 final File file = new File(path);
- 151 0 scan(file);
- 152
- }
- 153 0 }
- 154
-
- 155
-
- 156
-
- 157
-
- 158
-
- 159
-
- 160
-
- 161
-
- 162
- public void scan(String path) {
- 163 0 final File file = new File(path);
- 164 0 scan(file);
- 165 0 }
- 166
-
- 167
-
- 168
- 169
+ 144
- 170
+ 145
- 171
+ 146
- 172
+ 147
- 173
+ 148
- 174
-
- 175
+ 149
+
+ 150
- 176
- public void scan(File[] files) {
- 177 0 for (File file : files) {
- 178 0 scan(file);
- 179
+ 151
+ public void scan(String[] paths) {
+ 152 0 for (String path : paths) {
+ 153 0 final File file = new File(path);
+ 154 0 scan(file);
+ 155
}
- 180 0 }
- 181
+ 156 0 }
+ 157
- 182
+ 158
- 183
-
- 184
-
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
-
- 191
- public void scan(Set<File> files) {
- 192 0 for (File file : files) {
- 193 0 scan(file);
- 194
- }
- 195 0 }
- 196
-
- 197
-
- 198
-
- 199
-
- 200
-
- 201
-
- 202
-
- 203
-
- 204
-
- 205
-
- 206
- public void scan(List<File> files) {
- 207 0 for (File file : files) {
- 208 0 scan(file);
- 209
- }
- 210 0 }
- 211
-
- 212
-
- 213
+ 159
- 214
+ 160
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+ public void scan(String path) {
+ 166 0 final File file = new File(path);
+ 167 0 scan(file);
+ 168 0 }
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+ public void scan(File[] files) {
+ 180 0 for (File file : files) {
+ 181 0 scan(file);
+ 182
+ }
+ 183 0 }
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+ public void scan(Set<File> files) {
+ 195 0 for (File file : files) {
+ 196 0 scan(file);
+ 197
+ }
+ 198 0 }
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+ public void scan(List<File> files) {
+ 210 0 for (File file : files) {
+ 211 0 scan(file);
+ 212
+ }
+ 213 0 }
+ 214
+
215
-
+
216
-
+
217
-
+
218
-
- 219
-
- 220
-
- 221
- public void scan(File file) {
- 222 6 if (file.exists()) {
- 223 6 if (file.isDirectory()) {
- 224 3 scanDirectory(file);
- 225
- } else {
- 226 3 scanFile(file);
- 227
- }
- 228
- }
- 229 6 }
- 230
-
- 231
-
- 232
-
- 233
-
- 234
-
- 235
-
- 236
-
- 237
- protected void scanDirectory(File dir) {
- 238 28 final File[] files = dir.listFiles();
- 239 28 if (files != null ) {
- 240 58 for (File f : files) {
- 241 30 if (f.isDirectory()) {
- 242 25 scanDirectory(f);
- 243
- } else {
- 244 5 scanFile(f);
- 245
- }
- 246
- }
- 247
- }
- 248 28 }
- 249
-
- 250
-
- 251
-
- 252
- 253
+ 219
- 254
-
- 255
+ 220
+
+ 221
+
+ 222
+
+ 223
- 256
- protected void scanFile(File file) {
- 257 8 if (!file.isFile()) {
- 258 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
- 259 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 260 0 return ;
- 261
- }
- 262 8 final String fileName = file.getName();
- 263 8 final String extension = FileUtils.getFileExtension(fileName);
- 264 8 if (extension != null ) {
- 265 8 if (extensions.contains(extension)) {
- 266 8 final Dependency dependency = new Dependency(file);
- 267 8 dependencies.add(dependency);
- 268 8 }
- 269
- } else {
- 270 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
- 271
- file.toString());
- 272 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, msg);
- 273
- }
- 274 8 }
- 275
-
- 276
-
- 277
-
- 278
-
- 279
- public void analyzeDependencies() {
- 280
-
- 281 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 282 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 283 9 for (Analyzer a : analyzerList) {
- 284
- try {
- 285 8 final String msg = String.format("Initializing %s" , a.getName());
- 286 8 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 287 8 a.initialize();
- 288 0 } catch (Exception ex) {
- 289 0 final String msg = String.format("Exception occurred initializing %s." , a.getName());
- 290 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
- 291 0 Logger.getLogger(Engine.class .getName()).log(Level.INFO, null , ex);
- 292
- try {
- 293 0 a.close();
- 294 0 } catch (Exception ex1) {
- 295 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex1);
- 296 0 }
- 297 16 }
- 298
+ 224
+ public void scan(File file) {
+ 225 13 if (file.exists()) {
+ 226 13 if (file.isDirectory()) {
+ 227 8 scanDirectory(file);
+ 228
+ } else {
+ 229 5 scanFile(file);
+ 230
}
- 299
+ 231
}
- 300
+ 232 13 }
+ 233
- 301
-
- 302 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 303 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 304
-
- 305 9 for (Analyzer a : analyzerList) {
- 306
-
- 307
-
- 308
-
- 309
-
- 310 8 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
- 311 8 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 312 8 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 313 8 dependencySet.addAll(dependencies);
- 314 8 for (Dependency d : dependencySet) {
- 315 24 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
- 316 24 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msgFile);
- 317 24 if (a.supportsExtension(d.getFileExtension())) {
- 318
- try {
- 319 21 a.analyze(d, this );
- 320 0 } catch (AnalysisException ex) {
- 321 0 d.addAnalysisException(ex);
- 322 21 }
- 323
- }
- 324 24 }
- 325 8 }
- 326
- }
- 327
-
- 328
-
- 329 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 330 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 331 9 for (Analyzer a : analyzerList) {
- 332 8 final String msg = String.format("Closing Analyzer '%s'" , a.getName());
- 333 8 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
- 334
- try {
- 335 8 a.close();
- 336 0 } catch (Exception ex) {
- 337 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex);
- 338 8 }
- 339 8 }
- 340
- }
- 341 1 }
- 342
-
- 343
+ 234
- 344
-
- 345
-
- 346
-
- 347
- private void doUpdates() {
- 348 0 final UpdateService service = UpdateService.getInstance();
- 349 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
- 350 0 while (iterator.hasNext()) {
- 351 0 final CachedWebDataSource source = iterator.next();
- 352
- try {
- 353 0 source.update();
- 354 0 } catch (UpdateException ex) {
- 355 0 Logger.getLogger(Engine.class .getName()).log(Level.WARNING,
- 356
- "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
- 357 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE,
- 358
- String.format("Unable to update details for %s" , source.getClass().getName()), ex);
- 359 0 }
- 360 0 }
- 361 0 }
- 362
-
- 363
-
- 364
-
- 365
-
- 366
+ 235
+
+ 236
+
+ 237
- 367
-
- 368
+ 238
+
+ 239
- 369
- public List<Analyzer> getAnalyzers() {
- 370 1 final List<Analyzer> ret = new ArrayList<Analyzer>();
- 371 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 372 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 373 9 ret.addAll(analyzerList);
- 374
- }
- 375 1 return ret;
- 376
- }
- 377
-
- 378
-
- 379
-
- 380
-
- 381
-
- 382
-
- 383
-
- 384
-
- 385
- public boolean supportsExtension(String ext) {
- 386 138 if (ext == null ) {
- 387 8 return false ;
- 388
- }
- 389 1259 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 390 1134 final List<Analyzer> analyzerList = analyzers.get(phase);
- 391 1134 for (Analyzer a : analyzerList) {
- 392 1009 if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) {
- 393 5 return true ;
- 394
+ 240
+ protected void scanDirectory(File dir) {
+ 241 33 final File[] files = dir.listFiles();
+ 242 33 if (files != null ) {
+ 243 68 for (File f : files) {
+ 244 35 if (f.isDirectory()) {
+ 245 25 scanDirectory(f);
+ 246
+ } else {
+ 247 10 scanFile(f);
+ 248
}
- 395
+ 249
}
- 396
+ 250
}
- 397 125 return false ;
- 398
+ 251 33 }
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+ protected void scanFile(File file) {
+ 260 15 if (!file.isFile()) {
+ 261 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+ 262 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+ 263 0 return ;
+ 264
+ }
+ 265 15 final String fileName = file.getName();
+ 266 15 final String extension = FileUtils.getFileExtension(fileName);
+ 267 15 if (extension != null ) {
+ 268 15 if (extensions.contains(extension)) {
+ 269 15 final Dependency dependency = new Dependency(file);
+ 270 15 dependencies.add(dependency);
+ 271 15 }
+ 272
+ } else {
+ 273 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
+ 274
+ file.toString());
+ 275 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, msg);
+ 276
+ }
+ 277 15 }
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+ public void analyzeDependencies() {
+ 283
+
+ 284
+ try {
+ 285 3 ensureDataExists();
+ 286 0 } catch (NoDataException ex) {
+ 287 0 final String msg = String.format("%n%n%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 288 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
+ 289 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE, null , ex);
+ 290 0 return ;
+ 291 3 }
+ 292
+
+ 293
+
+ 294 30 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 295 27 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 296 27 for (Analyzer a : analyzerList) {
+ 297
+ try {
+ 298 24 final String msg = String.format("Initializing %s" , a.getName());
+ 299 24 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+ 300 24 a.initialize();
+ 301 0 } catch (Exception ex) {
+ 302 0 final String msg = String.format("Exception occurred initializing %s." , a.getName());
+ 303 0 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
+ 304 0 Logger.getLogger(Engine.class .getName()).log(Level.INFO, null , ex);
+ 305
+ try {
+ 306 0 a.close();
+ 307 0 } catch (Exception ex1) {
+ 308 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex1);
+ 309 0 }
+ 310 48 }
+ 311
+ }
+ 312
+ }
+ 313
+
+ 314
+
+ 315 30 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 316 27 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 317
+
+ 318 27 for (Analyzer a : analyzerList) {
+ 319
+
+ 320
+
+ 321
+
+ 322
+
+ 323 24 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+ 324 24 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+ 325 24 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 326 24 dependencySet.addAll(dependencies);
+ 327 24 for (Dependency d : dependencySet) {
+ 328 68 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+ 329 68 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msgFile);
+ 330 68 if (a.supportsExtension(d.getFileExtension())) {
+ 331
+ try {
+ 332 61 a.analyze(d, this );
+ 333 0 } catch (AnalysisException ex) {
+ 334 0 d.addAnalysisException(ex);
+ 335 61 }
+ 336
+ }
+ 337 68 }
+ 338 24 }
+ 339
+ }
+ 340
+
+ 341
+
+ 342 30 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 343 27 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 344 27 for (Analyzer a : analyzerList) {
+ 345 24 final String msg = String.format("Closing Analyzer '%s'" , a.getName());
+ 346 24 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+ 347
+ try {
+ 348 24 a.close();
+ 349 0 } catch (Exception ex) {
+ 350 0 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex);
+ 351 24 }
+ 352 24 }
+ 353
+ }
+ 354 3 }
+ 355
+
+ 356
+
+ 357
+
+ 358
+
+ 359
+
+ 360
+ private void doUpdates() {
+ 361 0 final UpdateService service = UpdateService.getInstance();
+ 362 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+ 363 0 while (iterator.hasNext()) {
+ 364 0 final CachedWebDataSource source = iterator.next();
+ 365
+ try {
+ 366 0 source.update();
+ 367 0 } catch (UpdateException ex) {
+ 368 0 Logger.getLogger(Engine.class .getName()).log(Level.WARNING,
+ 369
+ "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
+ 370 0 Logger.getLogger(Engine.class .getName()).log(Level.FINE,
+ 371
+ String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+ 372 0 }
+ 373 0 }
+ 374 0 }
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379
+
+ 380
+
+ 381
+
+ 382
+ public List<Analyzer> getAnalyzers() {
+ 383 1 final List<Analyzer> ret = new ArrayList<Analyzer>();
+ 384 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 385 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 386 9 ret.addAll(analyzerList);
+ 387
+ }
+ 388 1 return ret;
+ 389
}
- 399
+ 390
+
+ 391
+
+ 392
+
+ 393
+
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+ public boolean supportsExtension(String ext) {
+ 399 143 if (ext == null ) {
+ 400 8 return false ;
+ 401
+ }
+ 402 1267 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 403 1142 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 404 1142 for (Analyzer a : analyzerList) {
+ 405 1017 if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) {
+ 406 10 return true ;
+ 407
+ }
+ 408
+ }
+ 409
+ }
+ 410 125 return false ;
+ 411
+ }
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+ private void ensureDataExists() throws NoDataException {
+ 420 3 CpeIndexReader cpe = null ;
+ 421 3 boolean noDataExists = false ;
+ 422
+ try {
+ 423 3 cpe = new CpeIndexReader();
+ 424 3 cpe.open();
+ 425 3 if (cpe.numDocs() <= 0) {
+ 426 0 noDataExists = true ;
+ 427
+ }
+ 428 0 } catch (IOException ex) {
+ 429 0 noDataExists = true ;
+ 430 0 } catch (NullPointerException ex) {
+ 431 0 noDataExists = true ;
+ 432
+ } finally {
+ 433 3 if (cpe != null ) {
+ 434 3 cpe.close();
+ 435
+ }
+ 436
+ }
+ 437 3 if (noDataExists) {
+ 438 0 throw new NoDataException("No data exists in the data store. Please check that you are able to connect "
+ 439
+ + "to the Internet and re-run dependency-check. If the problem persists determine whether you need "
+ 440
+ + "to set a proxy url and port.\\n\\nIf you are unable to solve this problem please contact the mailing "
+ 441
+ + "list for help: dependency-check@googlegroups.com" );
+ 442
+
+ 443
+ }
+ 444 3 }
+ 445
}
-
+
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 9ccfae01a..644bec385 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
@@ -73,7 +73,7 @@
28
- 29 51 public abstract class AbstractAnalyzer implements Analyzer {
+ 29 54 public abstract class AbstractAnalyzer implements Analyzer {
30
31
@@ -125,7 +125,7 @@
public void initialize() throws Exception {
56
- 57 5 }
+ 57 13 }
58
59
@@ -144,11 +144,11 @@
public void close() throws Exception {
66
- 67 5 }
+ 67 13 }
68
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisException.html
index 3de2824ca..4409e6e08 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisException.html
@@ -145,6 +145,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
index 1e1977bf4..39edec91b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
@@ -67,7 +67,7 @@
25
- 26 148 public enum AnalysisPhase {
+ 26 162 public enum AnalysisPhase {
27
28
@@ -137,6 +137,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
index 858764bb3..3e8342809 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
@@ -223,6 +223,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 2ecc76acc..7a0893400 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
@@ -116,11 +116,11 @@
51
public static synchronized AnalyzerService getInstance() {
- 52 4 if (service == null ) {
+ 52 7 if (service == null ) {
53 1 service = new AnalyzerService();
54
}
- 55 4 return service;
+ 55 7 return service;
56
}
57
@@ -137,13 +137,13 @@
63
public Iterator<Analyzer> getAnalyzers() {
- 64 4 return loader.iterator();
+ 64 7 return loader.iterator();
65
}
66
}
-
+
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 6598be3ec..31bd347bc 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 @@
@@ -86,480 +86,581 @@
34
import java.util.logging.Logger;
35
-
+ import org.apache.commons.compress.archivers.ArchiveEntry;
36
-
+ import org.apache.commons.compress.archivers.ArchiveInputStream;
37
-
+ import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
38
- import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
- 39
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
+ 39
+ import org.apache.commons.compress.compressors.CompressorInputStream;
40
- import org.h2.store.fs.FileUtils;
+ import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
41
- import org.owasp.dependencycheck.Engine;
+ import org.apache.commons.compress.compressors.gzip.GzipUtils;
42
- import org.owasp.dependencycheck.dependency.Dependency;
+ import org.h2.store.fs.FileUtils;
43
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.Engine;
44
-
+ import org.owasp.dependencycheck.dependency.Dependency;
45
-
+ import org.owasp.dependencycheck.utils.Settings;
46
-
- 47
-
- 48
-
- 49
-
- 50
-
- 51
-
- 52
-
- 53
-
- 54
-
- 55
-
- 56
-
- 57
-
- 58
-
- 59
-
- 60
-
- 61 8 public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
- 62
- 63
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53 11 public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
+ 54
+
+ 55
- 64
+ 56
- 65
+ 57
- 66
+ 58
private static final int BUFFER_SIZE = 4096;
- 67
+ 59
- 68
+ 60
- 69
+ 61
- 70
+ 62
- 71 1 private static int dirCount = 0;
- 72
+ 63 1 private static int dirCount = 0;
+ 64
- 73
+ 65
- 74
+ 66
- 75 8 private File tempFileLocation = null ;
- 76
+ 67 11 private File tempFileLocation = null ;
+ 68
- 77
+ 69
- 78
+ 70
- 79
+ 71
- 80 1 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
- 81
+ 72 1 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
+ 73
- 82
+ 74
- 83
+ 75
- 84 8 private int scanDepth = 0;
- 85
+ 76 11 private int scanDepth = 0;
+ 77
+ 78
+
+ 79
+
+ 80
+
+ 81
+ private static final String ANALYZER_NAME = "Archive Analyzer" ;
+ 82
+
+ 83
+
+ 84
+
+ 85 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
86
87
-
+
88
- 89
- private static final String ANALYZER_NAME = "Archive Analyzer" ;
+ 89 1 private static final Set<String> EXTENSIONS = newHashSet("zip" , "ear" , "war" , "tar" , "gz" , "tgz" );
90
-
+
91
-
+
92
-
- 93 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
- 94
-
- 95
-
- 96
-
- 97 1 private static final Set<String> EXTENSIONS = newHashSet("zip" , "ear" , "war" );
- 98
-
- 99
-
- 100
- 101
+ 93
- 102
+ 94
- 103
+ 95
- 104
+ 96
public Set<String> getSupportedExtensions() {
- 105 138 return EXTENSIONS;
- 106
+ 97 149 return EXTENSIONS;
+ 98
}
- 107
+ 99
- 108
+ 100
- 109
+ 101
- 110
+ 102
- 111
+ 103
- 112
+ 104
- 113
+ 105
public String getName() {
- 114 4 return ANALYZER_NAME;
- 115
+ 106 10 return ANALYZER_NAME;
+ 107
}
- 116
+ 108
- 117
+ 109
- 118
+ 110
- 119
+ 111
- 120
+ 112
- 121
+ 113
- 122
+ 114
- 123
+ 115
- 124
+ 116
public boolean supportsExtension(String extension) {
- 125 142 return EXTENSIONS.contains(extension);
- 126
+ 117 154 return EXTENSIONS.contains(extension);
+ 118
}
- 127
+ 119
- 128
+ 120
- 129
+ 121
- 130
+ 122
- 131
+ 123
- 132
+ 124
- 133
+ 125
public AnalysisPhase getAnalysisPhase() {
- 134 4 return ANALYSIS_PHASE;
- 135
+ 126 7 return ANALYSIS_PHASE;
+ 127
}
- 136
+ 128
- 137
+ 129
- 138
+ 130
- 139
+ 131
- 140
+ 132
- 141
+ 133
- 142
+ 134
- 143
+ 135
- 144
+ 136
@Override
- 145
+ 137
public void initialize() throws Exception {
- 146 4 final File baseDir = Settings.getTempDirectory();
- 147 4 if (!baseDir.exists()) {
- 148 0 if (!baseDir.mkdirs()) {
- 149 0 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
- 150 0 throw new AnalysisException(msg);
- 151
+ 138 9 final File baseDir = Settings.getTempDirectory();
+ 139 9 if (!baseDir.exists()) {
+ 140 0 if (!baseDir.mkdirs()) {
+ 141 0 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
+ 142 0 throw new AnalysisException(msg);
+ 143
}
- 152
+ 144
}
- 153 4 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
- 154 4 if (!tempFileLocation.delete()) {
- 155 0 throw new AnalysisException("Unable to delete temporary file '" + tempFileLocation.getAbsolutePath() + "'." );
+ 145 9 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+ 146 9 if (!tempFileLocation.delete()) {
+ 147 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+ 148 0 throw new AnalysisException(msg);
+ 149
+ }
+ 150 9 if (!tempFileLocation.mkdirs()) {
+ 151 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+ 152 0 throw new AnalysisException(msg);
+ 153
+ }
+ 154 9 }
+ 155
+
156
- }
- 157 4 if (!tempFileLocation.mkdirs()) {
- 158 0 throw new AnalysisException("Unable to create directory '" + tempFileLocation.getAbsolutePath() + "'." );
- 159
- }
- 160 4 }
- 161
-
- 162
- 163
+ 157
- 164
+ 158
- 165
+ 159
- 166
+ 160
- 167
+ 161
- 168
+ 162
@Override
- 169
+ 163
public void close() throws Exception {
- 170 4 if (tempFileLocation != null && tempFileLocation.exists()) {
- 171 4 FileUtils.deleteRecursive(tempFileLocation.getAbsolutePath(), true );
- 172
+ 164 9 if (tempFileLocation != null && tempFileLocation.exists()) {
+ 165 9 FileUtils.deleteRecursive(tempFileLocation.getAbsolutePath(), true );
+ 166
}
- 173 4 }
- 174
+ 167 9 }
+ 168
- 175
+ 169
- 176
+ 170
- 177
+ 171
- 178
+ 172
- 179
+ 173
- 180
+ 174
- 181
+ 175
- 182
+ 176
- 183
+ 177
- 184
+ 178
@Override
- 185
+ 179
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 186 3 final File f = new File(dependency.getActualFilePath());
- 187 3 final File tmpDir = getNextTempDirectory();
- 188 3 extractFiles(f, tmpDir, engine);
- 189
+ 180 8 final File f = new File(dependency.getActualFilePath());
+ 181 8 final File tmpDir = getNextTempDirectory();
+ 182 8 extractFiles(f, tmpDir, engine);
+ 183
- 190
+ 184
- 191 3 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
- 192 3 engine.scan(tmpDir);
- 193 3 final List<Dependency> newDependencies = engine.getDependencies();
- 194 3 if (dependencies.size() != newDependencies.size()) {
- 195
+ 185 8 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
+ 186 8 engine.scan(tmpDir);
+ 187 8 final List<Dependency> newDependencies = engine.getDependencies();
+ 188 8 if (dependencies.size() != newDependencies.size()) {
+ 189
- 196 1 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 197 1 dependencySet.addAll(newDependencies);
- 198 1 dependencySet.removeAll(dependencies);
- 199
+ 190 6 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 191 6 dependencySet.addAll(newDependencies);
+ 192 6 dependencySet.removeAll(dependencies);
+ 193
- 200 1 for (Dependency d : dependencySet) {
- 201
+ 194 6 for (Dependency d : dependencySet) {
+ 195
- 202 5 final String displayPath = String.format("%s%s" ,
- 203
+ 196 10 final String displayPath = String.format("%s%s" ,
+ 197
dependency.getFilePath(),
- 204
+ 198
d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
- 205 5 final String displayName = String.format("%s%s%s" ,
- 206
+ 199 10 final String displayName = String.format("%s%s%s" ,
+ 200
dependency.getFileName(),
- 207
+ 201
File.separator,
- 208
+ 202
d.getFileName());
- 209 5 d.setFilePath(displayPath);
- 210 5 d.setFileName(displayName);
- 211
+ 203 10 d.setFilePath(displayPath);
+ 204 10 d.setFileName(displayName);
+ 205
- 212
+ 206
- 213
+ 207
- 214
+ 208
- 215 5 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
- 216 1 scanDepth += 1;
- 217 1 analyze(d, engine);
- 218 1 scanDepth -= 1;
- 219
+ 209 10 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
+ 210 3 scanDepth += 1;
+ 211 3 analyze(d, engine);
+ 212 3 scanDepth -= 1;
+ 213
}
- 220 5 }
- 221
+ 214 10 }
+ 215
}
- 222 3 Collections.sort(engine.getDependencies());
- 223 3 }
- 224
+ 216 8 Collections.sort(engine.getDependencies());
+ 217 8 }
+ 218
- 225
+ 219
- 226
+ 220
- 227
+ 221
- 228
+ 222
- 229
+ 223
- 230
+ 224
- 231
+ 225
private File getNextTempDirectory() throws AnalysisException {
- 232 3 dirCount += 1;
- 233 3 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 234 3 if (!directory.mkdirs()) {
- 235 0 throw new AnalysisException("Unable to create temp directory '" + directory.getAbsolutePath() + "'." );
- 236
+ 226 8 dirCount += 1;
+ 227 8 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 228
+
+ 229 8 if (directory.exists()) {
+ 230 0 return getNextTempDirectory();
+ 231
}
- 237 3 return directory;
- 238
+ 232 8 if (!directory.mkdirs()) {
+ 233 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 234 0 throw new AnalysisException(msg);
+ 235
+ }
+ 236 8 return directory;
+ 237
}
+ 238
+
239
-
- 240
- 241
+ 240
- 242
+ 241
- 243
+ 242
+ 243
+
244
-
- 245
- 246
+ 245
- 247
+ 246
- 248
- private void extractFiles(File archive, File extractTo, Engine engine) throws AnalysisException {
- 249 3 if (archive == null || extractTo == null ) {
- 250 0 return ;
- 251
+ 247
+ private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
+ 248 8 if (archive == null || destination == null ) {
+ 249 0 return ;
+ 250
}
- 252
+ 251
- 253 3 FileInputStream fis = null ;
- 254
-
- 255 3 ZipArchiveInputStream zis = null ;
- 256
-
- 257
+ 252 8 FileInputStream fis = null ;
+ 253
try {
- 258 3 fis = new FileInputStream(archive);
- 259 0 } catch (FileNotFoundException ex) {
- 260 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.INFO, null , ex);
- 261 0 throw new AnalysisException("Archive file was not found." , ex);
- 262 3 }
- 263 3 zis = new ZipArchiveInputStream(new BufferedInputStream(fis));
- 264
- ZipArchiveEntry entry;
- 265
-
- 266
+ 254 8 fis = new FileInputStream(archive);
+ 255 0 } catch (FileNotFoundException ex) {
+ 256 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.INFO, null , ex);
+ 257 0 throw new AnalysisException("Archive file was not found." , ex);
+ 258 8 }
+ 259 8 final String archiveExt = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(archive.getName()).toLowerCase();
+ 260
try {
- 267 166 while ((entry = zis.getNextZipEntry()) != null ) {
- 268 163 if (entry.isDirectory()) {
- 269 25 final File d = new File(extractTo, entry.getName());
- 270 25 if (!d.mkdirs()) {
- 271 0 throw new AnalysisException("Unable to create '" + d.getAbsolutePath() + "'." );
- 272
- }
- 273 25 } else {
- 274 138 final File file = new File(extractTo, entry.getName());
- 275 138 final String ext = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(file.getName());
- 276 138 if (engine.supportsExtension(ext)) {
- 277 5 BufferedOutputStream bos = null ;
- 278
- FileOutputStream fos;
- 279
- try {
- 280 5 fos = new FileOutputStream(file);
- 281 5 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
- 282
- int count;
- 283 5 final byte data[] = new byte [BUFFER_SIZE];
- 284 1307 while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
- 285 1302 bos.write(data, 0, count);
- 286
- }
- 287 5 bos.flush();
- 288 0 } catch (FileNotFoundException ex) {
- 289 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
- 290 0 throw new AnalysisException("Unable to find file '" + file.getName() + "'." , ex);
- 291 0 } catch (IOException ex) {
- 292 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
- 293 0 throw new AnalysisException("IO Exception while parsing file '" + file.getName() + "'." , ex);
- 294
- } finally {
- 295 5 if (bos != null ) {
- 296
- try {
- 297 5 bos.close();
- 298 0 } catch (IOException ex) {
- 299 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
- 300 5 }
- 301
- }
- 302
- }
- 303
- }
- 304 138 }
- 305
+ 261 8 if ("zip" .equals(archiveExt) || "war" .equals(archiveExt) || "ear" .equals(archiveExt)) {
+ 262 3 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 263 5 } else if ("tar" .equals(archiveExt)) {
+ 264 3 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 265 2 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
+ 266 2 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
+ 267 2 final String uncompressedExt = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(uncompressedName).toLowerCase();
+ 268 2 if (engine.supportsExtension(uncompressedExt)) {
+ 269 2 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
+ 270
+ }
+ 271
}
- 306 0 } catch (IOException ex) {
- 307 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
- 308 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
- 309 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
- 310 0 throw new AnalysisException(msg, ex);
- 311 0 } catch (Throwable ex) {
- 312 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
- 313 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
- 314 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, null , ex);
- 315 0 throw new AnalysisException(msg, ex);
- 316
+ 272 0 } catch (ArchiveExtractionException ex) {
+ 273 0 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
+ 274 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
+ 275 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+ 276 0 } catch (IOException ex) {
+ 277 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+ 278 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
+ 279 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+ 280
} finally {
- 317 0 try {
- 318 3 zis.close();
- 319 0 } catch (IOException ex) {
- 320 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
- 321 3 }
- 322 0 }
- 323 3 }
- 324
+ 281 0 try {
+ 282 8 fis.close();
+ 283 0 } catch (IOException ex) {
+ 284 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+ 285 8 }
+ 286 0 }
+ 287 8 }
+ 288
+
+ 289
+
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+ private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
+ 299
+ ArchiveEntry entry;
+ 300
+ try {
+ 301 172 while ((entry = input.getNextEntry()) != null ) {
+ 302 166 if (entry.isDirectory()) {
+ 303 25 final File d = new File(destination, entry.getName());
+ 304 25 if (!d.exists()) {
+ 305 25 if (!d.mkdirs()) {
+ 306 0 final String msg = String.format("Unable to create '%s'." , d.getAbsolutePath());
+ 307 0 throw new AnalysisException(msg);
+ 308
+ }
+ 309
+ }
+ 310 25 } else {
+ 311 141 final File file = new File(destination, entry.getName());
+ 312 141 final String ext = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(file.getName());
+ 313 141 if (engine.supportsExtension(ext)) {
+ 314 8 BufferedOutputStream bos = null ;
+ 315
+ FileOutputStream fos;
+ 316
+ try {
+ 317 8 fos = new FileOutputStream(file);
+ 318 8 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 319
+ int count;
+ 320 8 final byte data[] = new byte [BUFFER_SIZE];
+ 321 1709 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+ 322 1701 bos.write(data, 0, count);
+ 323
+ }
+ 324 8 bos.flush();
+ 325 0 } catch (FileNotFoundException ex) {
+ 326 0 Logger.getLogger(ArchiveAnalyzer.class
+ 327
+ .getName()).log(Level.FINE, null , ex);
+ 328 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
+ 329 0 throw new AnalysisException(msg, ex);
+ 330 0 } catch (IOException ex) {
+ 331 0 Logger.getLogger(ArchiveAnalyzer.class
+ 332
+ .getName()).log(Level.FINE, null , ex);
+ 333 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+ 334 0 throw new AnalysisException(msg, ex);
+ 335
+ } finally {
+ 336 8 if (bos != null ) {
+ 337
+ try {
+ 338 8 bos.close();
+ 339 0 } catch (IOException ex) {
+ 340 0 Logger.getLogger(ArchiveAnalyzer.class
+ 341
+ .getName()).log(Level.FINEST, null , ex);
+ 342 8 }
+ 343
+ }
+ 344
+ }
+ 345
+ }
+ 346 141 }
+ 347
+ }
+ 348 0 } catch (IOException ex) {
+ 349 0 throw new ArchiveExtractionException(ex);
+ 350 0 } catch (Throwable ex) {
+ 351 0 throw new ArchiveExtractionException(ex);
+ 352
+ } finally {
+ 353 6 if (input != null ) {
+ 354
+ try {
+ 355 6 input.close();
+ 356 0 } catch (IOException ex) {
+ 357 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+ 358 6 }
+ 359
+ }
+ 360
+ }
+ 361 6 }
+ 362
+
+ 363
+
+ 364
+
+ 365
+
+ 366
+
+ 367
+
+ 368
+
+ 369
+
+ 370
+
+ 371
+ private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
+ 372 2 FileOutputStream out = null ;
+ 373
+ try {
+ 374 2 out = new FileOutputStream(outputFile);
+ 375 2 final byte [] buffer = new byte [BUFFER_SIZE];
+ 376 2 int n = 0;
+ 377 272 while (-1 != (n = inputStream.read(buffer))) {
+ 378 270 out.write(buffer, 0, n);
+ 379
+ }
+ 380 0 } catch (FileNotFoundException ex) {
+ 381 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+ 382 0 throw new ArchiveExtractionException(ex);
+ 383 0 } catch (IOException ex) {
+ 384 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+ 385 0 throw new ArchiveExtractionException(ex);
+ 386
+ } finally {
+ 387 2 if (out != null ) {
+ 388
+ try {
+ 389 2 out.close();
+ 390 0 } catch (IOException ex) {
+ 391 0 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+ 392 2 }
+ 393
+ }
+ 394
+ }
+ 395 2 }
+ 396
}
-
+
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 c35c07950..90f91ab92 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
@@ -12,7 +12,7 @@
Classes in this File Line Coverage Branch Coverage Complexity
- CPEAnalyzer 4.0625; 4.062
+ CPEAnalyzer 4.0625; 4.062
CPEAnalyzer$IdentifierConfidence 4.0625; 4.062
CPEAnalyzer$IdentifierMatch 4.0625; 4.062
@@ -222,20 +222,20 @@
102
public void open() throws IOException, DatabaseException {
- 103 10 cpe = new CpeIndexReader();
- 104 10 cpe.open();
- 105 10 cve = new CveDB();
+ 103 12 cpe = new CpeIndexReader();
+ 104 12 cpe.open();
+ 105 12 cve = new CveDB();
106
try {
- 107 10 cve.open();
+ 107 12 cve.open();
108 0 } catch (SQLException ex) {
109 0 Logger.getLogger(CPEAnalyzer.class .getName()).log(Level.FINE, null , ex);
110 0 throw new DatabaseException("Unable to open the cve db" , ex);
111 0 } catch (ClassNotFoundException ex) {
112 0 Logger.getLogger(CPEAnalyzer.class .getName()).log(Level.FINE, null , ex);
113 0 throw new DatabaseException("Unable to open the cve db" , ex);
- 114 10 }
- 115 10 }
+ 114 12 }
+ 115 12 }
116
117
@@ -248,15 +248,15 @@
@Override
121
public void close() {
- 122 10 if (cpe != null ) {
- 123 10 cpe.close();
+ 122 12 if (cpe != null ) {
+ 123 12 cpe.close();
124
}
- 125 10 if (cve != null ) {
- 126 10 cve.close();
+ 125 12 if (cve != null ) {
+ 126 12 cve.close();
127
}
- 128 10 }
+ 128 12 }
129
130
@@ -320,45 +320,45 @@
162
protected void determineCPE(Dependency dependency) throws CorruptIndexException, IOException, ParseException {
- 163 13 Confidence vendorConf = Confidence.HIGHEST;
- 164 13 Confidence productConf = Confidence.HIGHEST;
+ 163 19 Confidence vendorConf = Confidence.HIGHEST;
+ 164 19 Confidence productConf = Confidence.HIGHEST;
165
- 166 13 String vendors = addEvidenceWithoutDuplicateTerms("" , dependency.getVendorEvidence(), vendorConf);
- 167 13 String products = addEvidenceWithoutDuplicateTerms("" , dependency.getProductEvidence(), productConf);
+ 166 19 String vendors = addEvidenceWithoutDuplicateTerms("" , dependency.getVendorEvidence(), vendorConf);
+ 167 19 String products = addEvidenceWithoutDuplicateTerms("" , dependency.getProductEvidence(), productConf);
168
- 169 13 int ctr = 0;
+ 169 19 int ctr = 0;
170
do {
- 171 52 if (!vendors.isEmpty() && !products.isEmpty()) {
- 172 52 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
+ 171 76 if (!vendors.isEmpty() && !products.isEmpty()) {
+ 172 72 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
173
dependency.getVendorEvidence().getWeighting());
174
- 175 52 for (IndexEntry e : entries) {
- 176 622 if (verifyEntry(e, dependency)) {
- 177 51 final String vendor = e.getVendor();
- 178 51 final String product = e.getProduct();
- 179 51 determineIdentifiers(dependency, vendor, product);
- 180 622 }
+ 175 72 for (IndexEntry e : entries) {
+ 176 722 if (verifyEntry(e, dependency)) {
+ 177 71 final String vendor = e.getVendor();
+ 178 71 final String product = e.getProduct();
+ 179 71 determineIdentifiers(dependency, vendor, product);
+ 180 722 }
181
}
182
}
- 183 52 vendorConf = reduceConfidence(vendorConf);
- 184 52 if (dependency.getVendorEvidence().contains(vendorConf)) {
- 185 49 vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), vendorConf);
+ 183 76 vendorConf = reduceConfidence(vendorConf);
+ 184 76 if (dependency.getVendorEvidence().contains(vendorConf)) {
+ 185 61 vendors = addEvidenceWithoutDuplicateTerms(vendors, dependency.getVendorEvidence(), vendorConf);
186
}
- 187 52 productConf = reduceConfidence(productConf);
- 188 52 if (dependency.getProductEvidence().contains(productConf)) {
- 189 52 products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), productConf);
+ 187 76 productConf = reduceConfidence(productConf);
+ 188 76 if (dependency.getProductEvidence().contains(productConf)) {
+ 189 64 products = addEvidenceWithoutDuplicateTerms(products, dependency.getProductEvidence(), productConf);
190
}
- 191 52 } while ((++ctr) < 4);
- 192 13 }
+ 191 76 } while ((++ctr) < 4);
+ 192 19 }
193
194
@@ -385,31 +385,31 @@
205
private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
- 206 127 final String txt = (text == null ) ? "" : text;
- 207 127 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
- 208 127 sb.append(' ' ).append(txt).append(' ' );
- 209 127 for (Evidence e : ec.iterator(confidenceFilter)) {
- 210 309 String value = e.getValue();
+ 206 163 final String txt = (text == null ) ? "" : text;
+ 207 163 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
+ 208 163 sb.append(' ' ).append(txt).append(' ' );
+ 209 163 for (Evidence e : ec.iterator(confidenceFilter)) {
+ 210 355 String value = e.getValue();
211
212
213
- 214 309 if (value.startsWith("http://" )) {
+ 214 355 if (value.startsWith("http://" )) {
215 32 value = value.substring(7).replaceAll("\\." , " " );
216
}
- 217 309 if (value.startsWith("https://" )) {
+ 217 355 if (value.startsWith("https://" )) {
218 0 value = value.substring(8).replaceAll("\\." , " " );
219
}
- 220 309 if (sb.indexOf(" " + value + " " ) < 0) {
- 221 200 sb.append(value).append(' ' );
+ 220 355 if (sb.indexOf(" " + value + " " ) < 0) {
+ 221 222 sb.append(value).append(' ' );
222
}
- 223 309 }
- 224 127 return sb.toString().trim();
+ 223 355 }
+ 224 163 return sb.toString().trim();
225
}
226
@@ -430,13 +430,13 @@
234
private Confidence reduceConfidence(final Confidence c) {
- 235 104 if (c == Confidence.HIGHEST) {
- 236 26 return Confidence.HIGH;
- 237 78 } else if (c == Confidence.HIGH) {
- 238 26 return Confidence.MEDIUM;
+ 235 152 if (c == Confidence.HIGHEST) {
+ 236 38 return Confidence.HIGH;
+ 237 114 } else if (c == Confidence.HIGH) {
+ 238 38 return Confidence.MEDIUM;
239
} else {
- 240 52 return Confidence.LOW;
+ 240 76 return Confidence.LOW;
241
}
242
@@ -485,23 +485,23 @@
Set<String> vendorWeightings, Set<String> productWeightings)
264
throws CorruptIndexException, IOException, ParseException {
- 265 53 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
+ 265 73 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
266
- 267 53 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
- 268 53 if (searchString == null ) {
+ 267 73 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
+ 268 73 if (searchString == null ) {
269 0 return ret;
270
}
271
- 272 53 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
- 273 1083 for (ScoreDoc d : docs.scoreDocs) {
- 274 1030 if (d.score >= 0.08) {
- 275 640 final Document doc = cpe.getDocument(d.doc);
- 276 640 final IndexEntry entry = new IndexEntry();
- 277 640 entry.setVendor(doc.get(Fields.VENDOR));
- 278 640 entry.setProduct(doc.get(Fields.PRODUCT));
+ 272 73 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
+ 273 1212 for (ScoreDoc d : docs.scoreDocs) {
+ 274 1139 if (d.score >= 0.08) {
+ 275 741 final Document doc = cpe.getDocument(d.doc);
+ 276 741 final IndexEntry entry = new IndexEntry();
+ 277 741 entry.setVendor(doc.get(Fields.VENDOR));
+ 278 741 entry.setProduct(doc.get(Fields.PRODUCT));
279
280
@@ -516,16 +516,16 @@
285
- 286 640 entry.setSearchScore(d.score);
- 287 640 if (!ret.contains(entry)) {
- 288 640 ret.add(entry);
+ 286 741 entry.setSearchScore(d.score);
+ 287 741 if (!ret.contains(entry)) {
+ 288 741 ret.add(entry);
289
}
290
}
291
}
- 292 53 return ret;
+ 292 73 return ret;
293
}
294
@@ -566,23 +566,23 @@
protected String buildSearch(String vendor, String product,
312
Set<String> vendorWeighting, Set<String> productWeightings) {
- 313 57 final String v = vendor;
- 314 57 final String p = product;
- 315 57 final StringBuilder sb = new StringBuilder(v.length() + p.length()
+ 313 77 final String v = vendor;
+ 314 77 final String p = product;
+ 315 77 final StringBuilder sb = new StringBuilder(v.length() + p.length()
316
+ Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
317
- 318 57 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
+ 318 77 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
319 0 return null ;
320
}
- 321 57 sb.append(" AND " );
- 322 57 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
+ 321 77 sb.append(" AND " );
+ 322 77 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
323 0 return null ;
324
}
- 325 57 return sb.toString();
+ 325 77 return sb.toString();
326
}
327
@@ -617,47 +617,47 @@
342
private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
- 343 114 sb.append(" " ).append(field).append(":( " );
+ 343 154 sb.append(" " ).append(field).append(":( " );
344
- 345 114 final String cleanText = cleanseText(searchText);
+ 345 154 final String cleanText = cleanseText(searchText);
346
- 347 114 if ("" .equals(cleanText)) {
+ 347 154 if ("" .equals(cleanText)) {
348 0 return false ;
349
}
350
- 351 114 if (weightedText == null || weightedText.isEmpty()) {
- 352 16 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+ 351 154 if (weightedText == null || weightedText.isEmpty()) {
+ 352 40 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
353
} else {
- 354 98 final StringTokenizer tokens = new StringTokenizer(cleanText);
- 355 1123 while (tokens.hasMoreElements()) {
- 356 1025 final String word = tokens.nextToken();
- 357 1025 String temp = null ;
- 358 1025 for (String weighted : weightedText) {
- 359 2110 final String weightedStr = cleanseText(weighted);
- 360 2110 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
- 361 225 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
- 362 225 if (!word.equalsIgnoreCase(weightedStr)) {
+ 354 114 final StringTokenizer tokens = new StringTokenizer(cleanText);
+ 355 1211 while (tokens.hasMoreElements()) {
+ 356 1097 final String word = tokens.nextToken();
+ 357 1097 String temp = null ;
+ 358 1097 for (String weighted : weightedText) {
+ 359 2202 final String weightedStr = cleanseText(weighted);
+ 360 2202 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
+ 361 251 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
+ 362 251 if (!word.equalsIgnoreCase(weightedStr)) {
363 18 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
364
}
365
}
- 366 2110 }
- 367 1025 if (temp == null ) {
- 368 800 temp = LuceneUtils.escapeLuceneQuery(word);
+ 366 2202 }
+ 367 1097 if (temp == null ) {
+ 368 846 temp = LuceneUtils.escapeLuceneQuery(word);
369
}
- 370 1025 sb.append(" " ).append(temp);
- 371 1025 }
+ 370 1097 sb.append(" " ).append(temp);
+ 371 1097 }
372
}
- 373 114 sb.append(" ) " );
- 374 114 return true ;
+ 373 154 sb.append(" ) " );
+ 374 154 return true ;
375
}
376
@@ -678,7 +678,7 @@
384
private String cleanseText(String text) {
- 385 2224 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
+ 385 2356 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
386
}
387
@@ -701,15 +701,15 @@
396
private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
- 397 2110 if (l == null || r == null ) {
+ 397 2202 if (l == null || r == null ) {
398 0 return false ;
399
}
400
- 401 2110 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 402 2110 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 403 2110 return left.equalsIgnoreCase(right);
+ 401 2202 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 402 2202 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 403 2202 return left.equalsIgnoreCase(right);
404
}
405
@@ -734,18 +734,18 @@
415
private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
- 416 622 boolean isValid = false ;
+ 416 722 boolean isValid = false ;
417
- 418 622 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
+ 418 722 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
419
&& collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
420
- 421 51 isValid = true ;
+ 421 71 isValid = true ;
422
}
- 423 622 return isValid;
+ 423 722 return isValid;
424
}
425
@@ -792,41 +792,41 @@
446
- 447 679 if (text == null ) {
+ 447 799 if (text == null ) {
448 0 return false ;
449
}
- 450 679 final String[] words = text.split("[\\s_-]" );
- 451 679 final List<String> list = new ArrayList<String>();
- 452 679 String tempWord = null ;
- 453 1826 for (String word : words) {
+ 450 799 final String[] words = text.split("[\\s_-]" );
+ 451 799 final List<String> list = new ArrayList<String>();
+ 452 799 String tempWord = null ;
+ 453 2254 for (String word : words) {
454
455
- 456 1147 if (tempWord != null ) {
+ 456 1455 if (tempWord != null ) {
457 17 list.add(tempWord + word);
458 17 tempWord = null ;
- 459 1130 } else if (word.length() <= 2) {
- 460 40 tempWord = word;
+ 459 1438 } else if (word.length() <= 2) {
+ 460 41 tempWord = word;
461
} else {
- 462 1090 list.add(word);
+ 462 1397 list.add(word);
463
}
464
}
- 465 679 if (tempWord != null && !list.isEmpty()) {
- 466 19 final String tmp = list.get(list.size() - 1) + tempWord;
- 467 19 list.add(tmp);
+ 465 799 if (tempWord != null && !list.isEmpty()) {
+ 466 20 final String tmp = list.get(list.size() - 1) + tempWord;
+ 467 20 list.add(tmp);
468
}
- 469 679 boolean contains = true ;
- 470 679 for (String word : list) {
- 471 1126 contains &= ec.containsUsedString(word);
+ 469 799 boolean contains = true ;
+ 470 799 for (String word : list) {
+ 471 1434 contains &= ec.containsUsedString(word);
472
}
- 473 679 return contains;
+ 473 799 return contains;
474
}
475
@@ -855,15 +855,15 @@
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
487
try {
- 488 9 determineCPE(dependency);
+ 488 15 determineCPE(dependency);
489 0 } catch (CorruptIndexException ex) {
490 0 throw new AnalysisException("CPE Index is corrupt." , ex);
491 0 } catch (IOException ex) {
492 0 throw new AnalysisException("Failure opening the CPE Index." , ex);
493 0 } catch (ParseException ex) {
494 0 throw new AnalysisException("Unable to parse the generated Lucene query for this dependency." , ex);
- 495 9 }
- 496 9 }
+ 495 15 }
+ 496 15 }
497
498
@@ -880,7 +880,7 @@
@Override
504
public Set<String> getSupportedExtensions() {
- 505 129 return null ;
+ 505 132 return null ;
506
}
507
@@ -899,7 +899,7 @@
@Override
514
public String getName() {
- 515 3 return "CPE Analyzer" ;
+ 515 9 return "CPE Analyzer" ;
516
}
517
@@ -920,7 +920,7 @@
@Override
525
public boolean supportsExtension(String extension) {
- 526 3 return true ;
+ 526 9 return true ;
527
}
528
@@ -939,7 +939,7 @@
@Override
535
public AnalysisPhase getAnalysisPhase() {
- 536 3 return AnalysisPhase.IDENTIFIER_ANALYSIS;
+ 536 6 return AnalysisPhase.IDENTIFIER_ANALYSIS;
537
}
538
@@ -958,8 +958,8 @@
@Override
545
public void initialize() throws Exception {
- 546 1 this .open();
- 547 1 }
+ 546 3 this .open();
+ 547 3 }
548
549
@@ -988,37 +988,37 @@
561
private void determineIdentifiers(Dependency dependency, String vendor, String product) throws UnsupportedEncodingException {
- 562 51 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
- 563 51 DependencyVersion bestGuess = new DependencyVersion("-" );
- 564 51 Confidence bestGuessConf = null ;
- 565 51 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
- 566 255 for (Confidence conf : Confidence.values()) {
- 567 204 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
- 568 144 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
- 569 144 if (evVer == null ) {
+ 562 71 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
+ 563 71 DependencyVersion bestGuess = new DependencyVersion("-" );
+ 564 71 Confidence bestGuessConf = null ;
+ 565 71 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
+ 566 355 for (Confidence conf : Confidence.values()) {
+ 567 284 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
+ 568 160 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
+ 569 160 if (evVer == null ) {
570 0 continue ;
571
}
- 572 144 for (VulnerableSoftware vs : cpes) {
+ 572 160 for (VulnerableSoftware vs : cpes) {
573
DependencyVersion dbVer;
- 574 8188 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
+ 574 9080 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
575 2855 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
576
} else {
- 577 5333 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
+ 577 6225 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
578
}
- 579 8188 if (dbVer == null
+ 579 9080 if (dbVer == null
580
|| evVer.equals(dbVer)) {
- 581 137 final String url = String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(vs.getName(), "UTF-8" ));
- 582 137 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
- 583 137 collected.add(match);
- 584 137 } else {
+ 581 169 final String url = String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(vs.getName(), "UTF-8" ));
+ 582 169 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
+ 583 169 collected.add(match);
+ 584 169 } else {
585
- 586 8051 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
+ 586 8911 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
587
&& evVer.matchesAtLeastThreeLevels(dbVer)) {
588 412 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
@@ -1033,41 +1033,41 @@
}
595
}
- 596 8188 }
- 597 144 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
- 598 41 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
- 599 41 bestGuess = evVer;
- 600 41 bestGuessConf = conf;
+ 596 9080 }
+ 597 160 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+ 598 49 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
+ 599 49 bestGuess = evVer;
+ 600 49 bestGuessConf = conf;
601
}
602
}
- 603 144 }
+ 603 160 }
604
}
- 605 51 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
- 606 51 final String url = null ;
- 607 51 if (bestGuessConf == null ) {
- 608 0 bestGuessConf = Confidence.LOW;
+ 605 71 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
+ 606 71 final String url = null ;
+ 607 71 if (bestGuessConf == null ) {
+ 608 12 bestGuessConf = Confidence.LOW;
609
}
- 610 51 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
- 611 51 collected.add(match);
+ 610 71 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
+ 611 71 collected.add(match);
612
- 613 51 Collections.sort(collected);
- 614 51 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
- 615 51 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
- 616 51 for (IdentifierMatch m : collected) {
- 617 188 if (bestIdentifierQuality.equals(m.getConfidence())
+ 613 71 Collections.sort(collected);
+ 614 71 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
+ 615 71 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
+ 616 71 for (IdentifierMatch m : collected) {
+ 617 240 if (bestIdentifierQuality.equals(m.getConfidence())
618
&& bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
- 619 60 dependency.addIdentifier(m.getIdentifier());
+ 619 88 dependency.addIdentifier(m.getIdentifier());
620
}
621
}
- 622 51 }
+ 622 71 }
623
624
@@ -1105,7 +1105,7 @@
642
- 643 185 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
+ 643 225 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
644
645
@@ -1130,11 +1130,11 @@
655
- 656 188 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
- 657 188 this .identifier = new Identifier(type, value, url);
- 658 188 this .confidence = identifierConfidence;
- 659 188 this .evidenceConfidence = evidenceConfidence;
- 660 188 }
+ 656 240 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
+ 657 240 this .identifier = new Identifier(type, value, url);
+ 658 240 this .confidence = identifierConfidence;
+ 659 240 this .evidenceConfidence = evidenceConfidence;
+ 660 240 }
661
662
@@ -1159,7 +1159,7 @@
672
public Confidence getEvidenceConfidence() {
- 673 199 return evidenceConfidence;
+ 673 263 return evidenceConfidence;
674
}
675
@@ -1200,7 +1200,7 @@
694
public IdentifierConfidence getConfidence() {
- 695 239 return confidence;
+ 695 311 return confidence;
696
}
697
@@ -1241,7 +1241,7 @@
716
public Identifier getIdentifier() {
- 717 60 return identifier;
+ 717 88 return identifier;
718
}
719
@@ -1372,16 +1372,16 @@
@Override
792
public int compareTo(IdentifierMatch o) {
- 793 185 int conf = this .confidence.compareTo(o.confidence);
- 794 185 if (conf == 0) {
- 795 145 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
- 796 145 if (conf == 0) {
- 797 67 conf = identifier.compareTo(o.identifier);
+ 793 225 int conf = this .confidence.compareTo(o.confidence);
+ 794 225 if (conf == 0) {
+ 795 177 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
+ 796 177 if (conf == 0) {
+ 797 83 conf = identifier.compareTo(o.identifier);
798
}
799
}
- 800 185 return conf;
+ 800 225 return conf;
801
}
802
@@ -1390,6 +1390,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 f7a57a20c..3b7691e1a 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 @@
@@ -68,508 +68,531 @@
25
import java.util.Set;
26
- import java.util.regex.Matcher;
+ import java.util.logging.Level;
27
- import java.util.regex.Pattern;
+ import java.util.logging.Logger;
28
- import org.owasp.dependencycheck.Engine;
+ import java.util.regex.Matcher;
29
- import org.owasp.dependencycheck.dependency.Dependency;
+ import java.util.regex.Pattern;
30
- import org.owasp.dependencycheck.utils.DependencyVersion;
+ import org.owasp.dependencycheck.Engine;
31
- import org.owasp.dependencycheck.utils.DependencyVersionUtil;
+ import org.owasp.dependencycheck.dependency.Dependency;
32
-
+ import org.owasp.dependencycheck.utils.DependencyVersion;
33
-
+ import org.owasp.dependencycheck.utils.DependencyVersionUtil;
34
-
+ import org.owasp.dependencycheck.utils.LogUtils;
35
-
+
36
-
+
37
-
+
38
-
+
39
-
+
40
-
+
41
-
+
42
-
+
43
-
- 44 1 public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Analyzer {
+
+ 44
+
45
-
+
46
-
- 47
-
+
+ 47 1 public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Analyzer {
48
-
+
49
-
- 50 1 private static final Pattern STARTING_TEXT_PATTERN = Pattern.compile("^[a-zA-Z]*" );
+
+ 50
+
51
-
+
52
-
- 53
- 54 1 private boolean analyzed = false ;
+ 53 1 private static final Pattern STARTING_TEXT_PATTERN = Pattern.compile("^[a-zA-Z]*" );
+ 54
+
55
-
+
56
-
- 57
-
+
+ 57 1 private boolean analyzed = false ;
58
-
- 59
-
- 60 1 private static final Set<String> EXTENSIONS = null ;
- 61
-
- 62
-
- 63
-
- 64
- private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
- 65
-
- 66
-
- 67
-
- 68 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
- 69
-
- 70
-
- 71
-
- 72
-
- 73
-
- 74
-
- 75
- public Set<String> getSupportedExtensions() {
- 76 129 return EXTENSIONS;
- 77
- }
- 78
-
- 79
-
- 80
-
- 81
-
- 82
-
- 83
-
- 84
- public String getName() {
- 85 3 return ANALYZER_NAME;
- 86
- }
- 87
-
- 88
-
- 89
-
- 90
-
- 91
-
- 92
-
- 93
-
- 94
-
- 95
- public boolean supportsExtension(String extension) {
- 96 3 return true ;
- 97
- }
- 98
-
- 99
-
- 100
-
- 101
-
- 102
-
- 103
-
- 104
- public AnalysisPhase getAnalysisPhase() {
- 105 3 return ANALYSIS_PHASE;
- 106
- }
- 107
- 108
-
- 109
+ 59
+
+ 60
- 110
-
- 111
-
- 112
-
- 113
-
- 114
-
- 115
-
- 116
-
- 117
-
- 118
+ 61
+
+ 62
+ 63 1 private static final Set<String> EXTENSIONS = null ;
+ 64
+
+ 65
+
+ 66
+
+ 67
+ private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
+ 68
+
+ 69
+
+ 70
+
+ 71 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+ public Set<String> getSupportedExtensions() {
+ 79 132 return EXTENSIONS;
+ 80
+ }
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+ public String getName() {
+ 88 9 return ANALYZER_NAME;
+ 89
+ }
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+ public boolean supportsExtension(String extension) {
+ 99 9 return true ;
+ 100
+ }
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+ public AnalysisPhase getAnalysisPhase() {
+ 108 6 return ANALYSIS_PHASE;
+ 109
+ }
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
119
- @Override
+
120
+
+ 121
+
+ 122
+ @Override
+ 123
public void analyze(Dependency ignore, Engine engine) throws AnalysisException {
- 121 3 if (!analyzed) {
- 122 1 analyzed = true ;
- 123 1 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
- 124 1 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
- 125
+ 124 9 if (!analyzed) {
+ 125 1 analyzed = true ;
+ 126 1 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
+ 127 1 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
+ 128
- 126 4 while (mainIterator.hasNext()) {
- 127 3 final Dependency dependency = mainIterator.next();
- 128 3 if (mainIterator.hasNext()) {
- 129 2 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
- 130 5 while (subIterator.hasNext()) {
- 131 3 final Dependency nextDependency = subIterator.next();
- 132
-
- 133 3 if (identifiersMatch(dependency, nextDependency)
- 134
- && hasSameBasePath(dependency, nextDependency)
+ 129 4 while (mainIterator.hasNext()) {
+ 130 3 final Dependency dependency = mainIterator.next();
+ 131 3 if (mainIterator.hasNext()) {
+ 132 2 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
+ 133 5 while (subIterator.hasNext()) {
+ 134 3 final Dependency nextDependency = subIterator.next();
135
- && fileNameMatch(dependency, nextDependency)) {
- 136
- 137 0 if (isCore(dependency, nextDependency)) {
- 138 0 dependency.addRelatedDependency(nextDependency);
+ 136 3 if (identifiersMatch(dependency, nextDependency)
+ 137
+ && hasSameBasePath(dependency, nextDependency)
+ 138
+ && fileNameMatch(dependency, nextDependency)) {
139
+
+ 140 0 if (isCore(dependency, nextDependency)) {
+ 141 0 dependency.addRelatedDependency(nextDependency);
+ 142
- 140 0 final Iterator<Dependency> i = nextDependency.getRelatedDependencies().iterator();
- 141 0 while (i.hasNext()) {
- 142 0 dependency.addRelatedDependency(i.next());
- 143 0 i.remove();
- 144
+ 143 0 final Iterator<Dependency> i = nextDependency.getRelatedDependencies().iterator();
+ 144 0 while (i.hasNext()) {
+ 145 0 dependency.addRelatedDependency(i.next());
+ 146 0 i.remove();
+ 147
}
- 145 0 dependenciesToRemove.add(nextDependency);
- 146 0 } else {
- 147 0 if (isCore(nextDependency, dependency)) {
- 148 0 nextDependency.addRelatedDependency(dependency);
- 149
-
- 150 0 final Iterator<Dependency> i = dependency.getRelatedDependencies().iterator();
- 151 0 while (i.hasNext()) {
- 152 0 nextDependency.addRelatedDependency(i.next());
- 153 0 i.remove();
- 154
- }
- 155 0 dependenciesToRemove.add(dependency);
+ 148 0 dependenciesToRemove.add(nextDependency);
+ 149 0 } else {
+ 150 0 nextDependency.addRelatedDependency(dependency);
+ 151
+
+ 152 0 final Iterator<Dependency> i = dependency.getRelatedDependencies().iterator();
+ 153 0 while (i.hasNext()) {
+ 154 0 nextDependency.addRelatedDependency(i.next());
+ 155 0 i.remove();
156
}
- 157
- }
+ 157 0 dependenciesToRemove.add(dependency);
158
+ }
+ 159
}
- 159 3 }
- 160
+ 160 3 }
+ 161
}
- 161 3 }
- 162
-
+ 162 3 }
163
+
+ 164
- 164 1 for (Dependency d : dependenciesToRemove) {
- 165 0 engine.getDependencies().remove(d);
- 166
- }
+ 165 1 for (Dependency d : dependenciesToRemove) {
+ 166 0 engine.getDependencies().remove(d);
167
+ }
+ 168
}
- 168 3 }
- 169
-
+ 169 9 }
170
-
+
171
-
+
172
-
+
173
-
+
174
-
+
175
-
+
176
-
+
177
+
+ 178
private String getBaseRepoPath(final String path) {
- 178 0 int pos = path.indexOf("repository" + File.separator) + 11;
- 179 0 if (pos < 0) {
- 180 0 return path;
- 181
+ 179 0 int pos = path.indexOf("repository" + File.separator) + 11;
+ 180 0 if (pos < 0) {
+ 181 0 return path;
+ 182
}
- 182 0 int tmp = path.indexOf(File.separator, pos);
- 183 0 if (tmp <= 0) {
- 184 0 return path;
- 185
+ 183 0 int tmp = path.indexOf(File.separator, pos);
+ 184 0 if (tmp <= 0) {
+ 185 0 return path;
+ 186
}
- 186 0 if (tmp > 0) {
- 187 0 pos = tmp + 1;
- 188
+ 187 0 if (tmp > 0) {
+ 188 0 pos = tmp + 1;
+ 189
}
- 189 0 tmp = path.indexOf(File.separator, pos);
- 190 0 if (tmp > 0) {
- 191 0 pos = tmp + 1;
- 192
+ 190 0 tmp = path.indexOf(File.separator, pos);
+ 191 0 if (tmp > 0) {
+ 192 0 pos = tmp + 1;
+ 193
}
- 193 0 return path.substring(0, pos);
- 194
- }
+ 194 0 return path.substring(0, pos);
195
-
+ }
196
-
+
197
-
+
198
-
+
199
-
+
200
-
+
201
-
- 202
-
- 203
-
- 204
-
- 205
- private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
- 206 0 if (dependency1 == null || dependency1.getFileName() == null
- 207
- || dependency2 == null || dependency2.getFileName() == null ) {
- 208 0 return false ;
- 209
- }
- 210 0 String fileName1 = dependency1.getFileName();
- 211 0 String fileName2 = dependency2.getFileName();
- 212
-
- 213
-
- 214
-
- 215 0 final File one = new File(fileName1);
- 216 0 final File two = new File(fileName2);
- 217 0 final String oneParent = one.getParent();
- 218 0 final String twoParent = two.getParent();
- 219 0 if (oneParent != null ) {
- 220 0 if (twoParent != null && oneParent.equals(twoParent)) {
- 221 0 fileName1 = one.getName();
- 222 0 fileName2 = two.getName();
- 223
- } else {
- 224 0 return false ;
- 225
- }
- 226 0 } else if (twoParent != null ) {
- 227 0 return false ;
- 228
- }
- 229
-
- 230
-
- 231 0 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
- 232 0 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
- 233 0 if (version1 != null && version2 != null ) {
- 234 0 if (!version1.equals(version2)) {
- 235 0 return false ;
- 236
- }
- 237
- }
- 238
-
- 239
-
- 240 0 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
- 241 0 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
- 242 0 if (match1.find() && match2.find()) {
- 243 0 return match1.group().equals(match2.group());
- 244
- }
- 245
-
- 246 0 return false ;
- 247
- }
- 248
-
- 249
-
- 250
-
- 251
-
- 252
-
- 253
- 254
+ 202
- 255
+ 203
- 256
+ 204
+ 205
+
+ 206
+ private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
+ 207 0 if (dependency1 == null || dependency1.getFileName() == null
+ 208
+ || dependency2 == null || dependency2.getFileName() == null ) {
+ 209 0 return false ;
+ 210
+ }
+ 211 0 String fileName1 = dependency1.getFileName();
+ 212 0 String fileName2 = dependency2.getFileName();
+ 213
+
+ 214
+
+ 215
+
+ 216 0 final File one = new File(fileName1);
+ 217 0 final File two = new File(fileName2);
+ 218 0 final String oneParent = one.getParent();
+ 219 0 final String twoParent = two.getParent();
+ 220 0 if (oneParent != null ) {
+ 221 0 if (twoParent != null && oneParent.equals(twoParent)) {
+ 222 0 fileName1 = one.getName();
+ 223 0 fileName2 = two.getName();
+ 224
+ } else {
+ 225 0 return false ;
+ 226
+ }
+ 227 0 } else if (twoParent != null ) {
+ 228 0 return false ;
+ 229
+ }
+ 230
+
+ 231
+
+ 232 0 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
+ 233 0 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
+ 234 0 if (version1 != null && version2 != null ) {
+ 235 0 if (!version1.equals(version2)) {
+ 236 0 return false ;
+ 237
+ }
+ 238
+ }
+ 239
+
+ 240
+
+ 241 0 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
+ 242 0 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
+ 243 0 if (match1.find() && match2.find()) {
+ 244 0 return match1.group().equals(match2.group());
+ 245
+ }
+ 246
+
+ 247 0 return false ;
+ 248
+ }
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
257
-
+
258
+
+ 259
private boolean identifiersMatch(Dependency dependency1, Dependency dependency2) {
- 259 3 if (dependency1 == null || dependency1.getIdentifiers() == null
- 260
+ 260 3 if (dependency1 == null || dependency1.getIdentifiers() == null
+ 261
|| dependency2 == null || dependency2.getIdentifiers() == null ) {
- 261 0 return false ;
- 262
+ 262 0 return false ;
+ 263
}
- 263 3 return dependency1.getIdentifiers().size() > 0
- 264
- && dependency2.getIdentifiers().equals(dependency1.getIdentifiers());
+ 264 3 final boolean matches = dependency1.getIdentifiers().size() > 0
265
- }
- 266
-
- 267
-
- 268
-
+ && dependency2.getIdentifiers().equals(dependency1.getIdentifiers());
+ 266 3 if (LogUtils.isVerboseLoggingEnabled()) {
+ 267 0 final String msg = String.format("IdentifiersMatch=%s (%s, %s)" , matches, dependency1.getFileName(), dependency2.getFileName());
+ 268 0 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
269
-
- 270
-
+ }
+ 270 3 return matches;
271
-
+ }
272
-
+
273
-
- 274
- private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
- 275 0 if (dependency1 == null || dependency2 == null ) {
- 276 0 return false ;
- 277
- }
- 278 0 final File lFile = new File(dependency1.getFilePath());
- 279 0 String left = lFile.getParent();
- 280 0 final File rFile = new File(dependency2.getFilePath());
- 281 0 String right = rFile.getParent();
- 282 0 if (left == null ) {
- 283 0 if (right == null ) {
- 284 0 return true ;
- 285
- }
- 286 0 return false ;
- 287
- }
- 288 0 if (left.equalsIgnoreCase(right)) {
- 289 0 return true ;
- 290
- }
- 291 0 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
- 292 0 left = getBaseRepoPath(left);
- 293 0 right = getBaseRepoPath(right);
- 294
- }
- 295 0 return left.equalsIgnoreCase(right);
- 296
- }
- 297
-
- 298
- 299
-
- 300
-
- 301
+ 274
+
+ 275
- 302
-
- 303
-
- 304
-
- 305
-
- 306
-
- 307
-
- 308
-
- 309
-
- 310
+ 276
+
+ 277
+
+ 278
+
+ 279
- 311
- private boolean isCore(Dependency left, Dependency right) {
- 312 0 final String leftName = left.getFileName().toLowerCase();
- 313 0 final String rightName = right.getFileName().toLowerCase();
- 314
-
- 315 0 if (rightName.contains("core" ) && !leftName.contains("core" )) {
- 316 0 return false ;
- 317 0 } else if (!rightName.contains("core" ) && leftName.contains("core" )) {
- 318 0 return true ;
- 319
- } else {
- 320
-
- 321
-
- 322 0 if (leftName.length() > rightName.length()) {
- 323 0 return false ;
- 324
- }
- 325 0 return true ;
- 326
+ 280
+ private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
+ 281 1 if (dependency1 == null || dependency2 == null ) {
+ 282 0 return false ;
+ 283
}
- 327
+ 284 1 final File lFile = new File(dependency1.getFilePath());
+ 285 1 String left = lFile.getParent();
+ 286 1 final File rFile = new File(dependency2.getFilePath());
+ 287 1 String right = rFile.getParent();
+ 288 1 if (left == null ) {
+ 289 0 if (right == null ) {
+ 290 0 return true ;
+ 291
+ }
+ 292 0 return false ;
+ 293
+ }
+ 294 1 if (left.equalsIgnoreCase(right)) {
+ 295 0 return true ;
+ 296
+ }
+ 297 1 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
+ 298 0 left = getBaseRepoPath(left);
+ 299 0 right = getBaseRepoPath(right);
+ 300
+ }
+ 301 1 return left.equalsIgnoreCase(right);
+ 302
}
+ 303
+
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
+ 313
+ private boolean isCore(Dependency left, Dependency right) {
+ 314 0 final String leftName = left.getFileName().toLowerCase();
+ 315 0 final String rightName = right.getFileName().toLowerCase();
+ 316
+ final boolean returnVal;
+ 317 0 if (rightName.contains("core" ) && !leftName.contains("core" )) {
+ 318 0 returnVal = false ;
+ 319 0 } else if (!rightName.contains("core" ) && leftName.contains("core" )) {
+ 320 0 returnVal = true ;
+ 321
+ } else {
+ 322
+
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
328
+
+ 329
+
+ 330
+
+ 331 0 if (leftName.length() > rightName.length()) {
+ 332 0 returnVal = false ;
+ 333
+ } else {
+ 334 0 returnVal = true ;
+ 335
+ }
+ 336
+ }
+ 337 0 if (LogUtils.isVerboseLoggingEnabled()) {
+ 338 0 final String msg = String.format("IsCore=%s (%s, %s)" , returnVal, left.getFileName(), right.getFileName());
+ 339 0 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
+ 340
+ }
+ 341 0 return returnVal;
+ 342
+ }
+ 343
}
-
+
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 8b5f4b01b..04cbe9da4 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 @@
@@ -144,7 +144,7 @@
65
public Set<String> getSupportedExtensions() {
- 66 129 return EXTENSIONS;
+ 66 132 return EXTENSIONS;
67
}
68
@@ -161,7 +161,7 @@
74
public String getName() {
- 75 3 return ANALYZER_NAME;
+ 75 9 return ANALYZER_NAME;
76
}
77
@@ -182,7 +182,7 @@
85
public boolean supportsExtension(String extension) {
- 86 3 return true ;
+ 86 9 return true ;
87
}
88
@@ -199,7 +199,7 @@
94
public AnalysisPhase getAnalysisPhase() {
- 95 3 return ANALYSIS_PHASE;
+ 95 6 return ANALYSIS_PHASE;
96
}
97
@@ -228,373 +228,424 @@
@Override
109
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 110 9 removeJreEntries(dependency);
- 111 9 removeBadMatches(dependency);
- 112 9 removeSpuriousCPE(dependency);
- 113 9 addFalseNegativeCPEs(dependency);
- 114 9 }
- 115
-
+ 110 15 removeJreEntries(dependency);
+ 111 15 removeBadMatches(dependency);
+ 112 15 removeWrongVersionMatches(dependency);
+ 113 15 removeSpuriousCPE(dependency);
+ 114 15 addFalseNegativeCPEs(dependency);
+ 115 15 }
116
-
+
117
-
+
118
-
+
119
-
+
120
-
+
121
-
- 122
-
- 123
-
- 124
-
- 125
-
- 126
- 127
+ 122
+
+ 123
+
+ 124
- 128
+ 125
+ 126
+
+ 127
+
+ 128
+
129
-
+
130
-
+
131
-
+
132
+
+ 133
+ @SuppressWarnings("null" )
+ 134
private void removeSpuriousCPE(Dependency dependency) {
- 133 9 final List<Identifier> ids = new ArrayList<Identifier>();
- 134 9 ids.addAll(dependency.getIdentifiers());
- 135 9 Collections.sort(ids);
- 136 9 final ListIterator<Identifier> mainItr = ids.listIterator();
- 137 23 while (mainItr.hasNext()) {
- 138 14 final Identifier currentId = mainItr.next();
- 139 14 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
- 140 14 if (currentCpe == null ) {
- 141 0 continue ;
- 142
+ 135 15 final List<Identifier> ids = new ArrayList<Identifier>();
+ 136 15 ids.addAll(dependency.getIdentifiers());
+ 137 15 Collections.sort(ids);
+ 138 15 final ListIterator<Identifier> mainItr = ids.listIterator();
+ 139 36 while (mainItr.hasNext()) {
+ 140 21 final Identifier currentId = mainItr.next();
+ 141 21 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
+ 142 21 if (currentCpe == null ) {
+ 143 0 continue ;
+ 144
}
- 143 14 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
- 144 24 while (subItr.hasNext()) {
- 145 10 final Identifier nextId = subItr.next();
- 146 10 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
- 147 10 if (nextCpe == null ) {
- 148 0 continue ;
- 149
+ 145 21 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
+ 146 32 while (subItr.hasNext()) {
+ 147 11 final Identifier nextId = subItr.next();
+ 148 11 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
+ 149 11 if (nextCpe == null ) {
+ 150 0 continue ;
+ 151
}
- 150
+ 152
- 151 10 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
- 152 2 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
- 153
+ 153 11 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
+ 154 3 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
+ 155
- 154 1 final String currentVersion = currentCpe.getVersion();
- 155 1 final String nextVersion = nextCpe.getVersion();
- 156 1 if (currentVersion == null && nextVersion == null ) {
- 157
-
- 158 0 Logger.getLogger(FalsePositiveAnalyzer.class
+ 156 3 final String currentVersion = currentCpe.getVersion();
+ 157 3 final String nextVersion = nextCpe.getVersion();
+ 158 3 if (currentVersion == null && nextVersion == null ) {
159
+
+ 160 0 Logger.getLogger(FalsePositiveAnalyzer.class
+ 161
.getName()).log(Level.FINE, "currentVersion and nextVersion are both null?" );
- 160 1 } else if (currentVersion == null && nextVersion != null ) {
- 161 1 dependency.getIdentifiers().remove(currentId);
- 162 0 } else if (nextVersion == null && currentVersion != null ) {
- 163 0 dependency.getIdentifiers().remove(nextId);
- 164 0 } else if (currentVersion.length() < nextVersion.length()) {
- 165 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
- 166 0 dependency.getIdentifiers().remove(currentId);
- 167
+ 162 3 } else if (currentVersion == null && nextVersion != null ) {
+ 163 3 dependency.getIdentifiers().remove(currentId);
+ 164 0 } else if (nextVersion == null && currentVersion != null ) {
+ 165 0 dependency.getIdentifiers().remove(nextId);
+ 166 0 } else if (currentVersion.length() < nextVersion.length()) {
+ 167 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
+ 168 0 dependency.getIdentifiers().remove(currentId);
+ 169
}
- 168
+ 170
} else {
- 169 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
- 170 0 dependency.getIdentifiers().remove(nextId);
- 171
- }
- 172
- }
+ 171 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
+ 172 0 dependency.getIdentifiers().remove(nextId);
173
- }
+ }
174
+ }
+ 175
+ }
+ 176
}
- 175 10 }
- 176 14 }
- 177 9 }
- 178
-
- 179
-
+ 177 11 }
+ 178 21 }
+ 179 15 }
180
-
+
181
-
- 182 1 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+
+ 182
+
183
- + "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
- 184
- + "jdk|jre|jsf|jsse)($|:.*)" );
+
+ 184 1 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
185
-
+ + "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
186
-
+ + "jdk|jre|jsf|jsse)($|:.*)" );
187
-
- 188 1 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+
+ 188
+
189
-
- 190
-
+
+ 190 1 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
191
-
+
192
-
+
193
-
+
194
-
+
195
-
+
196
+
+ 197
+
+ 198
private void removeJreEntries(Dependency dependency) {
- 197 9 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 198 9 final Iterator<Identifier> itr = identifiers.iterator();
- 199 23 while (itr.hasNext()) {
- 200 14 final Identifier i = itr.next();
- 201 14 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
- 202 14 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
- 203 14 if (coreCPE.matches() && !coreFiles.matches()) {
- 204 0 itr.remove();
- 205
- }
- 206
-
+ 199 15 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 200 15 final Iterator<Identifier> itr = identifiers.iterator();
+ 201 37 while (itr.hasNext()) {
+ 202 22 final Identifier i = itr.next();
+ 203 22 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
+ 204 22 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
+ 205 22 if (coreCPE.matches() && !coreFiles.matches()) {
+ 206 0 itr.remove();
207
-
- 208
-
- 209
-
- 210
-
- 211
-
- 212
-
- 213
-
- 214
-
- 215
-
- 216
-
- 217
-
- 218
-
- 219
-
- 220
-
- 221
-
- 222
-
- 223
-
- 224
-
- 225
-
- 226
-
- 227 14 }
- 228 9 }
- 229
-
- 230
-
- 231
-
- 232
-
- 233
-
- 234
-
- 235
-
- 236
-
- 237
- private VulnerableSoftware parseCpe(String type, String value) {
- 238 24 if (!"cpe" .equals(type)) {
- 239 0 return null ;
- 240
- }
- 241 24 final VulnerableSoftware cpe = new VulnerableSoftware();
- 242
- try {
- 243 24 cpe.parseName(value);
- 244 0 } catch (UnsupportedEncodingException ex) {
- 245 0 Logger.getLogger(FalsePositiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
- 246 0 return null ;
- 247 24 }
- 248 24 return cpe;
- 249
- }
- 250
-
- 251
-
- 252
-
- 253
-
- 254
-
- 255
-
- 256
-
- 257
-
- 258
- private void removeBadMatches(Dependency dependency) {
- 259 9 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 260 9 final Iterator<Identifier> itr = identifiers.iterator();
- 261
-
- 262
-
- 263
-
- 264
-
- 265
-
- 266
-
- 267
-
- 268
-
- 269
-
- 270
-
- 271 23 while (itr.hasNext()) {
- 272 14 final Identifier i = itr.next();
- 273
-
- 274 14 if ("cpe" .equals(i.getType())) {
- 275 14 if ((i.getValue().matches(".*c\\+\\+.*" )
- 276
- || i.getValue().startsWith("cpe:/a:jquery:jquery" )
- 277
- || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
- 278
- || i.getValue().startsWith("cpe:/a:yahoo:yui" )
- 279
- || i.getValue().startsWith("cpe:/a:file:file" )
- 280
- || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
- 281
- || i.getValue().startsWith("cpe:/a:cvs:cvs" )
- 282
- || i.getValue().startsWith("cpe:/a:ftp:ftp" )
- 283
- || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
- 284
- && dependency.getFileName().toLowerCase().endsWith(".jar" )) {
- 285 0 itr.remove();
- 286 14 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
- 287
- && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
- 288 0 itr.remove();
- 289
- }
- 290
}
- 291 14 }
- 292 9 }
- 293
+ 208
- 294
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229 22 }
+ 230 15 }
+ 231
+
+ 232
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+ private VulnerableSoftware parseCpe(String type, String value) {
+ 240 32 if (!"cpe" .equals(type)) {
+ 241 0 return null ;
+ 242
+ }
+ 243 32 final VulnerableSoftware cpe = new VulnerableSoftware();
+ 244
+ try {
+ 245 32 cpe.parseName(value);
+ 246 0 } catch (UnsupportedEncodingException ex) {
+ 247 0 Logger.getLogger(FalsePositiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+ 248 0 return null ;
+ 249 32 }
+ 250 32 return cpe;
+ 251
+ }
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+ private void removeBadMatches(Dependency dependency) {
+ 261 15 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 262 15 final Iterator<Identifier> itr = identifiers.iterator();
+ 263
+
+ 264
+
+ 265
+
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+
+ 273 37 while (itr.hasNext()) {
+ 274 22 final Identifier i = itr.next();
+ 275
+
+ 276 22 if ("cpe" .equals(i.getType())) {
+ 277 22 if ((i.getValue().matches(".*c\\+\\+.*" )
+ 278
+ || i.getValue().startsWith("cpe:/a:jquery:jquery" )
+ 279
+ || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
+ 280
+ || i.getValue().startsWith("cpe:/a:yahoo:yui" )
+ 281
+ || i.getValue().startsWith("cpe:/a:file:file" )
+ 282
+ || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
+ 283
+ || i.getValue().startsWith("cpe:/a:cvs:cvs" )
+ 284
+ || i.getValue().startsWith("cpe:/a:ftp:ftp" )
+ 285
+ || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
+ 286
+ && dependency.getFileName().toLowerCase().endsWith(".jar" )) {
+ 287 0 itr.remove();
+ 288 22 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
+ 289
+ && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
+ 290 0 itr.remove();
+ 291
+ }
+ 292
+ }
+ 293 22 }
+ 294 15 }
295
-
+
296
-
+
297
-
+
298
-
+
299
300
-
+
301
302
- private void addFalseNegativeCPEs(Dependency dependency) {
- 303 9 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 304 22 while (itr.hasNext()) {
- 305 13 final Identifier i = itr.next();
- 306 13 if ("cpe" .equals(i.getType()) && i.getValue() != null
- 307
- && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
- 308
- || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
- 309
- || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
- 310
- || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
- 311 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
- 312 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
- 313 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
- 314 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
+ private void removeWrongVersionMatches(Dependency dependency) {
+ 303 15 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 304 15 final Iterator<Identifier> itr = identifiers.iterator();
+ 305
+
+ 306 15 final String fileName = dependency.getFileName();
+ 307 15 if (fileName != null && fileName.contains("axis2" )) {
+ 308 3 while (itr.hasNext()) {
+ 309 2 final Identifier i = itr.next();
+ 310 2 if ("cpe" .equals(i.getType())) {
+ 311 2 final String cpe = i.getValue();
+ 312 2 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
+ 313 1 itr.remove();
+ 314
+ }
315
- try {
- 316 0 dependency.addIdentifier("cpe" ,
- 317
- newCpe,
- 318
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
- 319 0 dependency.addIdentifier("cpe" ,
- 320
- newCpe2,
- 321
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
- 322 0 dependency.addIdentifier("cpe" ,
- 323
- newCpe3,
+ }
+ 316 2 }
+ 317 14 } else if (fileName != null && fileName.contains("axis" )) {
+ 318 0 while (itr.hasNext()) {
+ 319 0 final Identifier i = itr.next();
+ 320 0 if ("cpe" .equals(i.getType())) {
+ 321 0 final String cpe = i.getValue();
+ 322 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
+ 323 0 itr.remove();
324
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
- 325 0 dependency.addIdentifier("cpe" ,
- 326
- newCpe4,
+ }
+ 325
+ }
+ 326 0 }
327
- String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
- 328 0 } catch (UnsupportedEncodingException ex) {
- 329 0 Logger.getLogger(FalsePositiveAnalyzer.class
+ }
+ 328 15 }
+ 329
+
330
- .getName()).log(Level.FINE, null , ex);
- 331 0 }
+
+ 331
+
332
- }
- 333 13 }
- 334 9 }
+
+ 333
+
+ 334
+
335
+
+ 336
+
+ 337
+
+ 338
+ private void addFalseNegativeCPEs(Dependency dependency) {
+ 339 15 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 340 33 while (itr.hasNext()) {
+ 341 18 final Identifier i = itr.next();
+ 342 18 if ("cpe" .equals(i.getType()) && i.getValue() != null
+ 343
+ && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
+ 344
+ || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
+ 345
+ || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+ 346
+ || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
+ 347 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
+ 348 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
+ 349 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
+ 350 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
+ 351
+ try {
+ 352 0 dependency.addIdentifier("cpe" ,
+ 353
+ newCpe,
+ 354
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
+ 355 0 dependency.addIdentifier("cpe" ,
+ 356
+ newCpe2,
+ 357
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
+ 358 0 dependency.addIdentifier("cpe" ,
+ 359
+ newCpe3,
+ 360
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
+ 361 0 dependency.addIdentifier("cpe" ,
+ 362
+ newCpe4,
+ 363
+ String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
+ 364 0 } catch (UnsupportedEncodingException ex) {
+ 365 0 Logger.getLogger(FalsePositiveAnalyzer.class
+ 366
+ .getName()).log(Level.FINE, null , ex);
+ 367 0 }
+ 368
+ }
+ 369 18 }
+ 370 15 }
+ 371
}
-
+
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 39a22564f..00eb69c9a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
@@ -126,7 +126,7 @@
56
public Set<String> getSupportedExtensions() {
- 57 130 return EXTENSIONS;
+ 57 133 return EXTENSIONS;
58
}
59
@@ -143,7 +143,7 @@
65
public String getName() {
- 66 4 return ANALYZER_NAME;
+ 66 10 return ANALYZER_NAME;
67
}
68
@@ -164,7 +164,7 @@
76
public boolean supportsExtension(String extension) {
- 77 4 return true ;
+ 77 10 return true ;
78
}
79
@@ -181,7 +181,7 @@
85
public AnalysisPhase getAnalysisPhase() {
- 86 4 return ANALYSIS_PHASE;
+ 86 7 return ANALYSIS_PHASE;
87
}
88
@@ -212,23 +212,23 @@
101
- 102 12 final File f = new File(dependency.getFileName());
- 103 12 String fileName = f.getName();
+ 102 18 final File f = new File(dependency.getFileName());
+ 103 18 String fileName = f.getName();
104
105
- 106 12 final int pos = fileName.lastIndexOf("." );
- 107 12 if (pos > 0) {
- 108 12 fileName = fileName.substring(0, pos);
+ 106 18 final int pos = fileName.lastIndexOf("." );
+ 107 18 if (pos > 0) {
+ 108 18 fileName = fileName.substring(0, pos);
109
}
110
111
- 112 12 final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName);
- 113 12 if (version != null ) {
+ 112 18 final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName);
+ 113 18 if (version != null ) {
114 10 dependency.getVersionEvidence().addEvidence("file" , "name" ,
115
version.toString(), Evidence.Confidence.HIGHEST);
@@ -241,7 +241,7 @@
120
- 121 12 if (fileName.contains("-" )) {
+ 121 18 if (fileName.contains("-" )) {
122 10 dependency.getProductEvidence().addEvidence("file" , "name" ,
123
fileName, Evidence.Confidence.HIGHEST);
@@ -250,19 +250,19 @@
fileName, Evidence.Confidence.HIGHEST);
126
} else {
- 127 2 dependency.getProductEvidence().addEvidence("file" , "name" ,
+ 127 8 dependency.getProductEvidence().addEvidence("file" , "name" ,
128
fileName, Evidence.Confidence.HIGH);
- 129 2 dependency.getVendorEvidence().addEvidence("file" , "name" ,
+ 129 8 dependency.getVendorEvidence().addEvidence("file" , "name" ,
130
fileName, Evidence.Confidence.HIGH);
131
}
- 132 12 }
+ 132 18 }
133
}
-
+
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 f5735adc7..c422e7337 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
@@ -120,7 +120,7 @@
53
public Set<String> getSupportedExtensions() {
- 54 129 return EXTENSIONS;
+ 54 132 return EXTENSIONS;
55
}
56
@@ -137,7 +137,7 @@
62
public String getName() {
- 63 3 return ANALYZER_NAME;
+ 63 9 return ANALYZER_NAME;
64
}
65
@@ -158,7 +158,7 @@
73
public boolean supportsExtension(String extension) {
- 74 3 return true ;
+ 74 9 return true ;
75
}
76
@@ -175,7 +175,7 @@
82
public AnalysisPhase getAnalysisPhase() {
- 83 3 return ANALYSIS_PHASE;
+ 83 6 return ANALYSIS_PHASE;
84
}
85
@@ -204,7 +204,7 @@
@Override
97
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 98 9 final Evidence springTest1 = new Evidence("Manifest" ,
+ 98 15 final Evidence springTest1 = new Evidence("Manifest" ,
99
"Implementation-Title" ,
100
@@ -213,7 +213,7 @@
Evidence.Confidence.HIGH);
102
- 103 9 final Evidence springTest2 = new Evidence("Manifest" ,
+ 103 15 final Evidence springTest2 = new Evidence("Manifest" ,
104
"Implementation-Title" ,
105
@@ -222,7 +222,7 @@
Evidence.Confidence.HIGH);
107
- 108 9 final Evidence springTest3 = new Evidence("Manifest" ,
+ 108 15 final Evidence springTest3 = new Evidence("Manifest" ,
109
"Bundle-Vendor" ,
110
@@ -233,8 +233,8 @@
113
- 114 9 Set<Evidence> evidence = dependency.getProductEvidence().getEvidence();
- 115 9 if (evidence.contains(springTest1) || evidence.contains(springTest2)) {
+ 114 15 Set<Evidence> evidence = dependency.getProductEvidence().getEvidence();
+ 115 15 if (evidence.contains(springTest1) || evidence.contains(springTest2)) {
116 2 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Evidence.Confidence.HIGH);
117 2 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "SpringSource" , Evidence.Confidence.HIGH);
118 2 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Evidence.Confidence.HIGH);
@@ -242,17 +242,17 @@
}
120
- 121 9 evidence = dependency.getVendorEvidence().getEvidence();
- 122 9 if (evidence.contains(springTest3)) {
+ 121 15 evidence = dependency.getVendorEvidence().getEvidence();
+ 122 15 if (evidence.contains(springTest3)) {
123 2 dependency.getProductEvidence().addEvidence("hint analyzer" , "product" , "springsource_spring_framework" , Evidence.Confidence.HIGH);
124 2 dependency.getVendorEvidence().addEvidence("hint analyzer" , "vendor" , "vmware" , Evidence.Confidence.HIGH);
125
}
- 126 9 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
- 127 9 final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
- 128 93 while (itr.hasNext()) {
- 129 84 final Evidence e = itr.next();
- 130 84 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
+ 126 15 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
+ 127 15 final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
+ 128 121 while (itr.hasNext()) {
+ 129 106 final Evidence e = itr.next();
+ 130 106 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
131 2 final Evidence newEvidence = new Evidence(e.getSource() + " (hint)" , e.getName(), "oracle" , e.getConfidence());
132 2 newEntries.add(newEvidence);
133 2 } else if ("oracle" .equalsIgnoreCase(e.getValue(false ))) {
@@ -260,8 +260,8 @@
135 0 newEntries.add(newEvidence);
136
}
- 137 84 }
- 138 9 for (Evidence e : newEntries) {
+ 137 106 }
+ 138 15 for (Evidence e : newEntries) {
139 2 dependency.getVendorEvidence().addEvidence(e);
140
}
@@ -269,11 +269,11 @@
142
- 143 9 }
+ 143 15 }
144
}
-
+
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 5331772ac..5270fe24b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
@@ -342,7 +342,7 @@
169
public Set<String> getSupportedExtensions() {
- 170 137 return EXTENSIONS;
+ 170 146 return EXTENSIONS;
171
}
172
@@ -359,7 +359,7 @@
178
public String getName() {
- 179 4 return ANALYZER_NAME;
+ 179 10 return ANALYZER_NAME;
180
}
181
@@ -380,7 +380,7 @@
189
public boolean supportsExtension(String extension) {
- 190 133 return EXTENSIONS.contains(extension);
+ 190 142 return EXTENSIONS.contains(extension);
191
}
192
@@ -397,7 +397,7 @@
198
public AnalysisPhase getAnalysisPhase() {
- 199 3 return ANALYSIS_PHASE;
+ 199 6 return ANALYSIS_PHASE;
200
}
201
@@ -428,9 +428,9 @@
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
214
try {
- 215 16 final ArrayList<ClassNameInformation> classNames = collectClassNames(dependency);
- 216 16 final String fileName = dependency.getFileName().toLowerCase();
- 217 16 if (classNames.isEmpty()
+ 215 18 final ArrayList<ClassNameInformation> classNames = collectClassNames(dependency);
+ 216 18 final String fileName = dependency.getFileName().toLowerCase();
+ 217 18 if (classNames.isEmpty()
218
&& (fileName.endsWith("-sources.jar" )
219
@@ -442,14 +442,14 @@
222 0 engine.getDependencies().remove(dependency);
223
}
- 224 16 final boolean hasManifest = parseManifest(dependency, classNames);
- 225 16 final boolean hasPOM = analyzePOM(dependency, classNames);
- 226 16 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
- 227 16 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
+ 224 18 final boolean hasManifest = parseManifest(dependency, classNames);
+ 225 18 final boolean hasPOM = analyzePOM(dependency, classNames);
+ 226 18 final boolean addPackagesAsEvidence = !(hasManifest && hasPOM);
+ 227 18 analyzePackageNames(classNames, dependency, addPackagesAsEvidence);
228 0 } catch (IOException ex) {
229 0 throw new AnalysisException("Exception occurred reading the JAR file." , ex);
- 230 16 }
- 231 16 }
+ 230 18 }
+ 231 18 }
232
233
@@ -476,12 +476,12 @@
244
protected boolean analyzePOM(Dependency dependency, ArrayList<ClassNameInformation> classes) throws AnalysisException {
- 245 16 boolean foundSomething = false ;
+ 245 18 boolean foundSomething = false ;
246
final JarFile jar;
247
try {
- 248 16 jar = new JarFile(dependency.getActualFilePath());
+ 248 18 jar = new JarFile(dependency.getActualFilePath());
249 0 } catch (IOException ex) {
250 0 final String msg = String.format("Unable to read JarFile '%s'." , dependency.getActualFilePath());
251 0 final AnalysisException ax = new AnalysisException(msg, ex);
@@ -489,12 +489,12 @@
253 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.WARNING, msg);
254 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.FINE, null , ex);
255 0 return false ;
- 256 16 }
+ 256 18 }
257
List<String> pomEntries;
258
try {
- 259 16 pomEntries = retrievePomListing(jar);
+ 259 18 pomEntries = retrievePomListing(jar);
260 0 } catch (IOException ex) {
261 0 final String msg = String.format("Unable to read Jar file entries in '%s'." , dependency.getActualFilePath());
262 0 final AnalysisException ax = new AnalysisException(msg, ex);
@@ -502,9 +502,9 @@
264 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.WARNING, msg);
265 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.INFO, msg, ex);
266 0 return false ;
- 267 16 }
- 268 16 if (pomEntries.isEmpty()) {
- 269 9 return false ;
+ 267 18 }
+ 268 18 if (pomEntries.isEmpty()) {
+ 269 11 return false ;
270
}
271 7 if (pomEntries.size() > 1) {
@@ -601,17 +601,17 @@
332
private List<String> retrievePomListing(final JarFile jar) throws IOException {
- 333 16 final List<String> pomEntries = new ArrayList<String>();
- 334 16 final Enumeration<JarEntry> entries = jar.entries();
- 335 6838 while (entries.hasMoreElements()) {
- 336 6822 final JarEntry entry = entries.nextElement();
- 337 6822 final String entryName = (new File(entry.getName())).getName().toLowerCase();
- 338 6822 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
+ 333 18 final List<String> pomEntries = new ArrayList<String>();
+ 334 18 final Enumeration<JarEntry> entries = jar.entries();
+ 335 7564 while (entries.hasMoreElements()) {
+ 336 7546 final JarEntry entry = entries.nextElement();
+ 337 7546 final String entryName = (new File(entry.getName())).getName().toLowerCase();
+ 338 7546 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
339 7 pomEntries.add(entry.getName());
340
}
- 341 6822 }
- 342 16 return pomEntries;
+ 341 7546 }
+ 342 18 return pomEntries;
343
}
344
@@ -846,41 +846,41 @@
protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
504
Dependency dependency, boolean addPackagesAsEvidence) {
- 505 16 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
- 506 16 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
- 507 16 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+ 505 18 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
+ 506 18 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
+ 507 18 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
508
- 509 16 final int classCount = classNames.size();
- 510 16 final EvidenceCollection vendor = dependency.getVendorEvidence();
- 511 16 final EvidenceCollection product = dependency.getProductEvidence();
+ 509 18 final int classCount = classNames.size();
+ 510 18 final EvidenceCollection vendor = dependency.getVendorEvidence();
+ 511 18 final EvidenceCollection product = dependency.getProductEvidence();
512
- 513 16 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
- 514 160 final float ratio = entry.getValue() / (float ) classCount;
- 515 160 if (ratio > 0.5) {
+ 513 18 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
+ 514 182 final float ratio = entry.getValue() / (float ) classCount;
+ 515 182 if (ratio > 0.5) {
516
- 517 32 vendor.addWeighting(entry.getKey());
- 518 32 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 519 18 vendor.addEvidence("jar" , "package" , entry.getKey(), Evidence.Confidence.LOW);
+ 517 36 vendor.addWeighting(entry.getKey());
+ 518 36 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 519 22 vendor.addEvidence("jar" , "package" , entry.getKey(), Evidence.Confidence.LOW);
520
}
521
}
- 522 160 }
- 523 16 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
- 524 3476 final float ratio = entry.getValue() / (float ) classCount;
- 525 3476 if (ratio > 0.5) {
- 526 19 product.addWeighting(entry.getKey());
- 527 19 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 528 9 product.addEvidence("jar" , "package" , entry.getKey(), Evidence.Confidence.LOW);
+ 522 182 }
+ 523 18 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
+ 524 3772 final float ratio = entry.getValue() / (float ) classCount;
+ 525 3772 if (ratio > 0.5) {
+ 526 21 product.addWeighting(entry.getKey());
+ 527 21 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 528 11 product.addEvidence("jar" , "package" , entry.getKey(), Evidence.Confidence.LOW);
529
}
530
}
- 531 3476 }
- 532 16 }
+ 531 3772 }
+ 532 18 }
533
534
@@ -913,15 +913,15 @@
548
protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
- 549 16 boolean foundSomething = false ;
- 550 16 JarFile jar = null ;
+ 549 18 boolean foundSomething = false ;
+ 550 18 JarFile jar = null ;
551
try {
- 552 16 jar = new JarFile(dependency.getActualFilePath());
+ 552 18 jar = new JarFile(dependency.getActualFilePath());
553
- 554 16 final Manifest manifest = jar.getManifest();
- 555 16 if (manifest == null ) {
+ 554 18 final Manifest manifest = jar.getManifest();
+ 555 18 if (manifest == null ) {
556
557 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
@@ -941,59 +941,59 @@
565 0 return false ;
566
}
- 567 16 final Attributes atts = manifest.getMainAttributes();
+ 567 18 final Attributes atts = manifest.getMainAttributes();
568
- 569 16 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
- 570 16 final EvidenceCollection productEvidence = dependency.getProductEvidence();
- 571 16 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
+ 569 18 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
+ 570 18 final EvidenceCollection productEvidence = dependency.getProductEvidence();
+ 571 18 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
572
- 573 16 final String source = "Manifest" ;
+ 573 18 final String source = "Manifest" ;
574
- 575 16 for (Entry<Object, Object> entry : atts.entrySet()) {
- 576 236 String key = entry.getKey().toString();
- 577 236 String value = atts.getValue(key);
- 578 236 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
+ 575 18 for (Entry<Object, Object> entry : atts.entrySet()) {
+ 576 260 String key = entry.getKey().toString();
+ 577 260 String value = atts.getValue(key);
+ 578 260 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
579 0 value = Jsoup.parse(value).text();
580
}
- 581 236 if (IGNORE_VALUES.contains(value)) {
+ 581 260 if (IGNORE_VALUES.contains(value)) {
582 0 continue ;
- 583 236 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
- 584 7 foundSomething = true ;
- 585 7 productEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
- 586 7 addMatchingValues(classInformation, value, productEvidence);
- 587 229 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
- 588 10 foundSomething = true ;
- 589 10 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
- 590 219 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
- 591 6 foundSomething = true ;
- 592 6 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
- 593 6 addMatchingValues(classInformation, value, vendorEvidence);
- 594 213 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
- 595 3 foundSomething = true ;
- 596 3 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
- 597 3 addMatchingValues(classInformation, value, vendorEvidence);
- 598 210 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
+ 583 260 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
+ 584 9 foundSomething = true ;
+ 585 9 productEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
+ 586 9 addMatchingValues(classInformation, value, productEvidence);
+ 587 251 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
+ 588 12 foundSomething = true ;
+ 589 12 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
+ 590 239 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+ 591 8 foundSomething = true ;
+ 592 8 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
+ 593 8 addMatchingValues(classInformation, value, vendorEvidence);
+ 594 231 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
+ 595 5 foundSomething = true ;
+ 596 5 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
+ 597 5 addMatchingValues(classInformation, value, vendorEvidence);
+ 598 226 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
599 7 foundSomething = true ;
600 7 addDescription(dependency, value, "manifest" , key);
601
602 7 addMatchingValues(classInformation, value, productEvidence);
- 603 203 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
+ 603 219 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
604 10 foundSomething = true ;
605 10 productEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
606 10 addMatchingValues(classInformation, value, productEvidence);
- 607 193 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
+ 607 209 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
608 8 foundSomething = true ;
609 8 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
610 8 addMatchingValues(classInformation, value, vendorEvidence);
- 611 185 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
+ 611 201 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
612 10 foundSomething = true ;
613 10 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.HIGH);
- 614 175 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
+ 614 191 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
615 5 continue ;
616
@@ -1013,10 +1013,10 @@
624
} else {
- 625 170 key = key.toLowerCase();
+ 625 186 key = key.toLowerCase();
626
- 627 170 if (!IGNORE_KEYS.contains(key)
+ 627 186 if (!IGNORE_KEYS.contains(key)
628
&& !key.endsWith("jdk" )
629
@@ -1037,10 +1037,10 @@
&& !isPackage(key, value)) {
637
- 638 51 foundSomething = true ;
- 639 51 if (key.contains("version" )) {
- 640 8 if (key.contains("specification" )) {
- 641 6 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.LOW);
+ 638 59 foundSomething = true ;
+ 639 59 if (key.contains("version" )) {
+ 640 10 if (key.contains("specification" )) {
+ 641 8 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.LOW);
642
} else {
643 2 versionEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
@@ -1048,23 +1048,23 @@
}
645
- 646 43 } else if (key.contains("title" )) {
- 647 6 productEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
- 648 6 addMatchingValues(classInformation, value, productEvidence);
- 649 37 } else if (key.contains("vendor" )) {
- 650 3 if (key.contains("specification" )) {
- 651 3 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.LOW);
+ 646 49 } else if (key.contains("title" )) {
+ 647 8 productEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
+ 648 8 addMatchingValues(classInformation, value, productEvidence);
+ 649 41 } else if (key.contains("vendor" )) {
+ 650 5 if (key.contains("specification" )) {
+ 651 5 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.LOW);
652
} else {
653 0 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
654 0 addMatchingValues(classInformation, value, vendorEvidence);
655
}
- 656 34 } else if (key.contains("name" )) {
- 657 11 productEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
- 658 11 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
- 659 11 addMatchingValues(classInformation, value, vendorEvidence);
- 660 11 addMatchingValues(classInformation, value, productEvidence);
+ 656 36 } else if (key.contains("name" )) {
+ 657 13 productEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
+ 658 13 vendorEvidence.addEvidence(source, key, value, Evidence.Confidence.MEDIUM);
+ 659 13 addMatchingValues(classInformation, value, vendorEvidence);
+ 660 13 addMatchingValues(classInformation, value, productEvidence);
661 23 } else if (key.contains("license" )) {
662 6 addLicense(dependency, value);
663
@@ -1096,16 +1096,16 @@
}
683
}
- 684 231 }
+ 684 255 }
685
} finally {
- 686 16 if (jar != null ) {
- 687 16 jar.close();
+ 686 18 if (jar != null ) {
+ 687 18 jar.close();
688
}
689
}
- 690 16 return foundSomething;
+ 690 18 return foundSomething;
691
}
692
@@ -1205,7 +1205,7 @@
public void initialize() {
756
- 757 1 }
+ 757 3 }
758
759
@@ -1218,7 +1218,7 @@
public void close() {
763
- 764 1 }
+ 764 3 }
765
766
@@ -1333,12 +1333,12 @@
831
private boolean isImportPackage(String key, String value) {
- 832 53 final Pattern packageRx = Pattern.compile("^((([a-zA-Z_#\\$0-9]\\.)+)\\s*\\;\\s*)+$" );
- 833 53 if (packageRx.matcher(value).matches()) {
+ 832 61 final Pattern packageRx = Pattern.compile("^((([a-zA-Z_#\\$0-9]\\.)+)\\s*\\;\\s*)+$" );
+ 833 61 if (packageRx.matcher(value).matches()) {
834 0 return (key.contains("import" ) || key.contains("include" ));
835
}
- 836 53 return false ;
+ 836 61 return false ;
837
}
838
@@ -1361,41 +1361,41 @@
847
private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
- 848 16 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
- 849 16 JarFile jar = null ;
+ 848 18 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
+ 849 18 JarFile jar = null ;
850
try {
- 851 16 jar = new JarFile(dependency.getActualFilePath());
- 852 16 final Enumeration entries = jar.entries();
- 853 6838 while (entries.hasMoreElements()) {
- 854 6822 final JarEntry entry = (JarEntry) entries.nextElement();
- 855 6822 final String name = entry.getName().toLowerCase();
+ 851 18 jar = new JarFile(dependency.getActualFilePath());
+ 852 18 final Enumeration entries = jar.entries();
+ 853 7564 while (entries.hasMoreElements()) {
+ 854 7546 final JarEntry entry = (JarEntry) entries.nextElement();
+ 855 7546 final String name = entry.getName().toLowerCase();
856
- 857 6822 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
- 858 5781 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
- 859 5781 classNames.add(className);
+ 857 7546 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
+ 858 6375 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
+ 859 6375 classNames.add(className);
860
}
- 861 6822 }
+ 861 7546 }
862 0 } catch (IOException ex) {
863 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
864 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.WARNING, msg);
865 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.FINE, null , ex);
866
} finally {
- 867 16 if (jar != null ) {
+ 867 18 if (jar != null ) {
868
try {
- 869 16 jar.close();
+ 869 18 jar.close();
870 0 } catch (IOException ex) {
871 0 Logger.getLogger(JarAnalyzer.class .getName()).log(Level.FINEST, null , ex);
- 872 16 }
+ 872 18 }
873
}
874
}
- 875 16 return classNames;
+ 875 18 return classNames;
876
}
877
@@ -1428,31 +1428,31 @@
private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
891
HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
- 892 16 for (ClassNameInformation entry : classNames) {
- 893 5781 final ArrayList<String> list = entry.getPackageStructure();
- 894 5781 addEntry(vendor, list.get(0));
+ 892 18 for (ClassNameInformation entry : classNames) {
+ 893 6375 final ArrayList<String> list = entry.getPackageStructure();
+ 894 6375 addEntry(vendor, list.get(0));
895
- 896 5781 if (list.size() == 2) {
+ 896 6375 if (list.size() == 2) {
897 0 addEntry(product, list.get(1));
898
}
- 899 5781 if (list.size() == 3) {
- 900 1989 addEntry(vendor, list.get(1));
- 901 1989 addEntry(product, list.get(1));
- 902 1989 addEntry(product, list.get(2));
+ 899 6375 if (list.size() == 3) {
+ 900 1991 addEntry(vendor, list.get(1));
+ 901 1991 addEntry(product, list.get(1));
+ 902 1991 addEntry(product, list.get(2));
903
}
- 904 5781 if (list.size() >= 4) {
- 905 3792 addEntry(vendor, list.get(1));
- 906 3792 addEntry(vendor, list.get(2));
- 907 3792 addEntry(product, list.get(1));
- 908 3792 addEntry(product, list.get(2));
- 909 3792 addEntry(product, list.get(3));
+ 904 6375 if (list.size() >= 4) {
+ 905 4384 addEntry(vendor, list.get(1));
+ 906 4384 addEntry(vendor, list.get(2));
+ 907 4384 addEntry(product, list.get(1));
+ 908 4384 addEntry(product, list.get(2));
+ 909 4384 addEntry(product, list.get(3));
910
}
- 911 5781 }
- 912 16 }
+ 911 6375 }
+ 912 18 }
913
914
@@ -1473,14 +1473,14 @@
922
private void addEntry(HashMap<String, Integer> collection, String key) {
- 923 30708 if (collection.containsKey(key)) {
- 924 27072 collection.put(key, collection.get(key) + 1);
+ 923 34268 if (collection.containsKey(key)) {
+ 924 30314 collection.put(key, collection.get(key) + 1);
925
} else {
- 926 3636 collection.put(key, 1);
+ 926 3954 collection.put(key, 1);
927
}
- 928 30708 }
+ 928 34268 }
929
930
@@ -1505,22 +1505,22 @@
940
private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
- 941 145 if (value == null || value.isEmpty()) {
+ 941 157 if (value == null || value.isEmpty()) {
942 0 return ;
943
}
- 944 145 final String text = value.toLowerCase();
- 945 145 for (ClassNameInformation cni : classes) {
- 946 59610 for (String key : cni.getPackageStructure()) {
- 947 217618 if (text.contains(key)) {
- 948 66967 evidence.addEvidence("jar" , "package name" , key, Evidence.Confidence.HIGHEST);
+ 944 157 final String text = value.toLowerCase();
+ 945 157 for (ClassNameInformation cni : classes) {
+ 946 63174 for (String key : cni.getPackageStructure()) {
+ 947 231862 if (text.contains(key)) {
+ 948 70531 evidence.addEvidence("jar" , "package name" , key, Evidence.Confidence.HIGHEST);
949
}
950
}
951
}
- 952 145 }
+ 952 157 }
953
954
@@ -1688,7 +1688,7 @@
private boolean isPackage(String key, String value) {
1036
- 1037 53 return !key.matches(".*(version|title|vendor|name|license|description).*" )
+ 1037 61 return !key.matches(".*(version|title|vendor|name|license|description).*" )
1038
&& value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
1039
@@ -1741,30 +1741,30 @@
1063
- 1064 5781 ClassNameInformation(String className) {
- 1065 5781 name = className;
- 1066 5781 if (name.contains("/" )) {
- 1067 5781 final String[] tmp = className.toLowerCase().split("/" );
- 1068 5781 int start = 0;
- 1069 5781 int end = 3;
- 1070 5781 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
- 1071 5354 start = 1;
- 1072 5354 end = 4;
+ 1064 6375 ClassNameInformation(String className) {
+ 1065 6375 name = className;
+ 1066 6375 if (name.contains("/" )) {
+ 1067 6375 final String[] tmp = className.toLowerCase().split("/" );
+ 1068 6375 int start = 0;
+ 1069 6375 int end = 3;
+ 1070 6375 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
+ 1071 5948 start = 1;
+ 1072 5948 end = 4;
1073
}
- 1074 5781 if (tmp.length <= end) {
- 1075 1989 end = tmp.length - 1;
+ 1074 6375 if (tmp.length <= end) {
+ 1075 1991 end = tmp.length - 1;
1076
}
- 1077 26916 for (int i = start; i <= end; i++) {
- 1078 21135 packageStructure.add(tmp[i]);
+ 1077 29884 for (int i = start; i <= end; i++) {
+ 1078 23509 packageStructure.add(tmp[i]);
1079
}
- 1080 5781 } else {
+ 1080 6375 } else {
1081 0 packageStructure.add(name);
1082
}
- 1083 5781 }
+ 1083 6375 }
1084
1085
@@ -1814,7 +1814,7 @@
1109
- 1110 5781 private ArrayList<String> packageStructure = new ArrayList<String>();
+ 1110 6375 private ArrayList<String> packageStructure = new ArrayList<String>();
1111
1112
@@ -1829,7 +1829,7 @@
1117
public ArrayList<String> getPackageStructure() {
- 1118 65391 return packageStructure;
+ 1118 69549 return packageStructure;
1119
}
1120
@@ -1838,6 +1838,6 @@
}
-
+
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 fc2e240cb..899261f98 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
@@ -252,6 +252,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 8f0e7733b..b01db72b7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
@@ -134,9 +134,9 @@
59
public void open() throws SQLException, IOException, DatabaseException, ClassNotFoundException {
- 60 1 cveDB = new CveDB();
- 61 1 cveDB.open();
- 62 1 }
+ 60 3 cveDB = new CveDB();
+ 61 3 cveDB.open();
+ 62 3 }
63
64
@@ -147,9 +147,9 @@
67
public void close() {
- 68 1 cveDB.close();
- 69 1 cveDB = null ;
- 70 1 }
+ 68 3 cveDB.close();
+ 69 3 cveDB = null ;
+ 70 3 }
71
72
@@ -211,13 +211,13 @@
103
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 104 3 for (Identifier id : dependency.getIdentifiers()) {
- 105 6 if ("cpe" .equals(id.getType())) {
+ 104 9 for (Identifier id : dependency.getIdentifiers()) {
+ 105 11 if ("cpe" .equals(id.getType())) {
106
try {
- 107 6 final String value = id.getValue();
- 108 6 final List<Vulnerability> vulns = cveDB.getVulnerabilities(value);
- 109 6 dependency.getVulnerabilities().addAll(vulns);
+ 107 11 final String value = id.getValue();
+ 108 11 final List<Vulnerability> vulns = cveDB.getVulnerabilities(value);
+ 109 11 dependency.getVulnerabilities().addAll(vulns);
110
111
@@ -234,12 +234,12 @@
117 0 } catch (DatabaseException ex) {
118 0 throw new AnalysisException(ex);
- 119 6 }
+ 119 11 }
120
}
121
}
- 122 3 }
+ 122 9 }
123
124
@@ -254,7 +254,7 @@
129
public Set<String> getSupportedExtensions() {
- 130 129 return null ;
+ 130 132 return null ;
131
}
132
@@ -271,7 +271,7 @@
138
public String getName() {
- 139 3 return "NVD CVE Analyzer" ;
+ 139 9 return "NVD CVE Analyzer" ;
140
}
141
@@ -290,7 +290,7 @@
148
public boolean supportsExtension(String extension) {
- 149 3 return true ;
+ 149 9 return true ;
150
}
151
@@ -307,7 +307,7 @@
157
public AnalysisPhase getAnalysisPhase() {
- 158 3 return AnalysisPhase.FINDING_ANALYSIS;
+ 158 6 return AnalysisPhase.FINDING_ANALYSIS;
159
}
160
@@ -324,8 +324,8 @@
166
public void initialize() throws Exception {
- 167 1 this .open();
- 168 1 }
+ 167 3 this .open();
+ 168 3 }
169
170
@@ -436,6 +436,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectoryLockException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectoryLockException.html
index d8ea34718..1cbb05da9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectoryLockException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectoryLockException.html
@@ -145,6 +145,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectorySpinLock.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectorySpinLock.html
index 6fa6effd2..ab29f9fea 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectorySpinLock.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.DirectorySpinLock.html
@@ -475,6 +475,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.InvalidDirectoryException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.InvalidDirectoryException.html
index 587137984..7adcbd8ff 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.InvalidDirectoryException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.concurrency.InvalidDirectoryException.html
@@ -145,6 +145,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.CachedWebDataSource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.CachedWebDataSource.html
index 17c2d7383..ac51400af 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.CachedWebDataSource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.CachedWebDataSource.html
@@ -95,6 +95,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateException.html
index b1342c8e1..d6c8850c1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateException.html
@@ -149,6 +149,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateService.html
index 76fe6a7bb..58ffa12ff 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.UpdateService.html
@@ -146,6 +146,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.BaseIndex.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.BaseIndex.html
index 606b022b8..86c535361 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.BaseIndex.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.BaseIndex.html
@@ -83,7 +83,7 @@
33
- 34 11 public abstract class BaseIndex {
+ 34 16 public abstract class BaseIndex {
35
36
@@ -100,7 +100,7 @@
42
- 43 11 private boolean indexOpen = false ;
+ 43 16 private boolean indexOpen = false ;
44
45
@@ -115,7 +115,7 @@
50
public Directory getDirectory() {
- 51 11 return directory;
+ 51 16 return directory;
52
}
53
@@ -132,9 +132,9 @@
59
public void open() throws IOException {
- 60 11 directory = this .openDirectory();
- 61 11 indexOpen = true ;
- 62 11 }
+ 60 16 directory = this .openDirectory();
+ 61 16 indexOpen = true ;
+ 62 16 }
63
64
@@ -147,19 +147,19 @@
public void close() {
68
try {
- 69 11 directory.close();
+ 69 16 directory.close();
70 0 } catch (IOException ex) {
71 0 final String msg = "Unable to update database due to an IO error." ;
72 0 Logger.getLogger(BaseIndex.class .getName()).log(Level.SEVERE, msg);
73 0 Logger.getLogger(BaseIndex.class .getName()).log(Level.FINE, null , ex);
74
} finally {
- 75 11 directory = null ;
- 76 11 }
- 77 11 indexOpen = false ;
+ 75 16 directory = null ;
+ 76 16 }
+ 77 16 indexOpen = false ;
78
- 79 11 }
+ 79 16 }
80
81
@@ -193,8 +193,8 @@
96
protected Directory openDirectory() throws IOException {
- 97 11 final File path = getDataDirectory();
- 98 11 return FSDirectory.open(path);
+ 97 16 final File path = getDataDirectory();
+ 98 16 return FSDirectory.open(path);
99
}
100
@@ -215,21 +215,21 @@
108
public static File getDataDirectory() throws IOException {
- 109 12 final File path = Settings.getFile(Settings.KEYS.CPE_DATA_DIRECTORY);
- 110 12 if (!path.exists()) {
+ 109 17 final File path = Settings.getFile(Settings.KEYS.CPE_DATA_DIRECTORY);
+ 110 17 if (!path.exists()) {
111 0 if (!path.mkdirs()) {
112 0 throw new IOException("Unable to create CPE Data directory" );
113
}
114
}
- 115 12 return path;
+ 115 17 return path;
116
}
117
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexReader.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexReader.html
index 53ae30bef..1ffae5f35 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexReader.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexReader.html
@@ -12,7 +12,7 @@
@@ -107,7 +107,7 @@
45
- 46 10 public class CpeIndexReader extends BaseIndex {
+ 46 15 public class CpeIndexReader extends BaseIndex {
47
48
@@ -176,12 +176,12 @@
public void open() throws IOException {
80
- 81 10 super .open();
- 82 10 indexReader = DirectoryReader.open(getDirectory());
- 83 10 indexSearcher = new IndexSearcher(indexReader);
- 84 10 searchingAnalyzer = createSearchingAnalyzer();
- 85 10 queryParser = new QueryParser(Version.LUCENE_43, Fields.DOCUMENT_KEY, searchingAnalyzer);
- 86 10 }
+ 81 15 super .open();
+ 82 15 indexReader = DirectoryReader.open(getDirectory());
+ 83 15 indexSearcher = new IndexSearcher(indexReader);
+ 84 15 searchingAnalyzer = createSearchingAnalyzer();
+ 85 15 queryParser = new QueryParser(Version.LUCENE_43, Fields.DOCUMENT_KEY, searchingAnalyzer);
+ 86 15 }
87
88
@@ -196,25 +196,25 @@
public void close() {
93
- 94 10 if (searchingAnalyzer != null ) {
- 95 10 searchingAnalyzer.close();
- 96 10 searchingAnalyzer = null ;
+ 94 15 if (searchingAnalyzer != null ) {
+ 95 15 searchingAnalyzer.close();
+ 96 15 searchingAnalyzer = null ;
97
}
- 98 10 if (indexReader != null ) {
+ 98 15 if (indexReader != null ) {
99
try {
- 100 10 indexReader.close();
+ 100 15 indexReader.close();
101 0 } catch (IOException ex) {
102 0 Logger.getLogger(CpeIndexReader.class .getName()).log(Level.FINEST, null , ex);
- 103 10 }
- 104 10 indexReader = null ;
+ 103 15 }
+ 104 15 indexReader = null ;
105
}
- 106 10 queryParser = null ;
- 107 10 indexSearcher = null ;
- 108 10 super .close();
- 109 10 }
+ 106 15 queryParser = null ;
+ 107 15 indexSearcher = null ;
+ 108 15 super .close();
+ 109 15 }
110
111
@@ -239,11 +239,11 @@
121
public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
- 122 53 if (searchString == null || searchString.trim().isEmpty()) {
+ 122 73 if (searchString == null || searchString.trim().isEmpty()) {
123 0 throw new ParseException("Query is null or empty" );
124
}
- 125 53 if (queryParser == null ) {
+ 125 73 if (queryParser == null ) {
126 0 if (isOpen()) {
127 0 final String msg = String.format("QueryParser is null for query: '%s'. Attempting to reopen index." ,
128
@@ -262,8 +262,8 @@
}
139
}
- 140 53 final Query query = queryParser.parse(searchString);
- 141 53 return indexSearcher.search(query, maxQueryResults);
+ 140 73 final Query query = queryParser.parse(searchString);
+ 141 73 return indexSearcher.search(query, maxQueryResults);
142
}
143
@@ -310,7 +310,7 @@
165
public Document getDocument(int documentId) throws IOException {
- 166 640 return indexSearcher.doc(documentId);
+ 166 741 return indexSearcher.doc(documentId);
167
}
168
@@ -329,15 +329,15 @@
@SuppressWarnings("unchecked" )
175
private Analyzer createSearchingAnalyzer() {
- 176 10 final Map fieldAnalyzers = new HashMap();
- 177 10 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
- 178 10 productSearchFieldAnalyzer = new SearchFieldAnalyzer(Version.LUCENE_43);
- 179 10 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(Version.LUCENE_43);
- 180 10 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
- 181 10 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
+ 176 15 final Map fieldAnalyzers = new HashMap();
+ 177 15 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+ 178 15 productSearchFieldAnalyzer = new SearchFieldAnalyzer(Version.LUCENE_43);
+ 179 15 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(Version.LUCENE_43);
+ 180 15 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
+ 181 15 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
182
- 183 10 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(Version.LUCENE_43), fieldAnalyzers);
+ 183 15 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(Version.LUCENE_43), fieldAnalyzers);
184
}
185
@@ -360,9 +360,30 @@
}
196 0 }
197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+ public int numDocs() {
+ 204 3 if (indexReader == null ) {
+ 205 0 return -1;
+ 206
+ }
+ 207 3 return indexReader.numDocs();
+ 208
+ }
+ 209
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexWriter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexWriter.html
index 6f1e81f09..9c6854514 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexWriter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeIndexWriter.html
@@ -267,6 +267,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
index 54d14817f..c5b148cc1 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
@@ -106,6 +106,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 af26e06bf..c6999a60d 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
@@ -75,7 +75,7 @@
29
- 30 9558 public class IndexEntry implements Serializable {
+ 30 11893 public class IndexEntry implements Serializable {
31
32
@@ -153,7 +153,7 @@
71
public String getVendor() {
- 72 2118 return vendor;
+ 72 3674 return vendor;
73
}
74
@@ -170,8 +170,8 @@
80
public void setVendor(String vendor) {
- 81 9557 this .vendor = vendor;
- 82 9557 }
+ 81 11892 this .vendor = vendor;
+ 82 11892 }
83
84
@@ -194,7 +194,7 @@
93
public String getProduct() {
- 94 2667 return product;
+ 94 4303 return product;
95
}
96
@@ -211,8 +211,8 @@
102
public void setProduct(String product) {
- 103 9557 this .product = product;
- 104 9557 }
+ 103 11892 this .product = product;
+ 104 11892 }
105
106
@@ -252,8 +252,8 @@
124
public void setSearchScore(float searchScore) {
- 125 640 this .searchScore = searchScore;
- 126 640 }
+ 125 741 this .searchScore = searchScore;
+ 126 741 }
127
128
@@ -318,21 +318,21 @@
@Override
163
public boolean equals(Object obj) {
- 164 5995 if (obj == null ) {
+ 164 6273 if (obj == null ) {
165 0 return false ;
166
}
- 167 5995 if (getClass() != obj.getClass()) {
+ 167 6273 if (getClass() != obj.getClass()) {
168 0 return false ;
169
}
- 170 5995 final IndexEntry other = (IndexEntry) obj;
- 171 5995 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
- 172 4772 return false ;
+ 170 6273 final IndexEntry other = (IndexEntry) obj;
+ 171 6273 if ((this .vendor == null ) ? (other.vendor != null ) : !this .vendor.equals(other.vendor)) {
+ 172 5038 return false ;
173
}
- 174 1223 if ((this .product == null ) ? (other.product != null ) : !this .product.equals(other.product)) {
- 175 1223 return false ;
+ 174 1235 if ((this .product == null ) ? (other.product != null ) : !this .product.equals(other.product)) {
+ 175 1235 return false ;
176
}
177 0 return true ;
@@ -361,6 +361,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 8935e3049..9a011b064 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
@@ -159,8 +159,8 @@
81
public static String getCweName(String cweId) {
- 82 48 if (cweId != null ) {
- 83 48 return CWE.get(cweId);
+ 82 49 if (cweId != null ) {
+ 83 49 return CWE.get(cweId);
84
}
85 0 return null ;
@@ -170,6 +170,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
index d0d96a03a..98ad854af 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
@@ -123,6 +123,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 3091ed2a1..62b88cc44 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
@@ -89,7 +89,7 @@
36
- 37 26 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 37 30 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
38
39
@@ -104,7 +104,7 @@
44
protected CharTermAttribute getTermAtt() {
- 45 32557 return termAtt;
+ 45 33027 return termAtt;
46
}
47
@@ -129,7 +129,7 @@
57
protected LinkedList<String> getTokens() {
- 58 32557 return tokens;
+ 58 33027 return tokens;
59
}
60
@@ -146,9 +146,9 @@
66
public AbstractTokenizingFilter(TokenStream stream) {
- 67 26 super (stream);
- 68 26 tokens = new LinkedList<String>();
- 69 26 }
+ 67 30 super (stream);
+ 68 30 tokens = new LinkedList<String>();
+ 69 30 }
70
71
@@ -163,20 +163,20 @@
76
protected boolean addTerm() {
- 77 32445 final boolean termAdded = tokens.size() > 0;
- 78 32445 if (termAdded) {
- 79 19310 final String term = tokens.pop();
- 80 19310 clearAttributes();
- 81 19310 termAtt.append(term);
+ 77 32955 final boolean termAdded = tokens.size() > 0;
+ 78 32955 if (termAdded) {
+ 79 19516 final String term = tokens.pop();
+ 80 19516 clearAttributes();
+ 81 19516 termAtt.append(term);
82
}
- 83 32445 return termAdded;
+ 83 32955 return termAdded;
84
}
85
}
-
+
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 9af9a1f38..96916211a 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
@@ -95,8 +95,8 @@
39
public AlphaNumericTokenizer(Version matchVersion, Reader in) {
- 40 21 super (matchVersion, in);
- 41 21 }
+ 40 25 super (matchVersion, in);
+ 41 25 }
42
43
@@ -135,13 +135,13 @@
@Override
61
protected boolean isTokenChar(int c) {
- 62 9457 return Character.isLetter(c) || Character.isDigit(c);
+ 62 10073 return Character.isLetter(c) || Character.isDigit(c);
63
}
64
}
-
+
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 64412e771..b5e688b60 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
@@ -117,6 +117,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 bc9e01175..dd418bb7e 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
@@ -115,9 +115,9 @@
49
- 50 12 public FieldAnalyzer(Version version) {
- 51 12 this .version = version;
- 52 12 }
+ 50 17 public FieldAnalyzer(Version version) {
+ 51 17 this .version = version;
+ 52 17 }
53
54
@@ -172,6 +172,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
index f3ba976b4..b14fd1124 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
@@ -111,15 +111,15 @@
final CharSequence text) {
48
- 49 1062 if (text == null || buf == null ) {
+ 49 1158 if (text == null || buf == null ) {
50 1 return ;
51
}
52
- 53 10776 for (int i = 0; i < text.length(); i++) {
- 54 9715 final char c = text.charAt(i);
- 55 9715 switch (c) {
+ 53 11488 for (int i = 0; i < text.length(); i++) {
+ 54 10331 final char c = text.charAt(i);
+ 55 10331 switch (c) {
56
case '+' :
57
@@ -159,14 +159,14 @@
74 226 buf.append('\\' );
75
default :
- 76 9715 buf.append(c);
+ 76 10331 buf.append(c);
77
break ;
78
}
79
}
- 80 1061 }
+ 80 1157 }
81
82
@@ -187,27 +187,27 @@
public static String escapeLuceneQuery(final CharSequence text) {
90
- 91 1045 if (text == null ) {
+ 91 1117 if (text == null ) {
92 1 return null ;
93
}
94
- 95 1044 int size = text.length();
- 96 1044 size = size >> 1;
- 97 1044 final StringBuilder buf = new StringBuilder(size);
+ 95 1116 int size = text.length();
+ 96 1116 size = size >> 1;
+ 97 1116 final StringBuilder buf = new StringBuilder(size);
98
- 99 1044 appendEscapedLuceneQuery(buf, text);
+ 99 1116 appendEscapedLuceneQuery(buf, text);
100
- 101 1044 return buf.toString();
+ 101 1116 return buf.toString();
102
}
103
}
-
+
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 0e1930374..74622507f 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
@@ -121,9 +121,9 @@
52
- 53 22 public SearchFieldAnalyzer(Version version) {
- 54 22 this .version = version;
- 55 22 }
+ 53 32 public SearchFieldAnalyzer(Version version) {
+ 54 32 this .version = version;
+ 55 32 }
56
57
@@ -144,13 +144,13 @@
@Override
65
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
- 66 20 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
+ 66 24 final Tokenizer source = new AlphaNumericTokenizer(version, reader);
67
- 68 20 TokenStream stream = source;
+ 68 24 TokenStream stream = source;
69
- 70 20 stream = new WordDelimiterFilter(stream,
+ 70 24 stream = new WordDelimiterFilter(stream,
71
WordDelimiterFilter.GENERATE_WORD_PARTS
72
@@ -165,14 +165,14 @@
| WordDelimiterFilter.STEM_ENGLISH_POSSESSIVE, null );
77
- 78 20 stream = new LowerCaseFilter(version, stream);
- 79 20 stream = new UrlTokenizingFilter(stream);
- 80 20 concatenatingFilter = new TokenPairConcatenatingFilter(stream);
- 81 20 stream = concatenatingFilter;
- 82 20 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+ 78 24 stream = new LowerCaseFilter(version, stream);
+ 79 24 stream = new UrlTokenizingFilter(stream);
+ 80 24 concatenatingFilter = new TokenPairConcatenatingFilter(stream);
+ 81 24 stream = concatenatingFilter;
+ 82 24 stream = new StopFilter(version, stream, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
83
- 84 20 return new TokenStreamComponents(source, stream);
+ 84 24 return new TokenStreamComponents(source, stream);
85
}
86
@@ -200,6 +200,6 @@
}
-
+
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 7c0e9806b..b762be1dd 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
@@ -159,6 +159,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 edf547352..f4ecace92 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
@@ -95,7 +95,7 @@
39
- 40 22 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 40 26 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
41
42
@@ -160,9 +160,9 @@
73
public TokenPairConcatenatingFilter(TokenStream stream) {
- 74 22 super (stream);
- 75 22 words = new LinkedList<String>();
- 76 22 }
+ 74 26 super (stream);
+ 75 26 words = new LinkedList<String>();
+ 76 26 }
77
78
@@ -189,35 +189,35 @@
89
- 90 7168 while (input.incrementToken()) {
- 91 2024 final String word = new String(termAtt.buffer(), 0, termAtt.length());
- 92 2024 words.add(word);
- 93 2024 }
+ 90 7578 while (input.incrementToken()) {
+ 91 2130 final String word = new String(termAtt.buffer(), 0, termAtt.length());
+ 92 2130 words.add(word);
+ 93 2130 }
94
95
96
- 97 5144 if (previousWord != null && words.size() > 0) {
- 98 2000 final String word = words.getFirst();
- 99 2000 clearAttributes();
- 100 2000 termAtt.append(previousWord).append(word);
- 101 2000 previousWord = null ;
- 102 2000 return true ;
+ 97 5448 if (previousWord != null && words.size() > 0) {
+ 98 2102 final String word = words.getFirst();
+ 99 2102 clearAttributes();
+ 100 2102 termAtt.append(previousWord).append(word);
+ 101 2102 previousWord = null ;
+ 102 2102 return true ;
103
}
104
- 105 3144 if (words.size() > 0) {
- 106 2024 final String word = words.removeFirst();
- 107 2024 clearAttributes();
- 108 2024 termAtt.append(word);
- 109 2024 previousWord = word;
- 110 2024 return true ;
+ 105 3346 if (words.size() > 0) {
+ 106 2130 final String word = words.removeFirst();
+ 107 2130 clearAttributes();
+ 108 2130 termAtt.append(word);
+ 109 2130 previousWord = word;
+ 110 2130 return true ;
111
}
- 112 1120 return false ;
+ 112 1216 return false ;
113
}
114
@@ -243,6 +243,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
index ad1f0462e..e82cb5e12 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
@@ -109,8 +109,8 @@
46
public UrlTokenizingFilter(TokenStream stream) {
- 47 26 super (stream);
- 48 26 }
+ 47 30 super (stream);
+ 48 30 }
49
50
@@ -133,11 +133,11 @@
@Override
59
public boolean incrementToken() throws IOException {
- 60 32557 final LinkedList<String> tokens = getTokens();
- 61 32557 final CharTermAttribute termAtt = getTermAtt();
- 62 32557 if (tokens.size() == 0 && input.incrementToken()) {
- 63 19309 final String text = new String(termAtt.buffer(), 0, termAtt.length());
- 64 19309 if (UrlStringUtils.containsUrl(text)) {
+ 60 33027 final LinkedList<String> tokens = getTokens();
+ 61 33027 final CharTermAttribute termAtt = getTermAtt();
+ 62 33027 if (tokens.size() == 0 && input.incrementToken()) {
+ 63 19515 final String text = new String(termAtt.buffer(), 0, termAtt.length());
+ 64 19515 if (UrlStringUtils.containsUrl(text)) {
65 2 final String[] parts = text.split("\\s" );
66 4 for (String part : parts) {
67 2 if (UrlStringUtils.isUrl(part)) {
@@ -157,18 +157,18 @@
78
}
79 2 } else {
- 80 19307 tokens.add(text);
+ 80 19513 tokens.add(text);
81
}
82
}
- 83 32445 return addTerm();
+ 83 32955 return addTerm();
84
}
85
}
-
+
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 39fe3e95e..eba45afa4 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
@@ -156,6 +156,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 19cd717b3..db76e4f00 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
@@ -197,6 +197,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
index 871214eed..0f8295b36 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
@@ -119,6 +119,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
index a1b77d6ab..f5fd2d3c6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CveDB.html
@@ -12,7 +12,7 @@
@@ -119,7 +119,7 @@
51
- 52 15 public class CveDB {
+ 52 19 public class CveDB {
53
54
@@ -344,18 +344,18 @@
justification = "Yes, I know... Blank password." )
164
public void open() throws IOException, SQLException, DatabaseException, ClassNotFoundException {
- 165 15 final String fileName = CveDB.getDataDirectory().getCanonicalPath();
- 166 15 final File f = new File(fileName, "cve." + DB_SCHEMA_VERSION);
- 167 15 final File check = new File(f.getAbsolutePath() + ".h2.db" );
- 168 15 final boolean createTables = !check.exists();
- 169 15 final String connStr = String.format("jdbc:h2:file:%s;AUTO_SERVER=TRUE" , f.getAbsolutePath());
- 170 15 Class.forName("org.h2.Driver" );
- 171 15 conn = DriverManager.getConnection(connStr, "sa" , "" );
- 172 15 if (createTables) {
+ 165 19 final String fileName = CveDB.getDataDirectory().getCanonicalPath();
+ 166 19 final File f = new File(fileName, "cve." + DB_SCHEMA_VERSION);
+ 167 19 final File check = new File(f.getAbsolutePath() + ".h2.db" );
+ 168 19 final boolean createTables = !check.exists();
+ 169 19 final String connStr = String.format("jdbc:h2:file:%s;AUTO_SERVER=TRUE" , f.getAbsolutePath());
+ 170 19 Class.forName("org.h2.Driver" );
+ 171 19 conn = DriverManager.getConnection(connStr, "sa" , "" );
+ 172 19 if (createTables) {
173 0 createTables();
174
}
- 175 15 }
+ 175 19 }
176
177
@@ -391,9 +391,9 @@
@Override
194
protected void finalize() throws Throwable {
- 195 8 close();
- 196 8 super .finalize();
- 197 8 }
+ 195 12 close();
+ 196 12 super .finalize();
+ 197 12 }
198
199
@@ -406,19 +406,19 @@
203
public void close() {
- 204 23 if (conn != null ) {
+ 204 31 if (conn != null ) {
205
try {
- 206 15 conn.close();
+ 206 19 conn.close();
207 0 } catch (SQLException ex) {
208 0 final String msg = "There was an error attempting to close the CveDB, see the log for more details." ;
209 0 Logger.getLogger(CveDB.class .getName()).log(Level.SEVERE, msg, ex);
210 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINE, null , ex);
- 211 15 }
- 212 15 conn = null ;
+ 211 19 }
+ 212 19 conn = null ;
213
}
- 214 23 }
+ 214 31 }
215
216
@@ -443,30 +443,30 @@
226
public Set<VulnerableSoftware> getCPEs(String vendor, String product) {
- 227 52 final Set<VulnerableSoftware> cpe = new HashSet<VulnerableSoftware>();
- 228 52 ResultSet rs = null ;
- 229 52 PreparedStatement ps = null ;
+ 227 72 final Set<VulnerableSoftware> cpe = new HashSet<VulnerableSoftware>();
+ 228 72 ResultSet rs = null ;
+ 229 72 PreparedStatement ps = null ;
230
try {
- 231 52 ps = conn.prepareStatement(SELECT_CPE_ENTRIES);
- 232 52 ps.setString(1, vendor);
- 233 52 ps.setString(2, product);
- 234 52 rs = ps.executeQuery();
+ 231 72 ps = conn.prepareStatement(SELECT_CPE_ENTRIES);
+ 232 72 ps.setString(1, vendor);
+ 233 72 ps.setString(2, product);
+ 234 72 rs = ps.executeQuery();
235
- 236 3713 while (rs.next()) {
- 237 3661 final VulnerableSoftware vs = new VulnerableSoftware();
- 238 3661 vs.setCpe(rs.getString(1));
- 239 3661 cpe.add(vs);
- 240 3661 }
+ 236 4454 while (rs.next()) {
+ 237 4382 final VulnerableSoftware vs = new VulnerableSoftware();
+ 238 4382 vs.setCpe(rs.getString(1));
+ 239 4382 cpe.add(vs);
+ 240 4382 }
241 0 } catch (SQLException ex) {
242 0 Logger.getLogger(CveDB.class .getName()).log(Level.SEVERE, null , ex);
243
} finally {
- 244 52 closeResultSet(rs);
- 245 52 closeStatement(ps);
- 246 52 }
- 247 52 return cpe;
+ 244 72 closeResultSet(rs);
+ 245 72 closeStatement(ps);
+ 246 72 }
+ 247 72 return cpe;
248
}
249
@@ -487,51 +487,51 @@
257
public List<Vulnerability> getVulnerabilities(String cpeStr) throws DatabaseException {
- 258 7 ResultSet rs = null ;
- 259 7 final VulnerableSoftware cpe = new VulnerableSoftware();
+ 258 12 ResultSet rs = null ;
+ 259 12 final VulnerableSoftware cpe = new VulnerableSoftware();
260
try {
- 261 7 cpe.parseName(cpeStr);
+ 261 12 cpe.parseName(cpeStr);
262 0 } catch (UnsupportedEncodingException ex) {
263 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINEST, null , ex);
- 264 7 }
- 265 7 final DependencyVersion detectedVersion = parseDependencyVersion(cpe);
- 266 7 final List<Vulnerability> vulnerabilities = new ArrayList<Vulnerability>();
+ 264 12 }
+ 265 12 final DependencyVersion detectedVersion = parseDependencyVersion(cpe);
+ 266 12 final List<Vulnerability> vulnerabilities = new ArrayList<Vulnerability>();
267
268
PreparedStatement ps;
- 269 7 final HashSet<String> cveEntries = new HashSet<String>();
+ 269 12 final HashSet<String> cveEntries = new HashSet<String>();
270
try {
- 271 7 ps = conn.prepareStatement(SELECT_CVE_FROM_SOFTWARE);
- 272 7 ps.setString(1, cpe.getVendor());
- 273 7 ps.setString(2, cpe.getProduct());
- 274 7 rs = ps.executeQuery();
- 275 2976 while (rs.next()) {
- 276 2969 final String cveId = rs.getString(1);
- 277 2969 final String cpeId = rs.getString(2);
- 278 2969 final String previous = rs.getString(3);
- 279 2969 if (!cveEntries.contains(cveId) && isAffected(cpe.getVendor(), cpe.getProduct(), detectedVersion, cpeId, previous)) {
- 280 50 cveEntries.add(cveId);
+ 271 12 ps = conn.prepareStatement(SELECT_CVE_FROM_SOFTWARE);
+ 272 12 ps.setString(1, cpe.getVendor());
+ 273 12 ps.setString(2, cpe.getProduct());
+ 274 12 rs = ps.executeQuery();
+ 275 4500 while (rs.next()) {
+ 276 4488 final String cveId = rs.getString(1);
+ 277 4488 final String cpeId = rs.getString(2);
+ 278 4488 final String previous = rs.getString(3);
+ 279 4488 if (!cveEntries.contains(cveId) && isAffected(cpe.getVendor(), cpe.getProduct(), detectedVersion, cpeId, previous)) {
+ 280 59 cveEntries.add(cveId);
281
}
- 282 2969 }
- 283 7 closeResultSet(rs);
- 284 7 closeStatement(ps);
- 285 7 for (String cve : cveEntries) {
- 286 50 final Vulnerability v = getVulnerability(cve);
- 287 50 vulnerabilities.add(v);
- 288 50 }
+ 282 4488 }
+ 283 12 closeResultSet(rs);
+ 284 12 closeStatement(ps);
+ 285 12 for (String cve : cveEntries) {
+ 286 59 final Vulnerability v = getVulnerability(cve);
+ 287 59 vulnerabilities.add(v);
+ 288 59 }
289
290 0 } catch (SQLException ex) {
291 0 throw new DatabaseException("Exception retrieving vulnerability for " + cpeStr, ex);
292
} finally {
- 293 7 closeResultSet(rs);
- 294 7 }
- 295 7 return vulnerabilities;
+ 293 12 closeResultSet(rs);
+ 294 12 }
+ 295 12 return vulnerabilities;
296
}
297
@@ -552,77 +552,77 @@
305
private Vulnerability getVulnerability(String cve) throws DatabaseException {
- 306 50 PreparedStatement psV = null ;
- 307 50 PreparedStatement psR = null ;
- 308 50 PreparedStatement psS = null ;
- 309 50 ResultSet rsV = null ;
- 310 50 ResultSet rsR = null ;
- 311 50 ResultSet rsS = null ;
- 312 50 Vulnerability vuln = null ;
+ 306 59 PreparedStatement psV = null ;
+ 307 59 PreparedStatement psR = null ;
+ 308 59 PreparedStatement psS = null ;
+ 309 59 ResultSet rsV = null ;
+ 310 59 ResultSet rsR = null ;
+ 311 59 ResultSet rsS = null ;
+ 312 59 Vulnerability vuln = null ;
313
try {
- 314 50 psV = conn.prepareStatement(SELECT_VULNERABILITY);
- 315 50 psV.setString(1, cve);
- 316 50 rsV = psV.executeQuery();
- 317 50 if (rsV.next()) {
- 318 50 vuln = new Vulnerability();
- 319 50 vuln.setName(cve);
- 320 50 vuln.setDescription(rsV.getString(2));
- 321 50 String cwe = rsV.getString(3);
- 322 50 if (cwe != null ) {
- 323 47 final String name = CweDB.getCweName(cwe);
- 324 47 if (name != null ) {
- 325 45 cwe += " " + name;
+ 314 59 psV = conn.prepareStatement(SELECT_VULNERABILITY);
+ 315 59 psV.setString(1, cve);
+ 316 59 rsV = psV.executeQuery();
+ 317 59 if (rsV.next()) {
+ 318 59 vuln = new Vulnerability();
+ 319 59 vuln.setName(cve);
+ 320 59 vuln.setDescription(rsV.getString(2));
+ 321 59 String cwe = rsV.getString(3);
+ 322 59 if (cwe != null ) {
+ 323 48 final String name = CweDB.getCweName(cwe);
+ 324 48 if (name != null ) {
+ 325 46 cwe += " " + name;
326
}
327
}
- 328 50 final int cveId = rsV.getInt(1);
- 329 50 vuln.setCwe(cwe);
- 330 50 vuln.setCvssScore(rsV.getFloat(4));
- 331 50 vuln.setCvssAccessVector(rsV.getString(5));
- 332 50 vuln.setCvssAccessComplexity(rsV.getString(6));
- 333 50 vuln.setCvssAuthentication(rsV.getString(7));
- 334 50 vuln.setCvssConfidentialityImpact(rsV.getString(8));
- 335 50 vuln.setCvssIntegrityImpact(rsV.getString(9));
- 336 50 vuln.setCvssAvailabilityImpact(rsV.getString(10));
+ 328 59 final int cveId = rsV.getInt(1);
+ 329 59 vuln.setCwe(cwe);
+ 330 59 vuln.setCvssScore(rsV.getFloat(4));
+ 331 59 vuln.setCvssAccessVector(rsV.getString(5));
+ 332 59 vuln.setCvssAccessComplexity(rsV.getString(6));
+ 333 59 vuln.setCvssAuthentication(rsV.getString(7));
+ 334 59 vuln.setCvssConfidentialityImpact(rsV.getString(8));
+ 335 59 vuln.setCvssIntegrityImpact(rsV.getString(9));
+ 336 59 vuln.setCvssAvailabilityImpact(rsV.getString(10));
337
- 338 50 psR = conn.prepareStatement(SELECT_REFERENCE);
- 339 50 psR.setInt(1, cveId);
- 340 50 rsR = psR.executeQuery();
- 341 351 while (rsR.next()) {
- 342 301 vuln.addReference(rsR.getString(1), rsR.getString(2), rsR.getString(3));
+ 338 59 psR = conn.prepareStatement(SELECT_REFERENCE);
+ 339 59 psR.setInt(1, cveId);
+ 340 59 rsR = psR.executeQuery();
+ 341 460 while (rsR.next()) {
+ 342 401 vuln.addReference(rsR.getString(1), rsR.getString(2), rsR.getString(3));
343
}
- 344 50 psS = conn.prepareStatement(SELECT_SOFTWARE);
- 345 50 psS.setInt(1, cveId);
- 346 50 rsS = psS.executeQuery();
+ 344 59 psS = conn.prepareStatement(SELECT_SOFTWARE);
+ 345 59 psS.setInt(1, cveId);
+ 346 59 rsS = psS.executeQuery();
347 2673 while (rsS.next()) {
- 348 2623 final String cpe = rsS.getString(1);
- 349 2623 final String prevVersion = rsS.getString(2);
- 350 2623 if (prevVersion == null ) {
- 351 2586 vuln.addVulnerableSoftware(cpe);
+ 348 2614 final String cpe = rsS.getString(1);
+ 349 2614 final String prevVersion = rsS.getString(2);
+ 350 2614 if (prevVersion == null ) {
+ 351 2572 vuln.addVulnerableSoftware(cpe);
352
} else {
- 353 37 vuln.addVulnerableSoftware(cpe, prevVersion);
+ 353 42 vuln.addVulnerableSoftware(cpe, prevVersion);
354
}
- 355 2623 }
+ 355 2614 }
356
}
357 0 } catch (SQLException ex) {
358 0 throw new DatabaseException("Error retrieving " + cve, ex);
359
} finally {
- 360 50 closeResultSet(rsV);
- 361 50 closeResultSet(rsR);
- 362 50 closeResultSet(rsS);
- 363 50 closeStatement(psV);
- 364 50 closeStatement(psR);
- 365 50 closeStatement(psS);
- 366 50 }
- 367 50 return vuln;
+ 360 59 closeResultSet(rsV);
+ 361 59 closeResultSet(rsR);
+ 362 59 closeResultSet(rsS);
+ 363 59 closeStatement(psV);
+ 364 59 closeStatement(psR);
+ 365 59 closeStatement(psS);
+ 366 59 }
+ 367 59 return vuln;
368
}
369
@@ -809,15 +809,15 @@
514
public static File getDataDirectory() throws IOException {
- 515 16 final File path = Settings.getFile(Settings.KEYS.CVE_DATA_DIRECTORY);
- 516 16 if (!path.exists()) {
+ 515 20 final File path = Settings.getFile(Settings.KEYS.CVE_DATA_DIRECTORY);
+ 516 20 if (!path.exists()) {
517 1 if (!path.mkdirs()) {
518 0 throw new IOException("Unable to create NVD CVE Data directory" );
519
}
520
}
- 521 16 return path;
+ 521 20 return path;
522
}
523
@@ -923,18 +923,18 @@
588
private void closeStatement(Statement statement) {
- 589 209 if (statement != null ) {
+ 589 261 if (statement != null ) {
590
try {
- 591 209 statement.close();
+ 591 261 statement.close();
592 0 } catch (SQLException ex) {
593 0 Logger.getLogger(CveDB.class
594
.getName()).log(Level.FINEST, statement.toString(), ex);
- 595 209 }
+ 595 261 }
596
}
- 597 209 }
+ 597 261 }
598
599
@@ -951,18 +951,18 @@
605
private void closeResultSet(ResultSet rs) {
- 606 216 if (rs != null ) {
+ 606 273 if (rs != null ) {
607
try {
- 608 216 rs.close();
+ 608 273 rs.close();
609 0 } catch (SQLException ex) {
610 0 Logger.getLogger(CveDB.class
611
.getName()).log(Level.FINEST, rs.toString(), ex);
- 612 216 }
+ 612 273 }
613
}
- 614 216 }
+ 614 273 }
615
616
@@ -1035,24 +1035,24 @@
655
private boolean isAffected(String vendor, String product, DependencyVersion identifiedVersion, String cpeId, String previous) {
- 656 1982 boolean affected = false ;
- 657 1982 final boolean isStruts = "apache" .equals(vendor) && "struts" .equals(product);
- 658 1982 final DependencyVersion v = parseDependencyVersion(cpeId);
- 659 1982 final boolean prevAffected = previous == null ? false : !previous.isEmpty();
- 660 1982 if (identifiedVersion == null || "-" .equals(identifiedVersion.toString())) {
- 661 0 if (v == null || "-" .equals(v.toString())) {
+ 656 3491 boolean affected = false ;
+ 657 3491 final boolean isStruts = "apache" .equals(vendor) && "struts" .equals(product);
+ 658 3491 final DependencyVersion v = parseDependencyVersion(cpeId);
+ 659 3491 final boolean prevAffected = previous == null ? false : !previous.isEmpty();
+ 660 3491 if (identifiedVersion == null || "-" .equals(identifiedVersion.toString())) {
+ 661 96 if (v == null || "-" .equals(v.toString())) {
662 0 affected = true ;
663
}
- 664 1982 } else if (identifiedVersion.equals(v) || (prevAffected && identifiedVersion.compareTo(v) < 0)) {
- 665 50 if (isStruts) {
- 666 38 if (identifiedVersion.getVersionParts().get(0).equals(v.getVersionParts().get(0))) {
- 667 38 affected = true ;
+ 664 3395 } else if (identifiedVersion.equals(v) || (prevAffected && identifiedVersion.compareTo(v) < 0)) {
+ 665 81 if (isStruts) {
+ 666 70 if (identifiedVersion.getVersionParts().get(0).equals(v.getVersionParts().get(0))) {
+ 667 48 affected = true ;
668
}
669
} else {
- 670 12 affected = true ;
+ 670 11 affected = true ;
671
}
672
@@ -1065,7 +1065,7 @@
676
- 677 1982 return affected;
+ 677 3491 return affected;
678
}
679
@@ -1086,16 +1086,16 @@
687
private DependencyVersion parseDependencyVersion(String cpeStr) {
- 688 1982 final VulnerableSoftware cpe = new VulnerableSoftware();
+ 688 3491 final VulnerableSoftware cpe = new VulnerableSoftware();
689
try {
- 690 1982 cpe.parseName(cpeStr);
+ 690 3491 cpe.parseName(cpeStr);
691 0 } catch (UnsupportedEncodingException ex) {
692
693 0 Logger.getLogger(CveDB.class .getName()).log(Level.FINEST, null , ex);
- 694 1982 }
- 695 1982 return parseDependencyVersion(cpe);
+ 694 3491 }
+ 695 3491 return parseDependencyVersion(cpe);
696
}
697
@@ -1118,28 +1118,28 @@
private DependencyVersion parseDependencyVersion(VulnerableSoftware cpe) {
706
DependencyVersion cpeVersion;
- 707 1989 if (cpe.getVersion() != null && cpe.getVersion().length() > 0) {
+ 707 3503 if (cpe.getVersion() != null && cpe.getVersion().length() > 0) {
708
String versionText;
- 709 1987 if (cpe.getRevision() != null && cpe.getRevision().length() > 0) {
- 710 460 versionText = String.format("%s.%s" , cpe.getVersion(), cpe.getRevision());
+ 709 3499 if (cpe.getRevision() != null && cpe.getRevision().length() > 0) {
+ 710 441 versionText = String.format("%s.%s" , cpe.getVersion(), cpe.getRevision());
711
} else {
- 712 1527 versionText = cpe.getVersion();
+ 712 3058 versionText = cpe.getVersion();
713
}
- 714 1987 cpeVersion = DependencyVersionUtil.parseVersion(versionText);
- 715 1987 } else {
- 716 2 cpeVersion = new DependencyVersion("-" );
+ 714 3499 cpeVersion = DependencyVersionUtil.parseVersion(versionText);
+ 715 3499 } else {
+ 716 4 cpeVersion = new DependencyVersion("-" );
717
}
- 718 1989 return cpeVersion;
+ 718 3503 return cpeVersion;
719
}
720
}
-
+
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 618780506..871bcf407 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
@@ -117,6 +117,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.InvalidDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.InvalidDataException.html
index 5ead0dc10..54ec610f6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.InvalidDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.InvalidDataException.html
@@ -119,6 +119,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve12Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve12Handler.html
index 86138faf2..d497681c9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve12Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve12Handler.html
@@ -457,6 +457,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve20Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve20Handler.html
index be1ebc99d..94734de4d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve20Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.NvdCve20Handler.html
@@ -896,6 +896,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.AbstractUpdateTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.AbstractUpdateTask.html
index 3ef20ffee..1e86e6991 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.AbstractUpdateTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.AbstractUpdateTask.html
@@ -523,6 +523,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BatchUpdateTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BatchUpdateTask.html
index e02e03a65..64818e70a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BatchUpdateTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.BatchUpdateTask.html
@@ -453,6 +453,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DataStoreMetaInfo.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DataStoreMetaInfo.html
index 44a713842..be86c3e2b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DataStoreMetaInfo.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DataStoreMetaInfo.html
@@ -428,6 +428,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DatabaseUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DatabaseUpdater.html
index e60ab855f..6a4f0f271 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DatabaseUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.DatabaseUpdater.html
@@ -210,6 +210,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 2dc6740e9..ccd226ad6 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
@@ -278,6 +278,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdateTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdateTask.html
index aafbc4ab6..35128afff 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdateTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdateTask.html
@@ -481,6 +481,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTask.html
index a775987a5..e5050696d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTask.html
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTaskFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTaskFactory.html
index d25dc6533..47d704bc3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTaskFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateTaskFactory.html
@@ -132,6 +132,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.Updateable.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.Updateable.html
index 4a309a6c5..36d613d43 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.Updateable.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.Updateable.html
@@ -352,6 +352,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
index b1905c2d8..d3cee5b17 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
@@ -99,7 +99,7 @@
41
- 42 14 public class Dependency implements Comparable<Dependency> {
+ 42 26 public class Dependency implements Comparable<Dependency> {
43
44
@@ -190,13 +190,13 @@
87
- 88 45 public Dependency() {
- 89 45 vendorEvidence = new EvidenceCollection();
- 90 45 productEvidence = new EvidenceCollection();
- 91 45 versionEvidence = new EvidenceCollection();
- 92 45 identifiers = new TreeSet<Identifier>();
- 93 45 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
- 94 45 }
+ 88 53 public Dependency() {
+ 89 53 vendorEvidence = new EvidenceCollection();
+ 90 53 productEvidence = new EvidenceCollection();
+ 91 53 versionEvidence = new EvidenceCollection();
+ 92 53 identifiers = new TreeSet<Identifier>();
+ 93 53 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
+ 94 53 }
95
96
@@ -211,13 +211,13 @@
101
public Dependency(File file) {
- 102 27 this ();
- 103 27 this .actualFilePath = file.getPath();
- 104 27 this .filePath = this .actualFilePath;
- 105 27 this .fileName = file.getName();
- 106 27 this .fileExtension = FileUtils.getFileExtension(fileName);
- 107 27 determineHashes(file);
- 108 27 }
+ 102 35 this ();
+ 103 35 this .actualFilePath = file.getPath();
+ 104 35 this .filePath = this .actualFilePath;
+ 105 35 this .fileName = file.getName();
+ 106 35 this .fileExtension = FileUtils.getFileExtension(fileName);
+ 107 35 determineHashes(file);
+ 108 35 }
109
110
@@ -232,7 +232,7 @@
115
public String getFileName() {
- 116 91 return this .fileName;
+ 116 160 return this .fileName;
117
}
118
@@ -249,8 +249,8 @@
124
public void setFileName(String fileName) {
- 125 7 this .fileName = fileName;
- 126 7 }
+ 125 12 this .fileName = fileName;
+ 126 12 }
127
128
@@ -281,7 +281,7 @@
142
public String getActualFilePath() {
- 143 82 return this .actualFilePath;
+ 143 142 return this .actualFilePath;
144
}
145
@@ -298,8 +298,8 @@
151
public void setFilePath(String filePath) {
- 152 7 this .filePath = filePath;
- 153 7 }
+ 152 12 this .filePath = filePath;
+ 153 12 }
154
155
@@ -318,7 +318,7 @@
162
public String getFilePath() {
- 163 10 return this .filePath;
+ 163 17 return this .filePath;
164
}
165
@@ -351,7 +351,7 @@
180
public String getFileExtension() {
- 181 31 return this .fileExtension;
+ 181 80 return this .fileExtension;
182
}
183
@@ -385,8 +385,8 @@
198
public void setMd5sum(String md5sum) {
- 199 28 this .md5sum = md5sum;
- 200 28 }
+ 199 36 this .md5sum = md5sum;
+ 200 36 }
201
202
@@ -418,8 +418,8 @@
216
public void setSha1sum(String sha1sum) {
- 217 28 this .sha1sum = sha1sum;
- 218 28 }
+ 217 36 this .sha1sum = sha1sum;
+ 218 36 }
219
220
@@ -434,7 +434,7 @@
225
public Set<Identifier> getIdentifiers() {
- 226 78 return this .identifiers;
+ 226 125 return this .identifiers;
227
}
228
@@ -492,8 +492,8 @@
257
public void addIdentifier(Identifier identifier) {
- 258 60 this .identifiers.add(identifier);
- 259 60 }
+ 258 88 this .identifiers.add(identifier);
+ 259 88 }
260
261
@@ -542,7 +542,7 @@
284
public EvidenceCollection getVendorEvidence() {
- 285 347 return this .vendorEvidence;
+ 285 451 return this .vendorEvidence;
286
}
287
@@ -559,7 +559,7 @@
293
public EvidenceCollection getProductEvidence() {
- 294 902 return this .productEvidence;
+ 294 1080 return this .productEvidence;
295
}
296
@@ -576,7 +576,7 @@
302
public EvidenceCollection getVersionEvidence() {
- 303 246 return this .versionEvidence;
+ 303 328 return this .versionEvidence;
304
}
305
@@ -585,7 +585,7 @@
307
- 308 45 private List<Exception> analysisExceptions = new ArrayList<Exception>();
+ 308 53 private List<Exception> analysisExceptions = new ArrayList<Exception>();
309
310
@@ -739,7 +739,7 @@
390
public SortedSet<Vulnerability> getVulnerabilities() {
- 391 12 return vulnerabilities;
+ 391 17 return vulnerabilities;
392
}
393
@@ -772,12 +772,12 @@
408
private void determineHashes(File file) {
- 409 27 String md5 = null ;
- 410 27 String sha1 = null ;
+ 409 35 String md5 = null ;
+ 410 35 String sha1 = null ;
411
try {
- 412 27 md5 = Checksum.getMD5Checksum(file);
- 413 27 sha1 = Checksum.getSHA1Checksum(file);
+ 412 35 md5 = Checksum.getMD5Checksum(file);
+ 413 35 sha1 = Checksum.getSHA1Checksum(file);
414 0 } catch (IOException ex) {
415 0 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
416 0 Logger.getLogger(Dependency.class .getName()).log(Level.WARNING, msg);
@@ -786,10 +786,10 @@
419 0 final String msg = "Unable to use MD5 of SHA1 checksums." ;
420 0 Logger.getLogger(Dependency.class .getName()).log(Level.WARNING, msg);
421 0 Logger.getLogger(Dependency.class .getName()).log(Level.FINE, null , ex);
- 422 27 }
- 423 27 this .setMd5sum(md5);
- 424 27 this .setSha1sum(sha1);
- 425 27 }
+ 422 35 }
+ 423 35 this .setMd5sum(md5);
+ 424 35 this .setSha1sum(sha1);
+ 425 35 }
426
427
@@ -812,7 +812,7 @@
437
- 438 45 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
+ 438 53 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
439
440
@@ -880,7 +880,7 @@
474
public int compareTo(Dependency o) {
- 475 14 return this .getFileName().compareToIgnoreCase(o.getFileName());
+ 475 26 return this .getFileName().compareToIgnoreCase(o.getFileName());
476
}
477
@@ -993,23 +993,23 @@
@Override
549
public int hashCode() {
- 550 29 int hash = 3;
- 551 29 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
- 552 29 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
- 553 29 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
- 554 29 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
- 555 29 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
- 556 29 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
- 557 29 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
- 558 29 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
- 559 29 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
- 560 29 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
- 561 29 hash = 47 * hash + (this .analysisExceptions != null ? this .analysisExceptions.hashCode() : 0);
- 562 29 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
- 563 29 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
- 564 29 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
- 565 29 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
- 566 29 return hash;
+ 550 90 int hash = 3;
+ 551 90 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
+ 552 90 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
+ 553 90 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
+ 554 90 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
+ 555 90 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
+ 556 90 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
+ 557 90 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
+ 558 90 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
+ 559 90 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
+ 560 90 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
+ 561 90 hash = 47 * hash + (this .analysisExceptions != null ? this .analysisExceptions.hashCode() : 0);
+ 562 90 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
+ 563 90 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
+ 564 90 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
+ 565 90 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
+ 566 90 return hash;
567
}
568
@@ -1037,6 +1037,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
index 23b90375d..e356dc79e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
@@ -68,7 +68,7 @@
25
- 26 122292 public class Evidence implements Comparable<Evidence> {
+ 26 129498 public class Evidence implements Comparable<Evidence> {
27
28
@@ -77,7 +77,7 @@
30
- 31 56 public enum Confidence {
+ 31 76 public enum Confidence {
32
33
@@ -138,12 +138,12 @@
64
- 65 67264 public Evidence(String source, String name, String value, Confidence confidence) {
- 66 67264 this .source = source;
- 67 67264 this .name = name;
- 68 67264 this .value = value;
- 69 67264 this .confidence = confidence;
- 70 67264 }
+ 65 70882 public Evidence(String source, String name, String value, Confidence confidence) {
+ 66 70882 this .source = source;
+ 67 70882 this .name = name;
+ 68 70882 this .value = value;
+ 69 70882 this .confidence = confidence;
+ 70 70882 }
71
72
@@ -248,8 +248,8 @@
125
public String getValue() {
- 126 6305 used = true ;
- 127 6305 return value;
+ 126 6725 used = true ;
+ 127 6725 return value;
128
}
129
@@ -272,8 +272,8 @@
138
public String getValue(Boolean setUsed) {
- 139 166 used = used || setUsed;
- 140 166 return value;
+ 139 210 used = used || setUsed;
+ 140 210 return value;
141
}
142
@@ -314,7 +314,7 @@
161
public boolean isUsed() {
- 162 8837 return used;
+ 162 9273 return used;
163
}
164
@@ -355,7 +355,7 @@
183
public Confidence getConfidence() {
- 184 2249 return confidence;
+ 184 2551 return confidence;
185
}
186
@@ -471,11 +471,11 @@
249
public int compareTo(Evidence o) {
- 250 122292 if (source.equals(o.source)) {
- 251 95835 if (name.equals(o.name)) {
- 252 95561 if (value.equals(o.value)) {
- 253 66918 if (confidence.equals(o.confidence)) {
- 254 66913 return 0;
+ 250 129498 if (source.equals(o.source)) {
+ 251 99433 if (name.equals(o.name)) {
+ 252 99127 if (value.equals(o.value)) {
+ 253 70476 if (confidence.equals(o.confidence)) {
+ 254 70471 return 0;
255
} else {
256 5 return confidence.compareTo(o.confidence);
@@ -483,17 +483,17 @@
}
258
} else {
- 259 28643 return value.compareToIgnoreCase(o.value);
+ 259 28651 return value.compareToIgnoreCase(o.value);
260
}
261
} else {
- 262 274 return name.compareToIgnoreCase(o.name);
+ 262 306 return name.compareToIgnoreCase(o.name);
263
}
264
} else {
- 265 26457 return source.compareToIgnoreCase(o.source);
+ 265 30065 return source.compareToIgnoreCase(o.source);
266
}
267
@@ -502,6 +502,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 51f079280..b651b16d7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
@@ -112,10 +112,10 @@
45
- 46 388 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
+ 46 442 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
47
public boolean passes(Evidence evidence) {
- 48 387 return evidence.getConfidence() == Evidence.Confidence.HIGHEST;
+ 48 441 return evidence.getConfidence() == Evidence.Confidence.HIGHEST;
49
}
50
@@ -128,10 +128,10 @@
54
- 55 385 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
+ 55 439 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
56
public boolean passes(Evidence evidence) {
- 57 384 return evidence.getConfidence() == Evidence.Confidence.HIGH;
+ 57 438 return evidence.getConfidence() == Evidence.Confidence.HIGH;
58
}
59
@@ -147,7 +147,7 @@
64 1 private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
65
public boolean passes(Evidence evidence) {
- 66 373 return evidence.getConfidence() == Evidence.Confidence.MEDIUM;
+ 66 419 return evidence.getConfidence() == Evidence.Confidence.MEDIUM;
67
}
68
@@ -161,7 +161,7 @@
72 1 private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
73
public boolean passes(Evidence evidence) {
- 74 630 return evidence.getConfidence() == Evidence.Confidence.LOW;
+ 74 706 return evidence.getConfidence() == Evidence.Confidence.LOW;
75
}
76
@@ -177,7 +177,7 @@
81 1 private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
82
public boolean passes(Evidence evidence) {
- 83 8778 return evidence.isUsed();
+ 83 9214 return evidence.isUsed();
84
}
85
@@ -200,15 +200,15 @@
94
public final Iterable<Evidence> iterator(Evidence.Confidence confidence) {
- 95 332 if (confidence == Evidence.Confidence.HIGHEST) {
- 96 77 return EvidenceCollection.HIGHEST_CONFIDENCE.filter(this .list);
- 97 255 } else if (confidence == Evidence.Confidence.HIGH) {
- 98 77 return EvidenceCollection.HIGH_CONFIDENCE.filter(this .list);
- 99 178 } else if (confidence == Evidence.Confidence.MEDIUM) {
- 100 75 return EvidenceCollection.MEDIUM_CONFIDENCE.filter(this .list);
+ 95 448 if (confidence == Evidence.Confidence.HIGHEST) {
+ 96 109 return EvidenceCollection.HIGHEST_CONFIDENCE.filter(this .list);
+ 97 339 } else if (confidence == Evidence.Confidence.HIGH) {
+ 98 109 return EvidenceCollection.HIGH_CONFIDENCE.filter(this .list);
+ 99 230 } else if (confidence == Evidence.Confidence.MEDIUM) {
+ 100 99 return EvidenceCollection.MEDIUM_CONFIDENCE.filter(this .list);
101
} else {
- 102 103 return EvidenceCollection.LOW_CONFIDENCE.filter(this .list);
+ 102 131 return EvidenceCollection.LOW_CONFIDENCE.filter(this .list);
103
}
104
@@ -237,10 +237,10 @@
116
- 117 140 public EvidenceCollection() {
- 118 140 list = new TreeSet<Evidence>();
- 119 140 weightedStrings = new HashSet<String>();
- 120 140 }
+ 117 164 public EvidenceCollection() {
+ 118 164 list = new TreeSet<Evidence>();
+ 119 164 weightedStrings = new HashSet<String>();
+ 120 164 }
121
122
@@ -255,8 +255,8 @@
127
public void addEvidence(Evidence e) {
- 128 67295 list.add(e);
- 129 67295 }
+ 128 70895 list.add(e);
+ 129 70895 }
130
131
@@ -279,9 +279,9 @@
140
public void addEvidence(String source, String name, String value, Evidence.Confidence confidence) {
- 141 67235 final Evidence e = new Evidence(source, name, value, confidence);
- 142 67235 addEvidence(e);
- 143 67235 }
+ 141 70835 final Evidence e = new Evidence(source, name, value, confidence);
+ 142 70835 addEvidence(e);
+ 143 70835 }
144
145
@@ -316,8 +316,8 @@
160
public void addWeighting(String str) {
- 161 51 weightedStrings.add(str);
- 162 51 }
+ 161 57 weightedStrings.add(str);
+ 162 57 }
163
164
@@ -334,7 +334,7 @@
170
public Set<String> getWeighting() {
- 171 105 return weightedStrings;
+ 171 145 return weightedStrings;
172
}
173
@@ -351,7 +351,7 @@
179
public Set<Evidence> getEvidence() {
- 180 18 return list;
+ 180 30 return list;
181
}
182
@@ -432,7 +432,7 @@
227
public Iterator<Evidence> iterator() {
- 228 1142 return list.iterator();
+ 228 1456 return list.iterator();
229
}
230
@@ -451,23 +451,23 @@
237
public boolean containsUsedString(String text) {
- 238 1127 if (text == null ) {
+ 238 1435 if (text == null ) {
239 0 return false ;
240
}
- 241 1127 final String textToTest = text.toLowerCase();
+ 241 1435 final String textToTest = text.toLowerCase();
242
- 243 1127 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
+ 243 1435 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
244
- 245 5798 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
- 246 5798 if (value.contains(textToTest)) {
- 247 393 return true ;
+ 245 6156 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
+ 246 6156 if (value.contains(textToTest)) {
+ 247 505 return true ;
248
}
- 249 5405 }
- 250 734 return false ;
+ 249 5651 }
+ 250 930 return false ;
251
}
252
@@ -522,14 +522,14 @@
281
public boolean contains(Evidence.Confidence confidence) {
- 282 104 for (Evidence e : list) {
- 283 473 if (e.getConfidence().equals(confidence)) {
- 284 101 return true ;
+ 282 152 for (Evidence e : list) {
+ 283 545 if (e.getConfidence().equals(confidence)) {
+ 284 125 return true ;
285
}
286
}
- 287 3 return false ;
+ 287 27 return false ;
288
}
289
@@ -627,7 +627,7 @@
343
public int size() {
- 344 129 return list.size();
+ 344 165 return list.size();
345
}
346
@@ -666,8 +666,8 @@
363
private String urlCorrection(String value) {
- 364 5798 if (value == null || !UrlStringUtils.containsUrl(value)) {
- 365 5665 return value;
+ 364 6156 if (value == null || !UrlStringUtils.containsUrl(value)) {
+ 365 6023 return value;
366
}
367 133 final StringBuilder sb = new StringBuilder(value.length());
@@ -696,6 +696,6 @@
}
-
+
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 ba0e6aa63..31d0b6c7c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
@@ -65,7 +65,7 @@
24
- 25 94 public class Identifier implements Comparable<Identifier> {
+ 25 128 public class Identifier implements Comparable<Identifier> {
26
27
@@ -82,11 +82,11 @@
33
- 34 194 public Identifier(String type, String value, String url) {
- 35 194 this .type = type;
- 36 194 this .value = value;
- 37 194 this .url = url;
- 38 194 }
+ 34 246 public Identifier(String type, String value, String url) {
+ 35 246 this .type = type;
+ 36 246 this .value = value;
+ 37 246 this .url = url;
+ 38 246 }
39
40
@@ -132,7 +132,7 @@
62
public String getValue() {
- 63 255 return value;
+ 63 366 return value;
64
}
65
@@ -173,7 +173,7 @@
84
public String getUrl() {
- 85 11 return url;
+ 85 9 return url;
86
}
87
@@ -214,7 +214,7 @@
106
public String getType() {
- 107 63 return type;
+ 107 90 return type;
108
}
109
@@ -255,7 +255,7 @@
128
public String getDescription() {
- 129 6 return description;
+ 129 5 return description;
130
}
131
@@ -306,10 +306,10 @@
@Override
160
public int hashCode() {
- 161 19 int hash = 5;
- 162 19 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
- 163 19 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
- 164 19 return hash;
+ 161 37 int hash = 5;
+ 162 37 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
+ 163 37 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
+ 164 37 return hash;
165
}
166
@@ -349,17 +349,17 @@
184
public int compareTo(Identifier o) {
- 185 161 if (o == null ) {
+ 185 211 if (o == null ) {
186 0 return -1;
187
}
- 188 161 return this .value.compareTo(o.value);
+ 188 211 return this .value.compareTo(o.value);
189
}
190
}
-
+
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 d97628966..e1706d0fd 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
@@ -73,7 +73,7 @@
28
- 29 1198 public class Reference implements Serializable, Comparable<Reference> {
+ 29 1569 public class Reference implements Serializable, Comparable<Reference> {
30
31
@@ -106,7 +106,7 @@
45
public String getName() {
- 46 208 return name;
+ 46 202 return name;
47
}
48
@@ -123,8 +123,8 @@
54
public void setName(String name) {
- 55 391 this .name = name;
- 56 391 }
+ 55 491 this .name = name;
+ 56 491 }
57
58
@@ -147,7 +147,7 @@
67
public String getUrl() {
- 68 208 return url;
+ 68 202 return url;
69
}
70
@@ -164,8 +164,8 @@
76
public void setUrl(String url) {
- 77 391 this .url = url;
- 78 391 }
+ 77 491 this .url = url;
+ 78 491 }
79
80
@@ -188,7 +188,7 @@
89
public String getSource() {
- 90 208 return source;
+ 90 202 return source;
91
}
92
@@ -205,8 +205,8 @@
98
public void setSource(String source) {
- 99 391 this .source = source;
- 100 391 }
+ 99 491 this .source = source;
+ 100 491 }
101
102
@@ -266,8 +266,8 @@
138
public int compareTo(Reference o) {
- 139 807 if (source.equals(o.source)) {
- 140 141 if (name.equals(o.name)) {
+ 139 1078 if (source.equals(o.source)) {
+ 140 172 if (name.equals(o.name)) {
141 0 if (url.equals(o.url)) {
142 0 return 0;
143
@@ -277,12 +277,12 @@
}
146
} else {
- 147 141 return name.compareTo(o.name);
+ 147 172 return name.compareTo(o.name);
148
}
149
} else {
- 150 666 return source.compareTo(o.source);
+ 150 906 return source.compareTo(o.source);
151
}
152
@@ -291,6 +291,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 dd69746bf..fe7a4fb27 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
@@ -77,7 +77,7 @@
30
- 31 77 public class Vulnerability implements Serializable, Comparable<Vulnerability> {
+ 31 86 public class Vulnerability implements Serializable, Comparable<Vulnerability> {
32
33
@@ -110,7 +110,7 @@
47
public String getName() {
- 48 192 return name;
+ 48 213 return name;
49
}
50
@@ -127,8 +127,8 @@
56
public void setName(String name) {
- 57 77 this .name = name;
- 58 77 }
+ 57 86 this .name = name;
+ 58 86 }
59
60
@@ -151,7 +151,7 @@
69
public String getDescription() {
- 70 30 return description;
+ 70 29 return description;
71
}
72
@@ -168,15 +168,15 @@
78
public void setDescription(String description) {
- 79 77 this .description = description;
- 80 77 }
+ 79 86 this .description = description;
+ 80 86 }
81
82
83
- 84 77 private SortedSet<Reference> references = new TreeSet<Reference>();
+ 84 86 private SortedSet<Reference> references = new TreeSet<Reference>();
85
86
@@ -191,7 +191,7 @@
91
public Set<Reference> getReferences() {
- 92 30 return references;
+ 92 29 return references;
93
}
94
@@ -244,19 +244,19 @@
120
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
- 121 301 final Reference ref = new Reference();
- 122 301 ref.setSource(referenceSource);
- 123 301 ref.setName(referenceName);
- 124 301 ref.setUrl(referenceUrl);
- 125 301 this .references.add(ref);
- 126 301 }
+ 121 401 final Reference ref = new Reference();
+ 122 401 ref.setSource(referenceSource);
+ 123 401 ref.setName(referenceName);
+ 124 401 ref.setUrl(referenceUrl);
+ 125 401 this .references.add(ref);
+ 126 401 }
127
128
129
- 130 77 private SortedSet<VulnerableSoftware> vulnerableSoftware = new TreeSet<VulnerableSoftware>();
+ 130 86 private SortedSet<VulnerableSoftware> vulnerableSoftware = new TreeSet<VulnerableSoftware>();
131
132
@@ -271,7 +271,7 @@
137
public Set<VulnerableSoftware> getVulnerableSoftware() {
- 138 30 return vulnerableSoftware;
+ 138 29 return vulnerableSoftware;
139
}
140
@@ -306,7 +306,7 @@
156
public boolean addVulnerableSoftware(String cpe) {
- 157 3200 return addVulnerableSoftware(cpe, null );
+ 157 3186 return addVulnerableSoftware(cpe, null );
158
}
159
@@ -329,13 +329,13 @@
168
public boolean addVulnerableSoftware(String cpe, String previousVersion) {
- 169 3237 final VulnerableSoftware vs = new VulnerableSoftware();
- 170 3237 vs.setCpe(cpe);
- 171 3237 if (previousVersion != null ) {
- 172 37 vs.setPreviousVersion(previousVersion);
+ 169 3228 final VulnerableSoftware vs = new VulnerableSoftware();
+ 170 3228 vs.setCpe(cpe);
+ 171 3228 if (previousVersion != null ) {
+ 172 42 vs.setPreviousVersion(previousVersion);
173
}
- 174 3237 return updateVulnerableSoftware(vs);
+ 174 3228 return updateVulnerableSoftware(vs);
175
}
176
@@ -354,11 +354,11 @@
183
public boolean updateVulnerableSoftware(VulnerableSoftware vulnSoftware) {
- 184 3237 if (vulnerableSoftware.contains(vulnSoftware)) {
+ 184 3228 if (vulnerableSoftware.contains(vulnSoftware)) {
185 0 vulnerableSoftware.remove(vulnSoftware);
186
}
- 187 3237 return vulnerableSoftware.add(vulnSoftware);
+ 187 3228 return vulnerableSoftware.add(vulnSoftware);
188
}
189
@@ -383,7 +383,7 @@
199
public String getCwe() {
- 200 58 return cwe;
+ 200 56 return cwe;
201
}
202
@@ -400,8 +400,8 @@
208
public void setCwe(String cwe) {
- 209 69 this .cwe = cwe;
- 210 69 }
+ 209 78 this .cwe = cwe;
+ 210 78 }
211
212
@@ -424,7 +424,7 @@
221
public float getCvssScore() {
- 222 89 return cvssScore;
+ 222 86 return cvssScore;
223
}
224
@@ -441,8 +441,8 @@
230
public void setCvssScore(float cvssScore) {
- 231 76 this .cvssScore = cvssScore;
- 232 76 }
+ 231 85 this .cvssScore = cvssScore;
+ 232 85 }
233
234
@@ -482,8 +482,8 @@
252
public void setCvssAccessVector(String cvssAccessVector) {
- 253 76 this .cvssAccessVector = cvssAccessVector;
- 254 76 }
+ 253 85 this .cvssAccessVector = cvssAccessVector;
+ 254 85 }
255
256
@@ -523,8 +523,8 @@
274
public void setCvssAccessComplexity(String cvssAccessComplexity) {
- 275 76 this .cvssAccessComplexity = cvssAccessComplexity;
- 276 76 }
+ 275 85 this .cvssAccessComplexity = cvssAccessComplexity;
+ 276 85 }
277
278
@@ -564,8 +564,8 @@
296
public void setCvssAuthentication(String cvssAuthentication) {
- 297 76 this .cvssAuthentication = cvssAuthentication;
- 298 76 }
+ 297 85 this .cvssAuthentication = cvssAuthentication;
+ 298 85 }
299
300
@@ -605,8 +605,8 @@
318
public void setCvssConfidentialityImpact(String cvssConfidentialityImpact) {
- 319 76 this .cvssConfidentialityImpact = cvssConfidentialityImpact;
- 320 76 }
+ 319 85 this .cvssConfidentialityImpact = cvssConfidentialityImpact;
+ 320 85 }
321
322
@@ -646,8 +646,8 @@
340
public void setCvssIntegrityImpact(String cvssIntegrityImpact) {
- 341 76 this .cvssIntegrityImpact = cvssIntegrityImpact;
- 342 76 }
+ 341 85 this .cvssIntegrityImpact = cvssIntegrityImpact;
+ 342 85 }
343
344
@@ -687,8 +687,8 @@
362
public void setCvssAvailabilityImpact(String cvssAvailabilityImpact) {
- 363 76 this .cvssAvailabilityImpact = cvssAvailabilityImpact;
- 364 76 }
+ 363 85 this .cvssAvailabilityImpact = cvssAvailabilityImpact;
+ 364 85 }
365
366
@@ -747,6 +747,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 c617f1812..add92eb72 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
@@ -73,7 +73,7 @@
28
- 29 126 public class VulnerabilityComparator implements Comparator<Vulnerability>, Serializable {
+ 29 145 public class VulnerabilityComparator implements Comparator<Vulnerability>, Serializable {
30
31
@@ -102,13 +102,13 @@
43
public int compare(Vulnerability o1, Vulnerability o2) {
- 44 81 return o2.getName().compareTo(o1.getName());
+ 44 92 return o2.getName().compareTo(o1.getName());
45
}
46
}
-
+
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 69dc34624..c3743e5e3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
@@ -83,7 +83,7 @@
33
- 34 59027 public class VulnerableSoftware extends IndexEntry implements Serializable, Comparable<VulnerableSoftware> {
+ 34 61009 public class VulnerableSoftware extends IndexEntry implements Serializable, Comparable<VulnerableSoftware> {
35
36
@@ -110,14 +110,14 @@
public void setCpe(String cpe) {
47
try {
- 48 6904 parseName(cpe);
+ 48 7616 parseName(cpe);
49 0 } catch (UnsupportedEncodingException ex) {
50 0 final String msg = String.format("Character encoding is unsupported for CPE '%s'." , cpe);
51 0 Logger.getLogger(VulnerableSoftware.class .getName()).log(Level.WARNING, msg);
52 0 Logger.getLogger(VulnerableSoftware.class .getName()).log(Level.FINE, null , ex);
53 0 setName(cpe);
- 54 6904 }
- 55 6904 }
+ 54 7616 }
+ 55 7616 }
56
57
@@ -148,18 +148,18 @@
@Override
70
public void parseName(String cpeName) throws UnsupportedEncodingException {
- 71 8917 this .name = cpeName;
- 72 8917 if (cpeName != null && cpeName.length() > 7) {
- 73 8917 final String[] data = cpeName.substring(7).split(":" );
- 74 8917 if (data.length >= 1) {
- 75 8917 this .setVendor(URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" ));
- 76 8917 if (data.length >= 2) {
- 77 8917 this .setProduct(URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" ));
- 78 8917 if (data.length >= 3) {
- 79 8901 version = URLDecoder.decode(data[2].replace("+" , "%2B" ), "UTF-8" );
- 80 8901 if (data.length >= 4) {
- 81 2356 revision = URLDecoder.decode(data[3].replace("+" , "%2B" ), "UTF-8" );
- 82 2356 if (data.length >= 5) {
+ 71 11151 this .name = cpeName;
+ 72 11151 if (cpeName != null && cpeName.length() > 7) {
+ 73 11151 final String[] data = cpeName.substring(7).split(":" );
+ 74 11151 if (data.length >= 1) {
+ 75 11151 this .setVendor(URLDecoder.decode(data[0].replace("+" , "%2B" ), "UTF-8" ));
+ 76 11151 if (data.length >= 2) {
+ 77 11151 this .setProduct(URLDecoder.decode(data[1].replace("+" , "%2B" ), "UTF-8" ));
+ 78 11151 if (data.length >= 3) {
+ 79 11123 version = URLDecoder.decode(data[2].replace("+" , "%2B" ), "UTF-8" );
+ 80 11123 if (data.length >= 4) {
+ 81 2318 revision = URLDecoder.decode(data[3].replace("+" , "%2B" ), "UTF-8" );
+ 82 2318 if (data.length >= 5) {
83 1 edition = URLDecoder.decode(data[4].replace("+" , "%2B" ), "UTF-8" );
84
}
@@ -173,7 +173,7 @@
}
89
}
- 90 8917 }
+ 90 11151 }
91
92
@@ -196,7 +196,7 @@
101
public boolean hasPreviousVersion() {
- 102 1924 return previousVersion != null ;
+ 102 1895 return previousVersion != null ;
103
}
104
@@ -230,8 +230,8 @@
119
public void setPreviousVersion(String previousVersion) {
- 120 38 this .previousVersion = previousVersion;
- 121 38 }
+ 120 43 this .previousVersion = previousVersion;
+ 121 43 }
122
123
@@ -284,9 +284,9 @@
@Override
151
public int hashCode() {
- 152 3662 int hash = 7;
- 153 3662 hash = 83 * hash + (this .getName() != null ? this .getName().hashCode() : 0);
- 154 3662 return hash;
+ 152 4383 int hash = 7;
+ 153 4383 hash = 83 * hash + (this .getName() != null ? this .getName().hashCode() : 0);
+ 154 4383 return hash;
155
}
156
@@ -328,23 +328,23 @@
@Override
175
public int compareTo(VulnerableSoftware vs) {
- 176 50111 int result = 0;
- 177 50111 final String[] left = this .getName().split(":" );
- 178 50111 final String[] right = vs.getName().split(":" );
- 179 50111 final int max = (left.length <= right.length) ? left.length : right.length;
- 180 50111 if (max > 0) {
- 181 302866 for (int i = 0; result == 0 && i < max; i++) {
- 182 252755 final String[] subLeft = left[i].split("\\." );
- 183 252755 final String[] subRight = right[i].split("\\." );
- 184 252755 final int subMax = (subLeft.length <= subRight.length) ? subLeft.length : subRight.length;
- 185 252755 if (subMax > 0) {
- 186 567549 for (int x = 0; result == 0 && x < subMax; x++) {
- 187 314794 if (isPositiveInteger(subLeft[x]) && isPositiveInteger(subRight[x])) {
- 188 109094 final int iLeft = Integer.parseInt(subLeft[x]);
- 189 109094 final int iRight = Integer.parseInt(subRight[x]);
- 190 109094 if (iLeft != iRight) {
- 191 42544 if (iLeft > iRight) {
- 192 39084 result = 2;
+ 176 49859 int result = 0;
+ 177 49859 final String[] left = this .getName().split(":" );
+ 178 49859 final String[] right = vs.getName().split(":" );
+ 179 49859 final int max = (left.length <= right.length) ? left.length : right.length;
+ 180 49859 if (max > 0) {
+ 181 301368 for (int i = 0; result == 0 && i < max; i++) {
+ 182 251509 final String[] subLeft = left[i].split("\\." );
+ 183 251509 final String[] subRight = right[i].split("\\." );
+ 184 251509 final int subMax = (subLeft.length <= subRight.length) ? subLeft.length : subRight.length;
+ 185 251509 if (subMax > 0) {
+ 186 564931 for (int x = 0; result == 0 && x < subMax; x++) {
+ 187 313422 if (isPositiveInteger(subLeft[x]) && isPositiveInteger(subRight[x])) {
+ 188 108826 final int iLeft = Integer.parseInt(subLeft[x]);
+ 189 108826 final int iRight = Integer.parseInt(subRight[x]);
+ 190 108826 if (iLeft != iRight) {
+ 191 42480 if (iLeft > iRight) {
+ 192 39020 result = 2;
193
} else {
194 3460 result = -2;
@@ -352,18 +352,18 @@
}
196
}
- 197 109094 } else {
- 198 205700 result = subLeft[x].compareToIgnoreCase(subRight[x]);
+ 197 108826 } else {
+ 198 204596 result = subLeft[x].compareToIgnoreCase(subRight[x]);
199
}
200
}
- 201 252755 if (result == 0) {
- 202 204705 if (subLeft.length > subRight.length) {
- 203 1440 result = 2;
+ 201 251509 if (result == 0) {
+ 202 203675 if (subLeft.length > subRight.length) {
+ 203 1430 result = 2;
204
}
- 205 204705 if (subRight.length > subLeft.length) {
+ 205 203675 if (subRight.length > subLeft.length) {
206 7 result = -2;
207
}
@@ -376,12 +376,12 @@
}
212
}
- 213 50111 if (result == 0) {
- 214 614 if (left.length > right.length) {
- 215 604 result = 2;
+ 213 49859 if (result == 0) {
+ 214 588 if (left.length > right.length) {
+ 215 578 result = 2;
216
}
- 217 614 if (right.length > left.length) {
+ 217 588 if (right.length > left.length) {
218 10 result = -2;
219
}
@@ -392,7 +392,7 @@
222 0 result = this .getName().compareToIgnoreCase(vs.getName());
223
}
- 224 50111 return result;
+ 224 49859 return result;
225
}
226
@@ -411,19 +411,19 @@
233
private static boolean isPositiveInteger(final String str) {
- 234 424020 if (str == null || str.isEmpty()) {
+ 234 422342 if (str == null || str.isEmpty()) {
235 12 return false ;
236
}
- 237 659456 for (int i = 0; i < str.length(); i++) {
- 238 441136 final char c = str.charAt(i);
- 239 441136 if (c < '0' || c > '9' ) {
- 240 205688 return false ;
+ 237 657204 for (int i = 0; i < str.length(); i++) {
+ 238 439458 final char c = str.charAt(i);
+ 239 439458 if (c < '0' || c > '9' ) {
+ 240 204584 return false ;
241
}
242
}
- 243 218320 return true ;
+ 243 217746 return true ;
244
}
245
@@ -448,7 +448,7 @@
255
public String getName() {
- 256 109747 return name;
+ 256 110720 return name;
257
}
258
@@ -489,7 +489,7 @@
277
public String getVersion() {
- 278 14153 return version;
+ 278 19587 return version;
279
}
280
@@ -530,7 +530,7 @@
299
public String getRevision() {
- 300 16805 return revision;
+ 300 19171 return revision;
301
}
302
@@ -594,6 +594,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 1a59d35f6..720a9214b 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
@@ -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 5024ac748..f32c33c8b 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
@@ -393,6 +393,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 71584e09f..3f42df27c 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
@@ -226,6 +226,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 9f30389f6..46f6ed79e 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
@@ -334,6 +334,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 f5543d752..c0903cd28 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
@@ -226,6 +226,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 69604ea0a..0963ab698 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
@@ -1586,6 +1586,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 683234a96..fcc331bc4 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
@@ -1115,6 +1115,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 ac9535756..e22bea85b 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
@@ -417,6 +417,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 396da1640..2a885ef91 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
@@ -847,6 +847,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 05d4c4c82..5851539fc 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
@@ -753,6 +753,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 bceed6b38..77174b8af 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
@@ -311,6 +311,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 008b2b37e..38abac946 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
@@ -393,6 +393,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 446c54336..83141a378 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
@@ -898,6 +898,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 752d6bfd9..380f841a4 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
@@ -446,6 +446,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 a5d77c084..8111cdfe1 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
@@ -218,6 +218,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 8c8819de3..74f363f01 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
@@ -273,6 +273,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 22f1f3e94..a6a67a9a1 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
@@ -222,6 +222,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 1b791b705..3d4a27afe 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
@@ -336,6 +336,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 25b9cd242..1625b5435 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
@@ -588,6 +588,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 7a149cc2f..b3e2b0397 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
@@ -3330,6 +3330,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 1b161cb73..5db6569b0 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
@@ -659,6 +659,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 8d6893eed..f74b22506 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
@@ -1394,6 +1394,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 e480b7045..e1aa3d2a0 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
@@ -218,6 +218,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 f2f2edb4a..ec8952d2e 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
@@ -332,6 +332,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 fbbffa07b..24bd1adb5 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
@@ -1184,6 +1184,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 6789fb47c..8274cbcb3 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
@@ -678,6 +678,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 d1490d596..0dae3f09f 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
@@ -311,6 +311,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 625d77cbb..914074b30 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
@@ -167,6 +167,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 241c15276..8de0457c6 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
@@ -1629,6 +1629,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 0ca7dc489..e286ec354 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
@@ -330,6 +330,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 aea7de1f4..57bb32623 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
@@ -733,6 +733,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 c32108cd8..28aba3a82 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
@@ -623,6 +623,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 0bf1df314..408b239a9 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
@@ -421,6 +421,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 133c24f2f..0cd57a88a 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
@@ -446,6 +446,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 afbb10da7..706955dbd 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
@@ -277,6 +277,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 01ded28c3..f4abaae10 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
@@ -678,6 +678,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 c19173b3d..f816b8bb1 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
@@ -332,6 +332,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 29e2f8e25..e9c672d11 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
@@ -277,6 +277,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 01b8b1acb..dc250beb3 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 5b8a329a5..b8914ea50 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
@@ -437,6 +437,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
index 522cc2bd8..1a5242892 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
@@ -221,6 +221,6 @@
}
-
+
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 7bc7a24da..83b220801 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Checksum.html
@@ -88,36 +88,36 @@
36
public static byte [] getChecksum(String algorithm, File file) throws NoSuchAlgorithmException, IOException {
- 37 59 InputStream fis = null ;
- 38 59 byte [] buffer = new byte [1024];
- 39 59 MessageDigest complete = MessageDigest.getInstance(algorithm);
+ 37 75 InputStream fis = null ;
+ 38 75 byte [] buffer = new byte [1024];
+ 39 75 MessageDigest complete = MessageDigest.getInstance(algorithm);
40
int numRead;
41
try {
- 42 58 fis = new FileInputStream(file);
+ 42 74 fis = new FileInputStream(file);
43
do {
- 44 30964 numRead = fis.read(buffer);
- 45 30964 if (numRead > 0) {
- 46 30907 complete.update(buffer, 0, numRead);
+ 44 39350 numRead = fis.read(buffer);
+ 45 39350 if (numRead > 0) {
+ 46 39277 complete.update(buffer, 0, numRead);
47
}
- 48 30964 } while (numRead != -1);
+ 48 39350 } while (numRead != -1);
49
} finally {
- 50 58 if (fis != null ) {
+ 50 74 if (fis != null ) {
51
try {
- 52 57 fis.close();
+ 52 73 fis.close();
53 0 } catch (IOException ex) {
54 0 Logger.getLogger(Checksum.class .getName()).log(Level.FINEST, "Error closing file '" + file.getName() + "'." , ex);
- 55 58 }
+ 55 74 }
56
}
57
}
- 58 57 return complete.digest();
+ 58 73 return complete.digest();
59
}
60
@@ -140,8 +140,8 @@
69
public static String getMD5Checksum(File file) throws IOException, NoSuchAlgorithmException {
- 70 28 byte [] b = getChecksum("MD5" , file);
- 71 28 return getHex(b);
+ 70 36 byte [] b = getChecksum("MD5" , file);
+ 71 36 return getHex(b);
72
}
73
@@ -164,8 +164,8 @@
82
public static String getSHA1Checksum(File file) throws IOException, NoSuchAlgorithmException {
- 83 28 byte [] b = getChecksum("SHA1" , file);
- 84 28 return getHex(b);
+ 83 36 byte [] b = getChecksum("SHA1" , file);
+ 84 36 return getHex(b);
85
}
86
@@ -192,22 +192,22 @@
97
public static String getHex(byte [] raw) {
- 98 57 if (raw == null ) {
+ 98 73 if (raw == null ) {
99 0 return null ;
100
}
- 101 57 final StringBuilder hex = new StringBuilder(2 * raw.length);
- 102 1082 for (final byte b : raw) {
- 103 1025 hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
+ 101 73 final StringBuilder hex = new StringBuilder(2 * raw.length);
+ 102 1386 for (final byte b : raw) {
+ 103 1313 hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
104
}
- 105 57 return hex.toString();
+ 105 73 return hex.toString();
106
}
107
}
-
+
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 523a08446..8b624b683 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
@@ -106,8 +106,8 @@
45
- 46 16 public DependencyVersion() {
- 47 16 }
+ 46 20 public DependencyVersion() {
+ 47 20 }
48
49
@@ -126,9 +126,9 @@
56
- 57 10386 public DependencyVersion(String version) {
- 58 10386 parseVersion(version);
- 59 10386 }
+ 57 12808 public DependencyVersion(String version) {
+ 58 12808 parseVersion(version);
+ 59 12808 }
60
61
@@ -147,21 +147,21 @@
68
public final void parseVersion(String version) {
- 69 10388 versionParts = new ArrayList<String>();
- 70 10388 if (version != null ) {
- 71 10388 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
- 72 10388 final Matcher matcher = rx.matcher(version.toLowerCase());
- 73 42686 while (matcher.find()) {
- 74 32298 versionParts.add(matcher.group());
+ 69 12810 versionParts = new ArrayList<String>();
+ 70 12810 if (version != null ) {
+ 71 12810 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
+ 72 12810 final Matcher matcher = rx.matcher(version.toLowerCase());
+ 73 52728 while (matcher.find()) {
+ 74 39918 versionParts.add(matcher.group());
75
}
- 76 10388 if (versionParts.isEmpty()) {
- 77 55 versionParts.add(version);
+ 76 12810 if (versionParts.isEmpty()) {
+ 77 77 versionParts.add(version);
78
}
79
}
- 80 10388 }
+ 80 12810 }
81
82
@@ -184,7 +184,7 @@
91
public List<String> getVersionParts() {
- 92 16338 return versionParts;
+ 92 18190 return versionParts;
93
}
94
@@ -201,8 +201,8 @@
100
public void setVersionParts(List<String> versionParts) {
- 101 15 this .versionParts = versionParts;
- 102 15 }
+ 101 19 this .versionParts = versionParts;
+ 102 19 }
103
104
@@ -236,7 +236,7 @@
@Override
119
public String toString() {
- 120 2056 return StringUtils.join(versionParts.toArray(), "." );
+ 120 3681 return StringUtils.join(versionParts.toArray(), "." );
121
}
122
@@ -257,33 +257,33 @@
@Override
130
public boolean equals(Object obj) {
- 131 10155 if (obj == null ) {
+ 131 12444 if (obj == null ) {
132 0 return false ;
133
}
- 134 10155 if (getClass() != obj.getClass()) {
+ 134 12444 if (getClass() != obj.getClass()) {
135 0 return false ;
136
}
- 137 10155 final DependencyVersion other = (DependencyVersion) obj;
- 138 10155 final int max = (this .versionParts.size() < other.versionParts.size())
+ 137 12444 final DependencyVersion other = (DependencyVersion) obj;
+ 138 12444 final int max = (this .versionParts.size() < other.versionParts.size())
139
? this .versionParts.size() : other.versionParts.size();
140
- 141 16396 for (int i = 0; i < max; i++) {
- 142 15726 final String thisPart = this .versionParts.get(i);
- 143 15726 final String otherPart = other.versionParts.get(i);
- 144 15726 if (!thisPart.equals(otherPart)) {
- 145 9485 return false ;
+ 141 18863 for (int i = 0; i < max; i++) {
+ 142 18174 final String thisPart = this .versionParts.get(i);
+ 143 18174 final String otherPart = other.versionParts.get(i);
+ 144 18174 if (!thisPart.equals(otherPart)) {
+ 145 11755 return false ;
146
}
147
}
- 148 670 if (this .versionParts.size() > max) {
- 149 88 for (int i = max; i < this .versionParts.size(); i++) {
- 150 88 if (!"0" .equals(this .versionParts.get(i))) {
- 151 88 return false ;
+ 148 689 if (this .versionParts.size() > max) {
+ 149 86 for (int i = max; i < this .versionParts.size(); i++) {
+ 150 86 if (!"0" .equals(this .versionParts.get(i))) {
+ 151 86 return false ;
152
}
153
@@ -292,7 +292,7 @@
}
155
- 156 582 if (other.versionParts.size() > max) {
+ 156 603 if (other.versionParts.size() > max) {
157 463 for (int i = max; i < other.versionParts.size(); i++) {
158 447 if (!"0" .equals(other.versionParts.get(i))) {
159 415 return false ;
@@ -314,7 +314,7 @@
168
- 169 167 return true ;
+ 169 188 return true ;
170
}
171
@@ -358,35 +358,35 @@
192
public boolean matchesAtLeastThreeLevels(DependencyVersion version) {
- 193 7507 if (version == null ) {
+ 193 8335 if (version == null ) {
194 0 return false ;
195
}
196
- 197 7507 boolean ret = true ;
- 198 7507 int max = (this .versionParts.size() < version.versionParts.size())
+ 197 8335 boolean ret = true ;
+ 198 8335 int max = (this .versionParts.size() < version.versionParts.size())
199
? this .versionParts.size() : version.versionParts.size();
200
- 201 7507 if (max > 3) {
+ 201 8335 if (max > 3) {
202 2 max = 3;
203
}
204
- 205 11690 for (int i = 0; i < max; i++) {
- 206 11276 if (this .versionParts.get(i) == null || !this .versionParts.get(i).equals(version.versionParts.get(i))) {
- 207 7093 ret = false ;
- 208 7093 break ;
+ 205 12626 for (int i = 0; i < max; i++) {
+ 206 12212 if (this .versionParts.get(i) == null || !this .versionParts.get(i).equals(version.versionParts.get(i))) {
+ 207 7921 ret = false ;
+ 208 7921 break ;
209
}
210
}
211
- 212 7507 return ret;
+ 212 8335 return ret;
213
}
214
@@ -395,28 +395,28 @@
@Override
216
public int compareTo(DependencyVersion version) {
- 217 28 if (version == null ) {
+ 217 54 if (version == null ) {
218 0 return 1;
219
}
- 220 28 final List<String> left = this .getVersionParts();
- 221 28 final List<String> right = version.getVersionParts();
- 222 28 final int max = left.size() < right.size() ? left.size() : right.size();
+ 220 54 final List<String> left = this .getVersionParts();
+ 221 54 final List<String> right = version.getVersionParts();
+ 222 54 final int max = left.size() < right.size() ? left.size() : right.size();
223
- 224 54 for (int i = 0; i < max; i++) {
- 225 47 final String lStr = left.get(i);
- 226 47 final String rStr = right.get(i);
- 227 47 if (lStr.equals(rStr)) {
- 228 26 continue ;
+ 224 88 for (int i = 0; i < max; i++) {
+ 225 81 final String lStr = left.get(i);
+ 226 81 final String rStr = right.get(i);
+ 227 81 if (lStr.equals(rStr)) {
+ 228 34 continue ;
229
}
230
try {
- 231 21 final int l = Integer.parseInt(lStr);
- 232 20 final int r = Integer.parseInt(rStr);
- 233 15 if (l < r) {
- 234 6 return -1;
+ 231 47 final int l = Integer.parseInt(lStr);
+ 232 46 final int r = Integer.parseInt(rStr);
+ 233 41 if (l < r) {
+ 234 32 return -1;
235 9 } else if (l > r) {
236 9 return 1;
237
@@ -447,6 +447,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 2315c6875..d9f142fd0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
@@ -133,56 +133,56 @@
60
public static DependencyVersion parseVersion(String text) {
- 61 10348 if (text == null ) {
- 62 24 return null ;
+ 61 12774 if (text == null ) {
+ 62 40 return null ;
63
}
64
- 65 10324 if ("-" .equals(text)) {
- 66 15 final DependencyVersion dv = new DependencyVersion();
- 67 15 final ArrayList<String> list = new ArrayList<String>();
- 68 15 list.add(text);
- 69 15 dv.setVersionParts(list);
- 70 15 return dv;
+ 65 12734 if ("-" .equals(text)) {
+ 66 19 final DependencyVersion dv = new DependencyVersion();
+ 67 19 final ArrayList<String> list = new ArrayList<String>();
+ 68 19 list.add(text);
+ 69 19 dv.setVersionParts(list);
+ 70 19 return dv;
71
}
- 72 10309 String version = null ;
- 73 10309 Matcher matcher = RX_VERSION.matcher(text);
- 74 10309 if (matcher.find()) {
- 75 10193 version = matcher.group();
+ 72 12715 String version = null ;
+ 73 12715 Matcher matcher = RX_VERSION.matcher(text);
+ 74 12715 if (matcher.find()) {
+ 75 12599 version = matcher.group();
76
}
77
- 78 10309 if (matcher.find()) {
+ 78 12715 if (matcher.find()) {
79 2 return null ;
80
}
- 81 10307 if (version == null ) {
+ 81 12713 if (version == null ) {
82 116 matcher = RX_SINGLE_VERSION.matcher(text);
83 116 if (matcher.find()) {
- 84 112 version = matcher.group();
+ 84 106 version = matcher.group();
85
} else {
- 86 4 return null ;
+ 86 10 return null ;
87
}
88
- 89 112 if (matcher.find()) {
+ 89 106 if (matcher.find()) {
90 1 return null ;
91
}
92
}
- 93 10302 return new DependencyVersion(version);
+ 93 12702 return new DependencyVersion(version);
94
}
95
}
-
+
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 daf93da57..c39674a6a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
@@ -149,6 +149,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 8a7bf2671..6564742c0 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,8 @@
@@ -68,292 +69,320 @@
25
import java.io.InputStream;
26
- import java.net.HttpURLConnection;
+ import java.net.Authenticator;
27
- import java.net.InetSocketAddress;
+ import java.net.HttpURLConnection;
28
- import java.net.Proxy;
+ import java.net.InetSocketAddress;
29
- import java.net.SocketAddress;
+ import java.net.PasswordAuthentication;
30
- import java.net.URISyntaxException;
+ import java.net.Proxy;
31
- import java.net.URL;
+ import java.net.SocketAddress;
32
- import java.util.logging.Level;
+ import java.net.URISyntaxException;
33
- import java.util.logging.Logger;
+ import java.net.URL;
34
- import java.util.zip.GZIPInputStream;
+ import java.util.logging.Level;
35
- import java.util.zip.InflaterInputStream;
+ import java.util.logging.Logger;
36
-
+ import java.util.zip.GZIPInputStream;
37
-
+ import java.util.zip.InflaterInputStream;
38
-
+
39
-
+
40
-
+
41
-
+
42
- public final class Downloader {
+
43
-
+
44
-
+ public final class Downloader {
45
-
+
46
-
- 47 0 private Downloader() {
- 48 0 }
- 49
-
- 50
+ 47
+
+ 48
+
+ 49 0 private Downloader() {
+ 50 0 }
51
-
+
52
-
+
53
-
+
54
-
+
55
-
+
56
-
+
57
-
+
58
- public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
- 59 0 HttpURLConnection conn = null ;
+
+ 59
+
60
+ public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
+ 61 0 HttpURLConnection conn = null ;
+ 62
try {
- 61 0 conn = Downloader.getConnection(url);
- 62 0 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
- 63 0 conn.connect();
- 64 0 } catch (IOException ex) {
- 65
+ 63 0 conn = Downloader.getConnection(url);
+ 64 0 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
+ 65 0 conn.connect();
+ 66 0 } catch (IOException ex) {
+ 67
try {
- 66 0 if (conn != null ) {
- 67 0 conn.disconnect();
- 68
+ 68 0 if (conn != null ) {
+ 69 0 conn.disconnect();
+ 70
}
- 69
+ 71
} finally {
- 70 0 conn = null ;
- 71 0 }
- 72 0 throw new DownloadFailedException("Error downloading file." , ex);
- 73 0 }
- 74 0 final String encoding = conn.getContentEncoding();
- 75
+ 72 0 conn = null ;
+ 73 0 }
+ 74 0 throw new DownloadFailedException("Error downloading file." , ex);
+ 75 0 }
+ 76 0 final String encoding = conn.getContentEncoding();
+ 77
- 76 0 BufferedOutputStream writer = null ;
- 77 0 InputStream reader = null ;
- 78
+ 78 0 BufferedOutputStream writer = null ;
+ 79 0 InputStream reader = null ;
+ 80
try {
- 79 0 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
- 80 0 reader = new GZIPInputStream(conn.getInputStream());
- 81 0 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
- 82 0 reader = new InflaterInputStream(conn.getInputStream());
- 83
- } else {
- 84 0 reader = conn.getInputStream();
+ 81 0 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
+ 82 0 reader = new GZIPInputStream(conn.getInputStream());
+ 83 0 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
+ 84 0 reader = new InflaterInputStream(conn.getInputStream());
85
+ } else {
+ 86 0 reader = conn.getInputStream();
+ 87
}
- 86
+ 88
- 87 0 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
- 88 0 final byte [] buffer = new byte [4096];
- 89
+ 89 0 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
+ 90 0 final byte [] buffer = new byte [4096];
+ 91
int bytesRead;
- 90 0 while ((bytesRead = reader.read(buffer)) > 0) {
- 91 0 writer.write(buffer, 0, bytesRead);
- 92
+ 92 0 while ((bytesRead = reader.read(buffer)) > 0) {
+ 93 0 writer.write(buffer, 0, bytesRead);
+ 94
}
- 93 0 } catch (Exception ex) {
- 94 0 throw new DownloadFailedException("Error saving downloaded file." , ex);
- 95
- } finally {
- 96 0 if (writer != null ) {
+ 95 0 } catch (Exception ex) {
+ 96 0 throw new DownloadFailedException("Error saving downloaded file." , ex);
97
+ } finally {
+ 98 0 if (writer != null ) {
+ 99
try {
- 98 0 writer.close();
- 99 0 } catch (Exception ex) {
- 100 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
- 101
- "Error closing the writer in Downloader." , ex);
- 102 0 }
+ 100 0 writer.close();
+ 101 0 } catch (Exception ex) {
+ 102 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
103
- }
- 104 0 if (reader != null ) {
+ "Error closing the writer in Downloader." , ex);
+ 104 0 }
105
+ }
+ 106 0 if (reader != null ) {
+ 107
try {
- 106 0 reader.close();
- 107 0 } catch (Exception ex) {
- 108 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
- 109
- "Error closing the reader in Downloader." , ex);
- 110 0 }
+ 108 0 reader.close();
+ 109 0 } catch (Exception ex) {
+ 110 0 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
111
+ "Error closing the reader in Downloader." , ex);
+ 112 0 }
+ 113
}
- 112
- try {
- 113 0 conn.disconnect();
114
+ try {
+ 115 0 conn.disconnect();
+ 116
} finally {
- 115 0 conn = null ;
- 116 0 }
- 117 0 }
- 118 0 }
- 119
-
- 120
-
+ 117 0 conn = null ;
+ 118 0 }
+ 119 0 }
+ 120 0 }
121
-
- 122
-
- 123
-
- 124
-
- 125
-
- 126
-
- 127
-
- 128
-
- 129
-
- 130
- public static long getLastModified(URL url) throws DownloadFailedException {
- 131 14 long timestamp = 0;
- 132
-
- 133 14 if ("file" .equalsIgnoreCase(url.getProtocol())) {
- 134
- File lastModifiedFile;
- 135
- try {
- 136
-
- 137
-
- 138
-
- 139
-
- 140
-
- 141
-
- 142
-
- 143
-
- 144 14 lastModifiedFile = new File(url.toURI());
- 145
-
- 146 0 } catch (URISyntaxException ex) {
- 147 0 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
- 148 0 throw new DownloadFailedException(msg);
- 149 14 }
- 150 14 timestamp = lastModifiedFile.lastModified();
- 151 14 } else {
- 152 0 HttpURLConnection conn = null ;
- 153
- try {
- 154 0 conn = Downloader.getConnection(url);
- 155 0 conn.setRequestMethod("HEAD" );
- 156 0 conn.connect();
- 157 0 timestamp = conn.getLastModified();
- 158 0 } catch (Exception ex) {
- 159 0 throw new DownloadFailedException("Error making HTTP HEAD request." , ex);
- 160
- } finally {
- 161 0 if (conn != null ) {
- 162
- try {
- 163 0 conn.disconnect();
- 164
- } finally {
- 165 0 conn = null ;
- 166 0 }
- 167
- }
- 168
- }
- 169
- }
- 170 14 return timestamp;
- 171
- }
- 172
- 173
+ 122
- 174
-
- 175
-
- 176
-
- 177
+ 123
+
+ 124
+
+ 125
+
+ 126
- 178
-
- 179
-
- 180
-
- 181
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
- 182
- private static HttpURLConnection getConnection(URL url) throws DownloadFailedException {
- 183 0 HttpURLConnection conn = null ;
- 184 0 Proxy proxy = null ;
- 185 0 final String proxyUrl = Settings.getString(Settings.KEYS.PROXY_URL);
- 186
- try {
- 187 0 if (proxyUrl != null ) {
- 188 0 final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
- 189 0 final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
- 190 0 proxy = new Proxy(Proxy.Type.HTTP, addr);
- 191 0 conn = (HttpURLConnection) url.openConnection(proxy);
- 192 0 } else {
- 193 0 conn = (HttpURLConnection) url.openConnection();
- 194
+ 132
+ public static long getLastModified(URL url) throws DownloadFailedException {
+ 133 14 long timestamp = 0;
+ 134
+
+ 135 14 if ("file" .equalsIgnoreCase(url.getProtocol())) {
+ 136
+ File lastModifiedFile;
+ 137
+ try {
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146 14 lastModifiedFile = new File(url.toURI());
+ 147
+
+ 148 0 } catch (URISyntaxException ex) {
+ 149 0 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
+ 150 0 throw new DownloadFailedException(msg);
+ 151 14 }
+ 152 14 timestamp = lastModifiedFile.lastModified();
+ 153 14 } else {
+ 154 0 HttpURLConnection conn = null ;
+ 155
+ try {
+ 156 0 conn = Downloader.getConnection(url);
+ 157 0 conn.setRequestMethod("HEAD" );
+ 158 0 conn.connect();
+ 159 0 timestamp = conn.getLastModified();
+ 160 0 } catch (Exception ex) {
+ 161 0 throw new DownloadFailedException("Error making HTTP HEAD request." , ex);
+ 162
+ } finally {
+ 163 0 if (conn != null ) {
+ 164
+ try {
+ 165 0 conn.disconnect();
+ 166
+ } finally {
+ 167 0 conn = null ;
+ 168 0 }
+ 169
+ }
+ 170
}
- 195 0 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
- 196 0 conn.setConnectTimeout(timeout);
- 197 0 } catch (IOException ex) {
- 198 0 if (conn != null ) {
- 199
- try {
- 200 0 conn.disconnect();
- 201
- } finally {
- 202 0 conn = null ;
- 203 0 }
- 204
- }
- 205 0 throw new DownloadFailedException("Error getting connection." , ex);
- 206 0 }
- 207 0 return conn;
- 208
+ 171
+ }
+ 172 14 return timestamp;
+ 173
}
- 209
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+ private static HttpURLConnection getConnection(URL url) throws DownloadFailedException {
+ 185 0 HttpURLConnection conn = null ;
+ 186 0 Proxy proxy = null ;
+ 187 0 final String proxyUrl = Settings.getString(Settings.KEYS.PROXY_URL);
+ 188
+ try {
+ 189 0 if (proxyUrl != null ) {
+ 190 0 final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
+ 191 0 final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
+ 192
+
+ 193 0 final String username = Settings.getString(Settings.KEYS.PROXY_USERNAME);
+ 194 0 final String password = Settings.getString(Settings.KEYS.PROXY_PASSWORD);
+ 195 0 if (username != null && password != null ) {
+ 196 0 final Authenticator auth = new Authenticator() {
+ 197
+ @Override
+ 198
+ public PasswordAuthentication getPasswordAuthentication() {
+ 199 0 if (getRequestorType().equals(RequestorType.PROXY)) {
+ 200 0 return new PasswordAuthentication(username, password.toCharArray());
+ 201
+ }
+ 202 0 return super .getPasswordAuthentication();
+ 203
+ }
+ 204
+ };
+ 205 0 Authenticator.setDefault(auth);
+ 206
+ }
+ 207
+
+ 208 0 proxy = new Proxy(Proxy.Type.HTTP, addr);
+ 209 0 conn = (HttpURLConnection) url.openConnection(proxy);
+ 210 0 } else {
+ 211 0 conn = (HttpURLConnection) url.openConnection();
+ 212
+ }
+ 213 0 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
+ 214 0 conn.setConnectTimeout(timeout);
+ 215 0 } catch (IOException ex) {
+ 216 0 if (conn != null ) {
+ 217
+ try {
+ 218 0 conn.disconnect();
+ 219
+ } finally {
+ 220 0 conn = null ;
+ 221 0 }
+ 222
+ }
+ 223 0 throw new DownloadFailedException("Error getting connection." , ex);
+ 224 0 }
+ 225 0 return conn;
+ 226
+ }
+ 227
}
-
+
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 5f871ee03..71a031fea 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
@@ -149,6 +149,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 0b66eb542..a1b6dd2ce 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
@@ -135,13 +135,13 @@
60
public static String getFileExtension(String fileName) {
- 61 190 String ret = null ;
- 62 190 final int pos = fileName.lastIndexOf("." );
- 63 190 if (pos >= 0) {
- 64 181 ret = fileName.substring(pos + 1, fileName.length()).toLowerCase();
+ 61 218 String ret = null ;
+ 62 218 final int pos = fileName.lastIndexOf("." );
+ 63 218 if (pos >= 0) {
+ 64 209 ret = fileName.substring(pos + 1, fileName.length()).toLowerCase();
65
}
- 66 190 return ret;
+ 66 218 return ret;
67
}
68
@@ -409,6 +409,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
index ed1116c11..515fd131a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
@@ -56,19 +56,19 @@
19
public Iterator<T> filter(Iterator<T> iterator) {
- 20 1460 return new FilterIterator(iterator);
+ 20 1884 return new FilterIterator(iterator);
21
}
22
23
public Iterable<T> filter(final Iterable<T> iterable) {
- 24 1460 return new Iterable<T>() {
+ 24 1884 return new Iterable<T>() {
25
26
public Iterator<T> iterator() {
- 27 1460 return filter(iterable.iterator());
+ 27 1884 return filter(iterable.iterator());
28
}
29
@@ -86,28 +86,28 @@
private T next;
36
- 37 1460 private FilterIterator(Iterator<T> iterator) {
- 38 1460 this .iterator = iterator;
- 39 1460 toNext();
- 40 1460 }
+ 37 1884 private FilterIterator(Iterator<T> iterator) {
+ 38 1884 this .iterator = iterator;
+ 39 1884 toNext();
+ 40 1884 }
41
42
public boolean hasNext() {
- 43 7321 return next != null ;
+ 43 8053 return next != null ;
44
}
45
46
public T next() {
- 47 6254 if (next == null ) {
+ 47 6674 if (next == null ) {
48 0 throw new NoSuchElementException();
49
}
- 50 6254 T returnValue = next;
- 51 6254 toNext();
- 52 6254 return returnValue;
+ 50 6674 T returnValue = next;
+ 51 6674 toNext();
+ 52 6674 return returnValue;
53
}
54
@@ -121,22 +121,22 @@
59
private void toNext() {
- 60 7714 next = null ;
- 61 11638 while (iterator.hasNext()) {
- 62 10555 T item = iterator.next();
- 63 10555 if (item != null && passes(item)) {
- 64 6631 next = item;
- 65 6631 break ;
+ 60 8558 next = null ;
+ 61 12714 while (iterator.hasNext()) {
+ 62 11221 T item = iterator.next();
+ 63 11221 if (item != null && passes(item)) {
+ 64 7065 next = item;
+ 65 7065 break ;
66
}
- 67 3924 }
- 68 7714 }
+ 67 4156 }
+ 68 8558 }
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 5ea499850..fcc6552b6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
@@ -149,6 +149,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 006eb60ea..e850e375c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
@@ -104,6 +104,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 19c5b6dff..c620fe247 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 @@
@@ -116,37 +116,62 @@
50 0 LogManager.getLogManager().reset();
51 0 LogManager.getLogManager().readConfiguration(in);
52 0 if (verboseLogFile != null && !verboseLogFile.isEmpty()) {
- 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
+ 53 0 verboseLoggingEnabled = true ;
+ 54 0 final Logger logger = Logger.getLogger("" );
+ 55 0 final FileHandler handler = new FileHandler(verboseLogFile, true );
+ 56 0 handler.setFormatter(new SimpleFormatter());
+ 57 0 handler.setLevel(Level.FINE);
+ 58 0 handler.setFilter(new LogFilter());
+ 59 0 logger.addHandler(handler);
+ 60 0 logger.setLevel(Level.FINE);
+ 61
}
- 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
+ 62 0 } catch (IOException ex) {
+ 63 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "IO Error preparing the logger" , ex);
+ 64 0 } catch (SecurityException ex) {
+ 65 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "Error preparing the logger" , ex);
+ 66
} finally {
- 66 0 if (in != null ) {
- 67
+ 67 0 if (in != null ) {
+ 68
try {
- 68 0 in.close();
- 69 0 } catch (Exception ex) {
- 70 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINEST, "Error closing resource stream" , ex);
- 71 0 }
- 72
- }
+ 69 0 in.close();
+ 70 0 } catch (Exception ex) {
+ 71 0 Logger.getLogger(LogUtils.class .getName()).log(Level.FINEST, "Error closing resource stream" , ex);
+ 72 0 }
73
+ }
+ 74
}
- 74 0 }
- 75
+ 75 0 }
+ 76
+
+ 77
+
+ 78
+
+ 79 1 private static boolean verboseLoggingEnabled = false ;
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public static boolean isVerboseLoggingEnabled() {
+ 87 3 return verboseLoggingEnabled;
+ 88
+ }
+ 89
}
-
+
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 f5781460e..b29a6e57e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
@@ -114,6 +114,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 49c0e79b5..e1674efe9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Settings.html
@@ -273,538 +273,554 @@
128
129
-
+
130
131
- public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
+ public static final String PROXY_USERNAME = "proxy.username" ;
132
133
-
+
134
135
- public static final String TEMP_DIRECTORY = "temp.directory" ;
+ public static final String PROXY_PASSWORD = "proxy.password" ;
136
- }
+
137
-
+
138
-
+
139
-
+ public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
140
- private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+
141
-
+
142
-
+
143
-
- 144 1 private static final Settings INSTANCE = new Settings();
+ public static final String TEMP_DIRECTORY = "temp.directory" ;
+ 144
+ }
145
146
-
+
147
- 148 1 private Properties props = null ;
+ 148
+ private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
149
-
+
150
-
+
151
-
- 152
-
+
+ 152 1 private static final Settings INSTANCE = new Settings();
153
+
+ 154
+
+ 155
- 154 1 private Settings() {
- 155 1 InputStream in = null ;
- 156 1 props = new Properties();
+ 156 1 private Properties props = null ;
157
- try {
- 158 1 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
- 159 1 props.load(in);
- 160 0 } catch (IOException ex) {
- 161 0 Logger.getLogger(Settings.class .getName()).log(Level.SEVERE, "Unable to load default settings." );
- 162 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, null , ex);
- 163
- } finally {
- 164 1 if (in != null ) {
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162 1 private Settings() {
+ 163 1 InputStream in = null ;
+ 164 1 props = new Properties();
165
- try {
- 166 1 in.close();
- 167 0 } catch (IOException ex) {
- 168 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
- 169 1 }
- 170
- }
- 171
- }
- 172 1 }
- 173
-
- 174
-
- 175
-
- 176
-
- 177
-
- 178
-
- 179
-
- 180
- public static void setString(String key, String value) {
- 181 17 INSTANCE.props.setProperty(key, value);
- 182 17 }
- 183
-
- 184
-
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
- public static void setBoolean(String key, boolean value) {
- 191 2 if (value) {
- 192 0 INSTANCE.props.setProperty(key, Boolean.TRUE.toString());
- 193
- } else {
- 194 2 INSTANCE.props.setProperty(key, Boolean.FALSE.toString());
- 195
- }
- 196 2 }
- 197
-
- 198
-
- 199
-
- 200
-
- 201
-
- 202
-
- 203
-
- 204
-
- 205
-
- 206
-
- 207
-
- 208
-
- 209
-
- 210
- public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
- 211 0 final FileInputStream fis = new FileInputStream(filePath);
- 212 0 mergeProperties(fis);
- 213 0 }
- 214
-
- 215
-
- 216
-
- 217
-
- 218
-
- 219
-
- 220
-
- 221
-
- 222
-
- 223
-
- 224
-
- 225
-
- 226
-
- 227
- public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
- 228 1 final FileInputStream fis = new FileInputStream(filePath);
- 229 1 mergeProperties(fis);
- 230 1 }
- 231
-
- 232
-
- 233
-
- 234
-
- 235
-
- 236
-
- 237
-
- 238
-
- 239
-
- 240
-
- 241
-
- 242
- public static void mergeProperties(InputStream stream) throws IOException {
- 243 1 INSTANCE.props.load(stream);
- 244 1 }
- 245
-
- 246
-
- 247
-
- 248
-
- 249
-
- 250
-
- 251
-
- 252
-
- 253
-
- 254
-
- 255
-
- 256
-
- 257
-
- 258
- public static File getFile(String key) {
- 259 60 final String file = getString(key);
- 260 60 final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY);
- 261 60 if (baseDir != null ) {
- 262 60 if (baseDir.startsWith("[JAR]/" )) {
- 263 0 final File jarPath = getJarPath();
- 264 0 final File newBase = new File(jarPath, baseDir.substring(6));
- 265 0 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
- 266 0 return newBase;
- 267
- }
- 268 0 return new File(newBase, file);
- 269
- }
- 270 60 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
- 271 25 return new File(baseDir);
- 272
- }
- 273 35 return new File(baseDir, file);
- 274
- }
- 275 0 return new File(file);
- 276
- }
- 277
-
- 278
-
- 279
-
- 280
-
- 281
-
- 282
-
- 283
-
- 284
- private static File getJarPath() {
- 285 0 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
- 286 0 String decodedPath = "." ;
- 287
try {
- 288 0 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
- 289 0 } catch (UnsupportedEncodingException ex) {
- 290 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
- 291 0 }
- 292
-
- 293 0 final File path = new File(decodedPath);
- 294 0 if (path.getName().toLowerCase().endsWith(".jar" )) {
- 295 0 return path.getParentFile();
- 296
- } else {
- 297 0 return new File("." );
- 298
+ 166 1 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+ 167 1 props.load(in);
+ 168 0 } catch (IOException ex) {
+ 169 0 Logger.getLogger(Settings.class .getName()).log(Level.SEVERE, "Unable to load default settings." );
+ 170 0 Logger.getLogger(Settings.class .getName()).log(Level.FINE, null , ex);
+ 171
+ } finally {
+ 172 1 if (in != null ) {
+ 173
+ try {
+ 174 1 in.close();
+ 175 0 } catch (IOException ex) {
+ 176 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
+ 177 1 }
+ 178
+ }
+ 179
}
- 299
+ 180 1 }
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+ public static void setString(String key, String value) {
+ 189 17 INSTANCE.props.setProperty(key, value);
+ 190 17 }
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+ public static void setBoolean(String key, boolean value) {
+ 199 5 if (value) {
+ 200 0 INSTANCE.props.setProperty(key, Boolean.TRUE.toString());
+ 201
+ } else {
+ 202 5 INSTANCE.props.setProperty(key, Boolean.FALSE.toString());
+ 203
+ }
+ 204 5 }
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+ public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
+ 219 0 final FileInputStream fis = new FileInputStream(filePath);
+ 220 0 mergeProperties(fis);
+ 221 0 }
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+
+ 234
+
+ 235
+ public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
+ 236 1 final FileInputStream fis = new FileInputStream(filePath);
+ 237 1 mergeProperties(fis);
+ 238 1 }
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+ public static void mergeProperties(InputStream stream) throws IOException {
+ 251 1 INSTANCE.props.load(stream);
+ 252 1 }
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+ public static File getFile(String key) {
+ 267 79 final String file = getString(key);
+ 268 79 final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY);
+ 269 79 if (baseDir != null ) {
+ 270 79 if (baseDir.startsWith("[JAR]/" )) {
+ 271 0 final File jarPath = getJarPath();
+ 272 0 final File newBase = new File(jarPath, baseDir.substring(6));
+ 273 0 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
+ 274 0 return newBase;
+ 275
+ }
+ 276 0 return new File(newBase, file);
+ 277
+ }
+ 278 79 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
+ 279 35 return new File(baseDir);
+ 280
+ }
+ 281 44 return new File(baseDir, file);
+ 282
+ }
+ 283 0 return new File(file);
+ 284
}
+ 285
+
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291
+
+ 292
+ private static File getJarPath() {
+ 293 0 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
+ 294 0 String decodedPath = "." ;
+ 295
+ try {
+ 296 0 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
+ 297 0 } catch (UnsupportedEncodingException ex) {
+ 298 0 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
+ 299 0 }
300
- 301
-
- 302
-
- 303
-
+ 301 0 final File path = new File(decodedPath);
+ 302 0 if (path.getName().toLowerCase().endsWith(".jar" )) {
+ 303 0 return path.getParentFile();
304
-
- 305
-
+ } else {
+ 305 0 return new File("." );
306
-
+ }
307
-
+ }
308
-
+
309
-
+
310
-
- 311
- public static String getString(String key, String defaultValue) {
- 312 21 final String str = System.getProperty(key, INSTANCE.props.getProperty(key, defaultValue));
- 313 21 return str;
- 314
- }
- 315
-
- 316
-
- 317
-
- 318
-
- 319
-
- 320
-
- 321
- public static File getTempDirectory() {
- 322 6 return new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
- 323
- }
- 324
-
- 325
-
- 326
- 327
+ 311
- 328
+ 312
- 329
+ 313
- 330
+ 314
+ 315
+
+ 316
+
+ 317
+
+ 318
+
+ 319
+ public static String getString(String key, String defaultValue) {
+ 320 26 final String str = System.getProperty(key, INSTANCE.props.getProperty(key, defaultValue));
+ 321 26 return str;
+ 322
+ }
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
+ 328
+
+ 329
+ public static File getTempDirectory() {
+ 330 11 return new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
331
-
+ }
332
-
+
333
-
+
334
- public static String getString(String key) {
- 335 143 return System.getProperty(key, INSTANCE.props.getProperty(key));
+
+ 335
+
336
- }
+
337
-
+
338
-
+
339
-
+
340
-
+
341
-
+
342
-
- 343
-
+ public static String getString(String key) {
+ 343 184 return System.getProperty(key, INSTANCE.props.getProperty(key));
344
- public static void removeProperty(String key) {
- 345 1 INSTANCE.props.remove(key);
- 346 1 }
+ }
+ 345
+
+ 346
+
347
-
+
348
-
+
349
-
+
350
-
+
351
-
+
352
-
- 353
-
- 354
-
+ public static void removeProperty(String key) {
+ 353 1 INSTANCE.props.remove(key);
+ 354 1 }
355
-
+
356
-
+
357
-
- 358
-
- 359
- public static int getInt(String key) throws InvalidSettingException {
- 360
- int value;
- 361
- try {
- 362 1 value = Integer.parseInt(Settings.getString(key));
- 363 0 } catch (NumberFormatException ex) {
- 364 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 365 1 }
- 366 1 return value;
- 367
- }
- 368
-
- 369
-
- 370
- 371
+ 358
- 372
+ 359
- 373
+ 360
- 374
+ 361
- 375
+ 362
- 376
-
- 377
-
- 378
-
- 379
+ 363
+
+ 364
+
+ 365
+
+ 366
- 380
- public static int getInt(String key, int defaultValue) {
- 381
+ 367
+ public static int getInt(String key) throws InvalidSettingException {
+ 368
int value;
- 382
+ 369
try {
- 383 1 value = Integer.parseInt(Settings.getString(key));
- 384 1 } catch (NumberFormatException ex) {
- 385 1 final String msg = String.format("Could not convert property '%s' to an int." , key);
- 386 1 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, msg, ex);
- 387 1 value = defaultValue;
- 388 0 }
- 389 1 return value;
- 390
+ 370 1 value = Integer.parseInt(Settings.getString(key));
+ 371 0 } catch (NumberFormatException ex) {
+ 372 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 373 1 }
+ 374 1 return value;
+ 375
}
- 391
+ 376
- 392
+ 377
- 393
-
- 394
+ 378
+
+ 379
- 395
+ 380
- 396
+ 381
- 397
+ 382
+ 383
+
+ 384
+
+ 385
+
+ 386
+
+ 387
+
+ 388
+ public static int getInt(String key, int defaultValue) {
+ 389
+ int value;
+ 390
+ try {
+ 391 1 value = Integer.parseInt(Settings.getString(key));
+ 392 1 } catch (NumberFormatException ex) {
+ 393 1 final String msg = String.format("Could not convert property '%s' to an int." , key);
+ 394 1 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, msg, ex);
+ 395 1 value = defaultValue;
+ 396 0 }
+ 397 1 return value;
398
-
+ }
399
-
- 400
-
- 401
-
- 402
-
- 403
- public static long getLong(String key) throws InvalidSettingException {
- 404
- long value;
- 405
- try {
- 406 1 value = Long.parseLong(Settings.getString(key));
- 407 0 } catch (NumberFormatException ex) {
- 408 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 409 1 }
- 410 1 return value;
- 411
- }
- 412
- 413
+ 400
- 414
-
- 415
-
- 416
-
- 417
-
- 418
-
- 419
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
- 420
+ 406
- 421
+ 407
- 422
+ 408
- 423
+ 409
- 424
+ 410
- 425
- public static boolean getBoolean(String key) throws InvalidSettingException {
- 426
- boolean value;
- 427
+ 411
+ public static long getLong(String key) throws InvalidSettingException {
+ 412
+ long value;
+ 413
try {
- 428 4 value = Boolean.parseBoolean(Settings.getString(key));
- 429 0 } catch (NumberFormatException ex) {
- 430 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 431 4 }
- 432 4 return value;
- 433
+ 414 1 value = Long.parseLong(Settings.getString(key));
+ 415 0 } catch (NumberFormatException ex) {
+ 416 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 417 1 }
+ 418 1 return value;
+ 419
}
+ 420
+
+ 421
+
+ 422
+
+ 423
+
+ 424
+
+ 425
+
+ 426
+
+ 427
+
+ 428
+
+ 429
+
+ 430
+
+ 431
+
+ 432
+
+ 433
+ public static boolean getBoolean(String key) throws InvalidSettingException {
434
+ boolean value;
+ 435
+ try {
+ 436 7 value = Boolean.parseBoolean(Settings.getString(key));
+ 437 0 } catch (NumberFormatException ex) {
+ 438 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 439 7 }
+ 440 7 return value;
+ 441
+ }
+ 442
}
-
+
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 a071a8975..f1a96cf39 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
@@ -125,7 +125,7 @@
56
public static boolean containsUrl(String text) {
- 57 25107 return CONTAINS_URL_TEST.matcher(text).matches();
+ 57 25671 return CONTAINS_URL_TEST.matcher(text).matches();
58
}
59
@@ -220,6 +220,6 @@
}
-
+
diff --git a/dependency-check-core/cpd.html b/dependency-check-core/cpd.html
index 2d6c7b550..ec3907fcb 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-core/dependency-updates-report.html b/dependency-check-core/dependency-updates-report.html
index 569e5e6fc..71546ad81 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -222,7 +222,7 @@
# of dependencies using the latest version available
-10
+8
# of dependencies where the next version available is smaller than an incremental version update
@@ -230,11 +230,11 @@
# of dependencies where the next version available is an incremental version update
-6
+7
# of dependencies where the next version available is a minor version update
-8
+9
# of dependencies where the next version available is a major version update
@@ -378,7 +378,7 @@
1.5
-
+
org.apache.commons
commons-compress
1.5
@@ -387,7 +387,7 @@
jar
-
+1.6
@@ -522,7 +522,7 @@
-
+
org.jsoup
jsoup
1.7.2
@@ -530,7 +530,7 @@
jar
-
+1.7.3
@@ -652,7 +652,7 @@
jar
Newer versions
-2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.33.1 Latest Major
+2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 2.6.4 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.3 3.13.1.1 Latest Major
commons-cli:commons-cli
@@ -838,7 +838,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.commons
@@ -856,7 +856,10 @@
Type
-jar
+jar
+
+Newer versions
+1.6 Next Minor
org.apache.geronimo.daytrader:daytrader-ear
@@ -907,7 +910,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 Latest Minor
+4.4.0 Next Minor 4.5.04.5.1 Latest Minor
org.apache.lucene:lucene-core
@@ -934,7 +937,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 Latest Minor
+4.4.0 Next Minor 4.5.04.5.1 Latest Minor
org.apache.lucene:lucene-queryparser
@@ -961,7 +964,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 Latest Minor
+4.4.0 Next Minor 4.5.04.5.1 Latest Minor
org.apache.lucene:lucene-test-framework
@@ -988,7 +991,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 Latest Minor
+4.4.0 Next Minor 4.5.04.5.1 Latest Minor
org.apache.maven.scm:maven-scm-provider-cvsexe
@@ -1144,7 +1147,7 @@
Status
- No newer versions available.
+ There is at least one newer incremental version available. Incremental updates are typically passive.
Group Id
org.jsoup
@@ -1162,7 +1165,10 @@
Type
-jar
+jar
+
+Newer versions
+1.7.3 Next Incremental
org.mortbay.jetty:jetty
@@ -1216,7 +1222,7 @@
jar
Newer versions
-2.5.6 Next Incremental 2.5.6.SEC01 2.5.6.SEC022.5.6.SEC03 Latest Incremental 3.0.0.RELEASE Next Major 3.0.1.RELEASE 3.0.2.RELEASE 3.0.3.RELEASE 3.0.4.RELEASE 3.0.5.RELEASE 3.0.6.RELEASE 3.0.7.RELEASE 3.1.0.RELEASE 3.1.1.RELEASE 3.1.2.RELEASE 3.2.0.RELEASE 3.2.1.RELEASE 3.2.2.RELEASE 3.2.3.RELEASE3.2.4.RELEASE Latest Major
+2.5.6 Next Incremental 2.5.6.SEC01 2.5.6.SEC022.5.6.SEC03 Latest Incremental 3.0.0.RELEASE Next Major 3.0.1.RELEASE 3.0.2.RELEASE 3.0.3.RELEASE 3.0.4.RELEASE 3.0.5.RELEASE 3.0.6.RELEASE 3.0.7.RELEASE 3.1.0.RELEASE 3.1.1.RELEASE 3.1.2.RELEASE 3.2.0.RELEASE 3.2.1.RELEASE 3.2.2.RELEASE 3.2.3.RELEASE 3.2.4.RELEASE3.2.5.RELEASE Latest Major
diff --git a/dependency-check-core/failsafe-report.html b/dependency-check-core/failsafe-report.html
index 64a239189..d39396fc3 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -251,7 +251,7 @@ function toggleDisplay(elementId) {
0
0
100%
-83.899
+111.043
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
Package List
@@ -272,7 +272,7 @@ function toggleDisplay(elementId) {
0
0
100%
-
15.277
+
14.649
org.owasp.dependencycheck.utils
2
@@ -280,7 +280,7 @@ function toggleDisplay(elementId) {
0
0
100%
-2.033
+
4.162
org.owasp.dependencycheck.data.update
3
@@ -288,7 +288,7 @@ function toggleDisplay(elementId) {
0
0
100%
-66.585
+
92.226
org.owasp.dependencycheck.data.cpe
2
@@ -296,7 +296,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.004
+
0.006
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
org.owasp.dependencycheck
@@ -318,7 +318,7 @@ function toggleDisplay(elementId) {
0
0
100%
-
15.277
+
14.649
org.owasp.dependencycheck.utils
@@ -339,7 +339,7 @@ function toggleDisplay(elementId) {
0
0
100%
-2.033
+4.162
org.owasp.dependencycheck.data.update
@@ -360,7 +360,7 @@ function toggleDisplay(elementId) {
0
0
100%
-65.845
+91.86
StandardUpdateTaskIntegrationTest
@@ -369,7 +369,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.74
+0.366
org.owasp.dependencycheck.data.cpe
@@ -390,7 +390,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.004
+0.006
Test Cases
[Summary ] [Package List ] [Test Cases ]
@@ -400,7 +400,7 @@ function toggleDisplay(elementId) {
testUpdateNeeded
-0.004
+
0.006
testUpdate
@@ -411,36 +411,36 @@ function toggleDisplay(elementId) {
testUpdate
-65.845
+91.86
StandardUpdateTaskIntegrationTest
testUpdatesNeeded
-0.533
+0.327
testUpdate
-0.207
+0.039
EngineIntegrationTest
testScan
-15.277
+14.649
DownloaderIntegrationTest
testGetLastModified
-0.187
+0.035
testFetchFile
-1.846
+4.127
diff --git a/dependency-check-core/findbugs.html b/dependency-check-core/findbugs.html
index 50a57aaf9..72decd033 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -230,7 +230,7 @@
Errors
Missing Classes
-181
+184
7
0
0
@@ -268,13 +268,13 @@
Possible null pointer dereference of currentVersion in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
CORRECTNESS
NP_NULL_ON_SOME_PATH
-164
+166
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
-164
+166
Medium
org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer
@@ -319,7 +319,7 @@
Redundant nullcheck of conn which is known to be null in org.owasp.dependencycheck.utils.Downloader.getConnection(URL)
STYLE
RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE
-
198
+
216
Medium
org.owasp.dependencycheck.utils.LogUtils
@@ -334,7 +334,7 @@
Changes to logger could be lost in org.owasp.dependencycheck.utils.LogUtils.prepareLogger(InputStream, String)
EXPERIMENTAL
LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE
-
58
+
59
High
diff --git a/dependency-check-core/index.html b/dependency-check-core/index.html
index a99eefb17..c89232ee4 100644
--- a/dependency-check-core/index.html
+++ b/dependency-check-core/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core -
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-core/license.html b/dependency-check-core/license.html
index dc3dee12d..6a040824d 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-core/plugin-updates-report.html b/dependency-check-core/plugin-updates-report.html
index 8db11ce60..c64b935ab 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -692,7 +692,7 @@
2.1
Newer versions
-2.2 Next Minor 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.42.4.1 Latest Minor
+2.2 Next Minor 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.12.4.2 Latest Minor
Plugin org.apache.maven.plugins:maven-resources-plugin
diff --git a/dependency-check-core/pmd.html b/dependency-check-core/pmd.html
index 00cf02f31..57cac26e2 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -228,233 +228,236 @@
Line
These nested if statements could be combined
-148 - 151
+140 - 143
+
+These nested if statements could be combined
+305 - 308
org/owasp/dependencycheck/analyzer/CPEAnalyzer.java
-
+
Violation
Line
-
+
Useless parentheses.
136
-
+
Useless parentheses.
207
-
-These nested if statements could be combined
-588 - 593
These nested if statements could be combined
-589 - 592
+588 - 593
These nested if statements could be combined
+589 - 592
+
+These nested if statements could be combined
598 - 601
org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
-
+
Violation
Line
-
-Invoke equals() on the object you've already ensured is not null
-220
+Invoke equals() on the object you've already ensured is not null
+221
+
These nested if statements could be combined
-234 - 236
+235 - 237
org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.java
-
+
Violation
Line
-
+
These nested if statements could be combined
-152 - 173
+154 - 175
org/owasp/dependencycheck/analyzer/JarAnalyzer.java
-
+
Violation
Line
-
-Useless parentheses.
-337
Useless parentheses.
-834
+337
+Useless parentheses.
+834
+
Avoid unused method parameters such as 'classes'.
972
org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
-
+
Violation
Line
-
+
Avoid unused local variables such as 'extractComments'.
99
org/owasp/dependencycheck/analyzer/NvdCveAnalyzer.java
-
+
Violation
Line
-
+
Useless parentheses.
78
org/owasp/dependencycheck/concurrency/DirectorySpinLock.java
-
+
Violation
Line
-
+
These nested if statements could be combined
243 - 248
org/owasp/dependencycheck/data/cpe/BaseIndex.java
-
+
Violation
Line
-
+
These nested if statements could be combined
111 - 113
org/owasp/dependencycheck/data/cpe/IndexEntry.java
-
+
Violation
Line
-
+
Useless parentheses.
171
-
+
Useless parentheses.
174
org/owasp/dependencycheck/data/nvdcve/CveDB.java
-
+
Violation
Line
-
+
These nested if statements could be combined
517 - 519
-
+
Useless parentheses.
664
org/owasp/dependencycheck/dependency/Dependency.java
-
+
Violation
Line
-
+
Useless parentheses.
493
-
+
Useless parentheses.
496
-
+
Useless parentheses.
499
-
+
Useless parentheses.
502
-
+
Useless parentheses.
505
-
-Useless parentheses.
-508
Useless parentheses.
-527
+508
Useless parentheses.
+527
+
+Useless parentheses.
530
org/owasp/dependencycheck/dependency/Evidence.java
-
+
Violation
Line
-
+
Useless parentheses.
228
org/owasp/dependencycheck/dependency/Identifier.java
-
+
Violation
Line
-
+
Useless parentheses.
150
-
+
Useless parentheses.
153
org/owasp/dependencycheck/dependency/Reference.java
-
+
Violation
Line
-
-Useless parentheses.
-111
Useless parentheses.
-114
+111
Useless parentheses.
+114
+
+Useless parentheses.
117
org/owasp/dependencycheck/dependency/Vulnerability.java
-
+
Violation
Line
-
+
Useless parentheses.
375
org/owasp/dependencycheck/dependency/VulnerableSoftware.java
-
+
Violation
Line
-
-Useless parentheses.
-139
Useless parentheses.
-179
+139
Useless parentheses.
+179
+
+Useless parentheses.
184
org/owasp/dependencycheck/utils/Checksum.java
-
+
Violation
Line
-
+
Useless parentheses.
103
org/owasp/dependencycheck/utils/DependencyVersion.java
-
+
Violation
Line
-
+
Useless parentheses.
138
-
+
Useless parentheses.
198
diff --git a/dependency-check-core/project-info.html b/dependency-check-core/project-info.html
index 108dab5f6..ed07d244a 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-core/project-reports.html b/dependency-check-core/project-reports.html
index 8faa975de..07ef73b60 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-core/project-summary.html b/dependency-check-core/project-summary.html
index 703268e18..fc987835c 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -188,7 +188,7 @@
dependency-check-core
Version
-1.0.4
+1.0.5
Type
jar
diff --git a/dependency-check-core/surefire-report.html b/dependency-check-core/surefire-report.html
index 46cde4780..1025e7835 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -246,12 +246,12 @@ function toggleDisplay(elementId) {
Success Rate
Time
-122
+125
0
0
0
100%
-55.326
+59.712
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
Package List
@@ -272,7 +272,7 @@ function toggleDisplay(elementId) {
0
0
100%
-
26.573
+
28.466
org.owasp.dependencycheck.data.cwe
1
@@ -280,7 +280,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.009
+
0
org.owasp.dependencycheck.dependency
23
@@ -288,7 +288,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.033
+
0.001
org.owasp.dependencycheck.utils
29
@@ -296,7 +296,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.046
+
0.082
org.owasp.dependencycheck.concurrency
3
@@ -304,15 +304,15 @@ function toggleDisplay(elementId) {
0
0
100%
-9.516
+
9.507
org.owasp.dependencycheck.analyzer
-26
+29
0
0
0
100%
-9.508
+
15.018
org.owasp.dependencycheck.data.update
21
@@ -320,7 +320,7 @@ function toggleDisplay(elementId) {
0
0
100%
-7.438
+
3.779
org.owasp.dependencycheck.data.nvdcve
5
@@ -328,7 +328,7 @@ function toggleDisplay(elementId) {
0
0
100%
-1.318
+
1.502
org.owasp.dependencycheck.data.lucene
10
@@ -336,7 +336,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.885
+
1.357
org.owasp.dependencycheck.data.cpe
2
@@ -366,7 +366,7 @@ function toggleDisplay(elementId) {
0
0
100%
-26.573
+28.466
org.owasp.dependencycheck.data.cwe
@@ -387,7 +387,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.009
+0
org.owasp.dependencycheck.dependency
@@ -408,7 +408,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.032
+0
VulnerableSoftwareTest
@@ -438,7 +438,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.045
+0.042
DependencyVersionTest
@@ -447,7 +447,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0
+0.04
DependencyVersionUtilTest
@@ -492,7 +492,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.001
+0
org.owasp.dependencycheck.concurrency
@@ -513,7 +513,7 @@ function toggleDisplay(elementId) {
0
0
100%
-9.516
+9.507
org.owasp.dependencycheck.analyzer
@@ -534,7 +534,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.016
+0.024
AnalyzerServiceTest
@@ -543,16 +543,16 @@ function toggleDisplay(elementId) {
0
0
100%
-0.413
+0.516
ArchiveAnalyzerTest
-7
+10
0
0
0
100%
-0.517
+5.631
CPEAnalyzerTest
@@ -561,7 +561,7 @@ function toggleDisplay(elementId) {
0
0
100%
-7.536
+7.492
FileNameAnalyzerTest
@@ -570,7 +570,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.028
+0.037
JarAnalyzerTest
@@ -579,7 +579,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.998
+1.318
org.owasp.dependencycheck.data.update
@@ -600,7 +600,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.183
+0.252
BatchUpdateTaskTest
@@ -609,7 +609,7 @@ function toggleDisplay(elementId) {
0
0
100%
-7.2
+3.527
DataStoreMetaInfoTest
@@ -618,7 +618,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.055
+0
NvdCveInfoTest
@@ -657,7 +657,7 @@ function toggleDisplay(elementId) {
0
0
100%
-1.069
+1.154
NvdCve_1_2_HandlerTest
@@ -666,7 +666,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.049
+0.052
NvdCve_2_0_HandlerTest
@@ -675,7 +675,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.2
+0.296
org.owasp.dependencycheck.data.lucene
@@ -696,7 +696,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.091
+0.104
LuceneUtilsTest
@@ -714,7 +714,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.04
+0.059
UrlTokenizingFilterTest
@@ -723,7 +723,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.754
+1.194
org.owasp.dependencycheck.data.cpe
@@ -763,42 +763,54 @@ function toggleDisplay(elementId) {
testNewHashSet
-0.016
+0.024
AnalyzerServiceTest
testGetAnalyzers
-0.413
+0.516
ArchiveAnalyzerTest
+testAnalyzeTar
+0.256
+
+
+testAnalyzeTgz
+2.259
+
+
testAnalyze
-0.51
+0.279
testGetAnalysisPhase
-0
+0.001
testGetName
-0.001
+0
testAnalyze_badZip
-0.004
+0.008
testInitialize
-0.002
+0
+testAnalyzeTarGz
+2.828
+
+
testSupportsExtension
0
-
+
testGetSupportedExtensions
0
@@ -808,19 +820,19 @@ function toggleDisplay(elementId) {
testSearchCPE
-1.911
+1.636
testDetermineCPE
-2.616
+1.769
testOpen
-0.151
+0.163
testDetermineCPE_full
-2.857
+3.923
testBuildSearch
@@ -831,7 +843,7 @@ function toggleDisplay(elementId) {
testAnalyze
-0.028
+0.036
testClose
@@ -855,30 +867,30 @@ function toggleDisplay(elementId) {
testGetSupportedExtensions
-0
+0.001
JarAnalyzerTest
testAnalyze
-0.274
+0.289
testGetName
-0.169
+0.213
testInterpolateString
-0.167
+0.349
testSupportsExtension
-0.18
+0.245
testGetSupportedExtensions
-0.208
+0.222
DirectorySpinLockTest
@@ -893,7 +905,7 @@ function toggleDisplay(elementId) {
testObtainExclusiveLock
-1.512
+1.503
BaseIndexTest
@@ -914,14 +926,14 @@ function toggleDisplay(elementId) {
testGetCweName
-0.009
+0
FieldAnalyzerTest
testAnalyzers
-0.091
+0.104
LuceneUtilsTest
@@ -946,97 +958,97 @@ function toggleDisplay(elementId) {
-testExamples
-0.033
+testClear
+0.041
-testClear
-0.007
+testExamples
+0.018
UrlTokenizingFilterTest
-testEmptyTerm
-0.017
+testRandomStrings
+1.194
-testRandomStrings
-0.728
+testExamples
+0
-testExamples
-0.009
+testEmptyTerm
+0
CveDBTest
testOpen
-0.146
+0.356
testGetCPEs
-0.157
+0.267
testGetVulnerabilities
-0.766
+0.531
NvdCve_1_2_HandlerTest
testParse
-0.049
+0.052
NvdCve_2_0_HandlerTest
testParse
-0.2
+0.296
AbstractUpdateTaskTest
testOpenDataStores
-0.13
+0.197
testSetDeleteAndRecreate
-0.001
+0
testWithinRange
-0
+0.001
testDeleteExistingData
-0.052
+0.054
BatchUpdateTaskTest
testSetDoBatchUpdate
-3.994
+0.194
testUpdate
-3.206
+3.333
DataStoreMetaInfoTest
testIsBatchUpdateMode
-0.001
+0
testSave
-0.053
+0
testGetPropertiesFile
@@ -1044,7 +1056,7 @@ function toggleDisplay(elementId) {
testGetProperty_String_String
-0.001
+0
testIsEmpty
@@ -1105,11 +1117,11 @@ function toggleDisplay(elementId) {
testGetSha1sum
-0.013
+0
testGetProductEvidence
-0.001
+0
testGetActualFilePath
@@ -1145,7 +1157,7 @@ function toggleDisplay(elementId) {
testGetFileName
-0.001
+0
testGetFilePath
@@ -1161,7 +1173,7 @@ function toggleDisplay(elementId) {
testGetMd5sum
-0.017
+0
testGetEvidence
@@ -1184,7 +1196,7 @@ function toggleDisplay(elementId) {
testCompareTo
-0.001
+0
testHashCode
@@ -1192,14 +1204,14 @@ function toggleDisplay(elementId) {
testEquals
-0
+0.001
ReportGeneratorTest
testGenerateXMLReport
-26.573
+28.466
testGenerateReport
@@ -1210,7 +1222,7 @@ function toggleDisplay(elementId) {
testGetChecksum_NoSuchAlgorithm
-0.044
+0.042
testGetChecksum
@@ -1218,7 +1230,7 @@ function toggleDisplay(elementId) {
testGetMD5Checksum
-0.001
+0
testGetChecksum_FileNotFound
@@ -1245,7 +1257,7 @@ function toggleDisplay(elementId) {
testCompareTo
-0
+0.04
testParseVersion
@@ -1320,7 +1332,7 @@ function toggleDisplay(elementId) {
testRemoveProperty
-0.001
+0
testSetString
diff --git a/dependency-check-core/taglist.html b/dependency-check-core/taglist.html
index 6fdbee00a..dbe5417b0 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,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -225,19 +225,19 @@
Tag strings used by tag class
Todo Work
-34
+32
todo, FIXME
Each tag is detailed below:
-
Number of occurrences found in the code: 34
+
Number of occurrences found in the code: 32
org.owasp.dependencycheck.analyzer.ArchiveAnalyzer
Line
- can we get more evidence from the parent? EAR contains module name, etc.
-212
+206
org.owasp.dependencycheck.analyzer.CPEAnalyzer
Line
@@ -257,143 +257,134 @@
fix this assert Assert.assertEquals(expResult, result.get(0).getName());
251
-org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer
-Line
-
-- consider splitting on /\._-\s/ and checking if all of one side is fully contained in the other With the exception of the word "core". This might work even on groups when we don't have a CVE.
-302
-
-should we be splitting the name on [-_(.\d)+] and seeing if the parts are contained in the other side?
-320
-
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
Line
-
+
fix the version problem below
-150
-
-- 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).
-262
+152
-move this startswith expression to a configuration file?
-273
+- 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).
+264
+move this startswith expression to a configuration file?
+275
+
org.owasp.dependencycheck.analyzer.JarAnalyzer
Line
-
+
remove weighting
516
-
+
change this to a regex?
633
-
+
validate that the starts with is correct... or does it start with a ./ or /? // is it different on different platforms? if (entry.startsWith("META-INF/maven/")) { //trim the meta-inf/maven and pom.xml... final String pomPath = entry.substring(15, entry.length() - 8).toLowerCase(); final String[] parts = pomPath.split("/"); if (parts == null || parts.length != 2) { //misplaced pom? //TODO add logging to FINE possiblePoms.add(entry); } parts[0] = parts[0].replace('.', '/'); parts[1] = parts[1].replace('.', '/'); for (ClassNameInformation cni : classes) { final String name = cni.getName(); if (StringUtils.containsIgnoreCase(name, parts[0])) { addEntry(usePoms, entry); } if (StringUtils.containsIgnoreCase(name, parts[1])) { addEntry(usePoms, entry); } } } else { // we have a JAR file with an incorrect POM layout... //TODO add logging to FINE possiblePoms.add(entry); } } List<String> retValue; if (usePoms.isEmpty()) { if (possiblePoms.isEmpty()) { retValue = pomEntries; } else { retValue = possiblePoms; } } else { retValue = new ArrayList<String>(); int maxCount = 0; for (Map.Entry<String, Integer> entry : usePoms.entrySet()) { final int current = entry.getValue().intValue(); if (current > maxCount) { maxCount = current; retValue.clear(); retValue.add(entry.getKey()); } else if (current == maxCount) { retValue.add(entry.getKey()); } } } return retValue;
977
-
+
add logging to FINE possiblePoms.add(entry); } parts[0] = parts[0].replace('.', '/'); parts[1] = parts[1].replace('.', '/'); for (ClassNameInformation cni : classes) { final String name = cni.getName(); if (StringUtils.containsIgnoreCase(name, parts[0])) { addEntry(usePoms, entry); } if (StringUtils.containsIgnoreCase(name, parts[1])) { addEntry(usePoms, entry); } } } else { // we have a JAR file with an incorrect POM layout... //TODO add logging to FINE possiblePoms.add(entry); } } List<String> retValue; if (usePoms.isEmpty()) { if (possiblePoms.isEmpty()) { retValue = pomEntries; } else { retValue = possiblePoms; } } else { retValue = new ArrayList<String>(); int maxCount = 0; for (Map.Entry<String, Integer> entry : usePoms.entrySet()) { final int current = entry.getValue().intValue(); if (current > maxCount) { maxCount = current; retValue.clear(); retValue.add(entry.getKey()); } else if (current == maxCount) { retValue.add(entry.getKey()); } } } return retValue;
984
-
+
add logging to FINE possiblePoms.add(entry); } } List<String> retValue; if (usePoms.isEmpty()) { if (possiblePoms.isEmpty()) { retValue = pomEntries; } else { retValue = possiblePoms; } } else { retValue = new ArrayList<String>(); int maxCount = 0; for (Map.Entry<String, Integer> entry : usePoms.entrySet()) { final int current = entry.getValue().intValue(); if (current > maxCount) { maxCount = current; retValue.clear(); retValue.add(entry.getKey()); } else if (current == maxCount) { retValue.add(entry.getKey()); } } } return retValue;
999
-
+
org.owasp.dependencycheck.analyzer.NvdCveAnalyzer
Line
-
+
- remove this comment block after additional testing is completed note - valid match functionality has been moved into the CveDB class. // for (Vulnerability v : vulns) { // if (isValidMatch(dependency, v)) { // dependency.addVulnerability(v); // } // }
110
-
+
- remove this comment block after additional testing is completed The following check has been moved into the CveDB class. // /** // * <p>Determines if this is a valid vulnerability match for the given // * dependency. Specifically, this is concerned with ensuring the version // * numbers are correct.</p> // * <p>Currently, this is focused on the issues with the versions for Struts // * 1 and Struts 2. In the future this will due better matching on more // * version numbers.</p> // * // * @param dependency the dependency // * @param v the vulnerability // * @return returns true if the vulnerability is for the given dependency // */ // private boolean isValidMatch(final Dependency dependency, final Vulnerability v) { // //right now I only know of the issue with Struts1/2 // // start with fixing this problem. // // //TODO extend this solution to do better version matching for the vulnerable software. // boolean struts1 = false; // boolean struts2 = false; // for (Identifier i : dependency.getIdentifiers()) { // if (i.getValue().startsWith("cpe:/a:apache:struts:")) { // final char version = i.getValue().charAt(21); // if (version == '1') { // struts1 = true; // } // if (version == '2') { // struts2 = true; // } // } // } // if (!struts1 && !struts2) { // return true; //we are not looking at struts, so return true. // } // if (struts1 && struts2) { // return true; //there is a mismatch here, but we can't solve it here so we return valid. // } // if (struts1) { // boolean hasStruts1Vuln = false; // boolean hasStruts2PreviousVersion = false; // for (VulnerableSoftware vs : v.getVulnerableSoftware()) { // //TODO FIX THIS // //hasStruts2PreviousVersion |= vs.hasPreviousVersion() && vs.getName().charAt(21) == '2'; // //hasStruts1Vuln |= vs.getName().charAt(21) == '1'; // } // if (!hasStruts1Vuln && hasStruts2PreviousVersion) { // return false; // } // } // // return true; // }
169
-
+
extend this solution to do better version matching for the vulnerable software. // boolean struts1 = false; // boolean struts2 = false; // for (Identifier i : dependency.getIdentifiers()) { // if (i.getValue().startsWith("cpe:/a:apache:struts:")) { // final char version = i.getValue().charAt(21); // if (version == '1') { // struts1 = true; // } // if (version == '2') { // struts2 = true; // } // } // } // if (!struts1 && !struts2) { // return true; //we are not looking at struts, so return true. // } // if (struts1 && struts2) { // return true; //there is a mismatch here, but we can't solve it here so we return valid. // } // if (struts1) { // boolean hasStruts1Vuln = false; // boolean hasStruts2PreviousVersion = false; // for (VulnerableSoftware vs : v.getVulnerableSoftware()) { // //TODO FIX THIS // //hasStruts2PreviousVersion |= vs.hasPreviousVersion() && vs.getName().charAt(21) == '2'; // //hasStruts1Vuln |= vs.getName().charAt(21) == '1'; // } // if (!hasStruts1Vuln && hasStruts2PreviousVersion) { // return false; // } // } // // return true; // }
187
-
+
FIX THIS // //hasStruts2PreviousVersion |= vs.hasPreviousVersion() && vs.getName().charAt(21) == '2'; // //hasStruts1Vuln |= vs.getName().charAt(21) == '1'; // } // if (!hasStruts1Vuln && hasStruts2PreviousVersion) { // return false; // } // } // // return true; // }
211
-
+
org.owasp.dependencycheck.concurrency.DirectorySpinLock
Line
-
+
uncomment this once support for 1.6 is dropped. if (lock != null) { try { lock.close(); } catch (IOException ex) { Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to close file lock due to IO Exception", ex); } }
227
-
+
org.owasp.dependencycheck.data.cpe.CpeIndexReader
Line
-
+
add spinlock (shared)
80
-
+
remove spinlock (shared)
93
-
+
org.owasp.dependencycheck.data.cpe.CpeIndexWriter
Line
-
+
add spinlock
62
-
+
remove spinlock
74
-
+
org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer
Line
-
+
consider implementing payloads/custom attributes... use custom attributes for major, minor, x, x, x, rcx these can then be used to weight the score for searches on the version. see http://lucene.apache.org/core/3_6_1/api/core/org/apache/lucene/analysis/package-summary.html#package_description look at this article to implement http://www.codewrecks.com/blog/index.php/2012/08/25/index-your-blog-using-tags-and-lucene-net/
38
-
+
org.owasp.dependencycheck.data.lucene.VersionAnalyzer
Line
-
+
consider implementing payloads/custom attributes... use custom attributes for major, minor, x, x, x, rcx these can then be used to weight the score for searches on the version. see http://lucene.apache.org/core/3_6_1/api/core/org/apache/lucene/analysis/package-summary.html#package_description look at this article to implement http://www.codewrecks.com/blog/index.php/2012/08/25/index-your-blog-using-tags-and-lucene-net/
37
-
+
org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter
Line
-
+
should we also be splitting on dash or underscore? we would need to incorporate the dash or underscore back in...
83
-
+
org.owasp.dependencycheck.data.nvdcve.CveDB
Line
-
+
consider utilizing the matchThreeVersion method to get additional results. However, this might also introduce false positives.
674
-
+
org.owasp.dependencycheck.data.update.BatchUpdateTask
Line
-
+
add FTP?
112
-
+
org.owasp.dependencycheck.data.update.BatchUpdateTaskTest
Line
-
+
add some actual asserts to check things.
119
-
+
org.owasp.dependencycheck.data.update.StandardUpdateTaskIntegrationTest
Line
-
+
make this an actual test
69
-
+
org.owasp.dependencycheck.dependency.EvidenceCollection
Line
-
+
consider changing the regex to only compare alpha-numeric (i.e. strip everything else)
244
-
+
org.owasp.dependencycheck.utils.DependencyVersion
Line
-
+
steal better version of code from compareTo
140
-
+
org.owasp.dependencycheck.utils.Downloader
Line
-
+
add the FPR protocol?
-132
+134
diff --git a/dependency-check-core/xref-test/index.html b/dependency-check-core/xref-test/index.html
index 111f96d90..4d9435a62 100644
--- a/dependency-check-core/xref-test/index.html
+++ b/dependency-check-core/xref-test/index.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerTest.html
index d3eb5cfb7..045a4aad1 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerTest.html
@@ -38,158 +38,244 @@
28 import org.junit.Test;
29 import static org.junit.Assert.*;
30 import org.owasp.dependencycheck.Engine;
-31 import org.owasp.dependencycheck.dependency.Dependency;
-32 import org.owasp.dependencycheck.utils.Settings;
-33
-34
-35
-36
-37
-38 public class ArchiveAnalyzerTest {
-39
-40 public ArchiveAnalyzerTest () {
-41 }
-42
-43 @BeforeClass
-44 public static void setUpClass() {
-45 }
-46
-47 @AfterClass
-48 public static void tearDownClass() {
-49 }
-50
-51 @Before
-52 public void setUp() {
-53 }
-54
-55 @After
-56 public void tearDown() {
-57 }
-58
-59
-60
-61
-62 @Test
-63 public void testGetSupportedExtensions() {
-64 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-65 Set expResult = new HashSet<String>();
-66 expResult.add("zip" );
-67 expResult.add("war" );
-68 expResult.add("ear" );
-69 Set result = instance.getSupportedExtensions();
-70 assertEquals(expResult, result);
-71 }
-72
-73
-74
-75
-76 @Test
-77 public void testGetName() {
-78 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-79 String expResult = "Archive Analyzer" ;
-80 String result = instance.getName();
-81 assertEquals(expResult, result);
-82 }
-83
-84
-85
-86
-87 @Test
-88 public void testSupportsExtension() {
-89 String extension = "tar" ;
-90 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-91 boolean expResult = false;
-92 boolean result = instance.supportsExtension(extension);
-93 assertEquals(expResult, result);
-94
-95 extension = "war" ;
-96 expResult = true ;
-97 result = instance.supportsExtension(extension);
-98 assertEquals(expResult, result);
-99
-100 extension = "ear" ;
-101 result = instance.supportsExtension(extension);
-102 assertEquals(expResult, result);
-103
-104 extension = "zip" ;
-105 result = instance.supportsExtension(extension);
-106 assertEquals(expResult, result);
-107 }
-108
-109
-110
-111
-112 @Test
-113 public void testGetAnalysisPhase() {
-114 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-115 AnalysisPhase expResult = AnalysisPhase.INITIAL;
-116 AnalysisPhase result = instance.getAnalysisPhase();
-117 assertEquals(expResult, result);
-118 }
-119
-120
-121
-122
-123 @Test
-124 public void testInitialize() throws Exception {
-125 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-126 instance.initialize();
-127
-128 instance.close();
-129
-130
-131 }
-132
-133
-134
-135
-136 @Test
-137 public void testAnalyze() throws Exception {
-138 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-139 try {
-140 instance.initialize();
-141
-142 File file = new File(this .getClass().getClassLoader().getResource("daytrader-ear-2.1.7.ear" ).getPath());
-143 Dependency dependency = new Dependency(file);
-144 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
-145 Engine engine = new Engine();
-146
-147 int initial_size = engine.getDependencies().size();
-148 instance.analyze(dependency, engine);
-149 int ending_size = engine.getDependencies().size();
-150
-151 assertTrue(initial_size < ending_size);
+31 import org.owasp.dependencycheck.data.cpe.BaseIndexTestCase;
+32 import org.owasp.dependencycheck.dependency.Dependency;
+33 import org.owasp.dependencycheck.utils.Settings;
+34
+35
+36
+37
+38
+39 public class ArchiveAnalyzerTest extends BaseIndexTestCase {
+40
+41 public ArchiveAnalyzerTest () {
+42 }
+43
+44 @BeforeClass
+45 public static void setUpClass() {
+46 }
+47
+48 @AfterClass
+49 public static void tearDownClass() {
+50 }
+51
+52 @Before
+53 public void setUp() throws Exception {
+54 super .setUp();
+55 }
+56
+57 @After
+58 public void tearDown() throws Exception {
+59 super .tearDown();
+60 }
+61
+62
+63
+64
+65 @Test
+66 public void testGetSupportedExtensions() {
+67 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+68 Set expResult = new HashSet<String>();
+69 expResult.add("zip" );
+70 expResult.add("war" );
+71 expResult.add("ear" );
+72 expResult.add("tar" );
+73 expResult.add("gz" );
+74 expResult.add("tgz" );
+75 Set result = instance.getSupportedExtensions();
+76 assertEquals(expResult, result);
+77 }
+78
+79
+80
+81
+82 @Test
+83 public void testGetName() {
+84 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+85 String expResult = "Archive Analyzer" ;
+86 String result = instance.getName();
+87 assertEquals(expResult, result);
+88 }
+89
+90
+91
+92
+93 @Test
+94 public void testSupportsExtension() {
+95 String extension = "7z" ;
+96 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+97 boolean expResult = false;
+98 boolean result = instance.supportsExtension(extension);
+99 assertEquals(expResult, result);
+100
+101 extension = "war" ;
+102 expResult = true ;
+103 result = instance.supportsExtension(extension);
+104 assertEquals(expResult, result);
+105
+106 extension = "ear" ;
+107 result = instance.supportsExtension(extension);
+108 assertEquals(expResult, result);
+109
+110 extension = "zip" ;
+111 result = instance.supportsExtension(extension);
+112 assertEquals(expResult, result);
+113 }
+114
+115
+116
+117
+118 @Test
+119 public void testGetAnalysisPhase() {
+120 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+121 AnalysisPhase expResult = AnalysisPhase.INITIAL;
+122 AnalysisPhase result = instance.getAnalysisPhase();
+123 assertEquals(expResult, result);
+124 }
+125
+126
+127
+128
+129 @Test
+130 public void testInitialize() throws Exception {
+131 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+132 instance.initialize();
+133
+134 instance.close();
+135
+136
+137 }
+138
+139
+140
+141
+142 @Test
+143 public void testAnalyze() throws Exception {
+144 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+145 try {
+146 instance.initialize();
+147
+148 File file = new File(this .getClass().getClassLoader().getResource("daytrader-ear-2.1.7.ear" ).getPath());
+149 Dependency dependency = new Dependency(file);
+150 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+151 Engine engine = new Engine();
152
-153 } finally {
-154 instance.close();
-155 }
-156 }
-157
-158
-159
-160
-161 @Test
-162 public void testAnalyze_badZip() throws Exception {
-163 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-164 try {
-165 instance.initialize();
-166
-167 File file = new File(this .getClass().getClassLoader().getResource("test.zip" ).getPath());
-168 Dependency dependency = new Dependency(file);
-169 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
-170 Engine engine = new Engine();
-171
-172 int initial_size = engine.getDependencies().size();
-173 instance.analyze(dependency, engine);
-174 int ending_size = engine.getDependencies().size();
-175
-176 assertTrue(initial_size == ending_size);
+153 int initial_size = engine.getDependencies().size();
+154 instance.analyze(dependency, engine);
+155 int ending_size = engine.getDependencies().size();
+156
+157 assertTrue(initial_size < ending_size);
+158
+159 } finally {
+160 instance.close();
+161 }
+162 }
+163
+164
+165
+166
+167 @Test
+168 public void testAnalyzeTar() throws Exception {
+169 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+170 try {
+171 instance.initialize();
+172
+173 File file = new File(this .getClass().getClassLoader().getResource("file.tar" ).getPath());
+174 Dependency dependency = new Dependency(file);
+175 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+176 Engine engine = new Engine();
177
-178 } finally {
-179 instance.close();
-180 }
-181 }
-182 }
+178 int initial_size = engine.getDependencies().size();
+179 instance.analyze(dependency, engine);
+180 int ending_size = engine.getDependencies().size();
+181
+182 assertTrue(initial_size < ending_size);
+183
+184 } finally {
+185 instance.close();
+186 }
+187 }
+188
+189
+190
+191
+192 @Test
+193 public void testAnalyzeTarGz() throws Exception {
+194 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+195 try {
+196 instance.initialize();
+197
+198 File file = new File(this .getClass().getClassLoader().getResource("file.tar.gz" ).getPath());
+199
+200 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+201 Engine engine = new Engine();
+202
+203 int initial_size = engine.getDependencies().size();
+204
+205 engine.scan(file);
+206 engine.analyzeDependencies();
+207 int ending_size = engine.getDependencies().size();
+208
+209 assertTrue(initial_size < ending_size);
+210
+211 } finally {
+212 instance.close();
+213 }
+214 }
+215
+216
+217
+218
+219 @Test
+220 public void testAnalyzeTgz() throws Exception {
+221 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+222 try {
+223 instance.initialize();
+224
+225 File file = new File(this .getClass().getClassLoader().getResource("file.tgz" ).getPath());
+226 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+227 Engine engine = new Engine();
+228
+229 int initial_size = engine.getDependencies().size();
+230 engine.scan(file);
+231 engine.analyzeDependencies();
+232 int ending_size = engine.getDependencies().size();
+233
+234 assertTrue(initial_size < ending_size);
+235
+236 } finally {
+237 instance.close();
+238 }
+239 }
+240
+241
+242
+243
+244 @Test
+245 public void testAnalyze_badZip() throws Exception {
+246 ArchiveAnalyzer instance = new ArchiveAnalyzer();
+247 try {
+248 instance.initialize();
+249
+250 File file = new File(this .getClass().getClassLoader().getResource("test.zip" ).getPath());
+251 Dependency dependency = new Dependency(file);
+252 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+253 Engine engine = new Engine();
+254 int initial_size = engine.getDependencies().size();
+255
+256
+257 instance.analyze(dependency, engine);
+258
+259
+260
+261
+262 int ending_size = engine.getDependencies().size();
+263 assertEquals(initial_size, ending_size);
+264 } finally {
+265 instance.close();
+266 }
+267 }
+268 }
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 9bbd90458..f072d79c6 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.0.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.analyzer
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 26db5ab87..65aeee09f 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.0.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.analyzer
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-frame.html
index 86ae95260..ff8225fa2 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.concurrency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.concurrency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-summary.html
index 9c800dbe7..24d5a9e3b 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/concurrency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.concurrency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.concurrency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
index a9ea3abe5..1b5bd54d1 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
index 07097633f..2e073ecbf 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
index 5ab08787d..fdd35f112 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
index 907163ace..b6bf72b3c 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
index 36122c3c4..0b8e51e6b 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
index dce975417..088c203b5 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
index ece4def7d..e1a2be449 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
index 97d4ae5f5..2d2f64915 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
index 0b8e57b87..02172aab6 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
index f51e1460c..0c8def890 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
index eb606cf50..d679122cb 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
index 747ce1c18..31d9871c8 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
index f52dfc644..55306ce2a 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
index 00ba36d09..a05b6887b 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
index aa81e3774..3506f8b82 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
index 1c50ed122..a30757e7d 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
index 8798ff08f..e61dab4d6 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
index bd35fd98b..2097ff62f 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref-test/overview-frame.html b/dependency-check-core/xref-test/overview-frame.html
index 78279fb4e..83663a412 100644
--- a/dependency-check-core/xref-test/overview-frame.html
+++ b/dependency-check-core/xref-test/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-core/xref-test/overview-summary.html b/dependency-check-core/xref-test/overview-summary.html
index 673ab6c78..c65e789fc 100644
--- a/dependency-check-core/xref-test/overview-summary.html
+++ b/dependency-check-core/xref-test/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-core/xref/allclasses-frame.html b/dependency-check-core/xref/allclasses-frame.html
index ed35a5330..3d793ed95 100644
--- a/dependency-check-core/xref/allclasses-frame.html
+++ b/dependency-check-core/xref/allclasses-frame.html
@@ -49,6 +49,9 @@
ArchiveAnalyzer
+
+
+ ArchiveExtractionException
BaseIndex
@@ -292,6 +295,9 @@
Modules
+
+
+ NoDataException
NonClosingStream
diff --git a/dependency-check-core/xref/index.html b/dependency-check-core/xref/index.html
index 111f96d90..4d9435a62 100644
--- a/dependency-check-core/xref/index.html
+++ b/dependency-check-core/xref/index.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html b/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
index a26a44a49..c0e2e6c7b 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
@@ -30,383 +30,429 @@
20
21 import java.util.EnumMap;
22 import java.io.File;
-23 import java.util.ArrayList;
-24 import java.util.HashSet;
-25 import java.util.Iterator;
-26 import java.util.List;
-27 import java.util.Set;
-28 import java.util.logging.Level;
-29 import java.util.logging.Logger;
-30 import org.owasp.dependencycheck.analyzer.AnalysisException;
-31 import org.owasp.dependencycheck.analyzer.AnalysisPhase;
-32 import org.owasp.dependencycheck.analyzer.Analyzer;
-33 import org.owasp.dependencycheck.analyzer.AnalyzerService;
-34 import org.owasp.dependencycheck.data.CachedWebDataSource;
-35 import org.owasp.dependencycheck.data.UpdateException;
-36 import org.owasp.dependencycheck.data.UpdateService;
-37 import org.owasp.dependencycheck.dependency.Dependency;
-38 import org.owasp.dependencycheck.utils.FileUtils;
-39 import org.owasp.dependencycheck.utils.InvalidSettingException;
-40 import org.owasp.dependencycheck.utils.Settings;
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50 public class Engine {
-51
-52
-53
-54
-55 private final List<Dependency> dependencies = new ArrayList<Dependency>();
-56
-57
-58
-59 private final EnumMap<AnalysisPhase, List<Analyzer>> analyzers =
-60 new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
-61
-62
-63
-64 private final Set<String> extensions = new HashSet<String>();
-65
-66
-67
-68
-69 public Engine () {
-70 boolean autoUpdate = true ;
-71 try {
-72 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
-73 } catch (InvalidSettingException ex) {
-74 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "Invalid setting for auto-update; using true." );
-75 }
-76 if (autoUpdate) {
-77 doUpdates();
+23 import java.io.IOException;
+24 import java.util.ArrayList;
+25 import java.util.HashSet;
+26 import java.util.Iterator;
+27 import java.util.List;
+28 import java.util.Set;
+29 import java.util.logging.Level;
+30 import java.util.logging.Logger;
+31 import org.owasp.dependencycheck.analyzer.AnalysisException;
+32 import org.owasp.dependencycheck.analyzer.AnalysisPhase;
+33 import org.owasp.dependencycheck.analyzer.Analyzer;
+34 import org.owasp.dependencycheck.analyzer.AnalyzerService;
+35 import org.owasp.dependencycheck.data.CachedWebDataSource;
+36 import org.owasp.dependencycheck.data.NoDataException;
+37 import org.owasp.dependencycheck.data.UpdateException;
+38 import org.owasp.dependencycheck.data.UpdateService;
+39 import org.owasp.dependencycheck.data.cpe.CpeIndexReader;
+40 import org.owasp.dependencycheck.dependency.Dependency;
+41 import org.owasp.dependencycheck.utils.FileUtils;
+42 import org.owasp.dependencycheck.utils.InvalidSettingException;
+43 import org.owasp.dependencycheck.utils.Settings;
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53 public class Engine {
+54
+55
+56
+57
+58 private final List<Dependency> dependencies = new ArrayList<Dependency>();
+59
+60
+61
+62 private final EnumMap<AnalysisPhase, List<Analyzer>> analyzers =
+63 new EnumMap<AnalysisPhase, List<Analyzer>>(AnalysisPhase.class );
+64
+65
+66
+67 private final Set<String> extensions = new HashSet<String>();
+68
+69
+70
+71
+72 public Engine () {
+73 boolean autoUpdate = true ;
+74 try {
+75 autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+76 } catch (InvalidSettingException ex) {
+77 Logger.getLogger(Engine.class .getName()).log(Level.FINE, "Invalid setting for auto-update; using true." );
78 }
-79 loadAnalyzers();
-80 }
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91 @Deprecated
-92 public Engine (boolean autoUpdate) {
-93 if (autoUpdate) {
-94 doUpdates();
-95 }
-96 loadAnalyzers();
-97 }
-98
-99
-100
-101
-102
-103 private void loadAnalyzers() {
-104
-105 for (AnalysisPhase phase : AnalysisPhase.values()) {
-106 analyzers.put(phase, new ArrayList<Analyzer>());
-107 }
-108
-109 final AnalyzerService service = AnalyzerService.getInstance();
-110 final Iterator<Analyzer> iterator = service.getAnalyzers();
-111 while (iterator.hasNext()) {
-112 final Analyzer a = iterator.next();
-113 analyzers.get(a.getAnalysisPhase()).add(a);
-114 if (a.getSupportedExtensions() != null ) {
-115 extensions.addAll(a.getSupportedExtensions());
-116 }
-117 }
-118 }
-119
-120
-121
-122
-123
-124
-125
-126 public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
-127 return analyzers.get(phase);
-128 }
-129
-130
-131
-132
-133
-134
-135 public List<Dependency> getDependencies() {
-136 return dependencies;
-137 }
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148 public void scan(String[] paths) {
-149 for (String path : paths) {
-150 final File file = new File(path);
-151 scan(file);
-152 }
-153 }
-154
-155
-156
-157
-158
-159
-160
-161
-162 public void scan(String path) {
-163 final File file = new File(path);
-164 scan(file);
-165 }
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176 public void scan(File[] files) {
-177 for (File file : files) {
-178 scan(file);
-179 }
-180 }
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191 public void scan(Set<File> files) {
-192 for (File file : files) {
-193 scan(file);
-194 }
-195 }
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206 public void scan(List<File> files) {
-207 for (File file : files) {
-208 scan(file);
-209 }
-210 }
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221 public void scan(File file) {
-222 if (file.exists()) {
-223 if (file.isDirectory()) {
-224 scanDirectory(file);
-225 } else {
-226 scanFile(file);
-227 }
-228 }
-229 }
-230
-231
-232
-233
-234
-235
-236
-237 protected void scanDirectory(File dir) {
-238 final File[] files = dir.listFiles();
-239 if (files != null ) {
-240 for (File f : files) {
-241 if (f.isDirectory()) {
-242 scanDirectory(f);
-243 } else {
-244 scanFile(f);
-245 }
-246 }
-247 }
-248 }
-249
-250
-251
-252
-253
-254
-255
-256 protected void scanFile(File file) {
-257 if (!file.isFile()) {
-258 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
-259 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
-260 return ;
-261 }
-262 final String fileName = file.getName();
-263 final String extension = FileUtils.getFileExtension(fileName);
-264 if (extension != null ) {
-265 if (extensions.contains(extension)) {
-266 final Dependency dependency = new Dependency (file);
-267 dependencies.add(dependency);
-268 }
-269 } else {
-270 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
-271 file.toString());
-272 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, msg);
-273 }
-274 }
-275
-276
-277
-278
-279 public void analyzeDependencies() {
-280
-281 for (AnalysisPhase phase : AnalysisPhase.values()) {
-282 final List<Analyzer> analyzerList = analyzers.get(phase);
-283 for (Analyzer a : analyzerList) {
-284 try {
-285 final String msg = String.format("Initializing %s" , a.getName());
-286 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
-287 a.initialize();
-288 } catch (Exception ex) {
-289 final String msg = String.format("Exception occurred initializing %s." , a.getName());
-290 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
-291 Logger.getLogger(Engine.class .getName()).log(Level.INFO, null , ex);
-292 try {
-293 a.close();
-294 } catch (Exception ex1) {
-295 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex1);
-296 }
-297 }
-298 }
-299 }
-300
-301
-302 for (AnalysisPhase phase : AnalysisPhase.values()) {
-303 final List<Analyzer> analyzerList = analyzers.get(phase);
-304
-305 for (Analyzer a : analyzerList) {
-306
-307
-308
-309
-310 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
-311 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
-312 final Set<Dependency> dependencySet = new HashSet<Dependency>();
-313 dependencySet.addAll(dependencies);
-314 for (Dependency d : dependencySet) {
-315 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
-316 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msgFile);
-317 if (a.supportsExtension(d.getFileExtension())) {
-318 try {
-319 a.analyze(d, this );
-320 } catch (AnalysisException ex) {
-321 d.addAnalysisException(ex);
-322 }
-323 }
-324 }
-325 }
-326 }
-327
-328
-329 for (AnalysisPhase phase : AnalysisPhase.values()) {
-330 final List<Analyzer> analyzerList = analyzers.get(phase);
-331 for (Analyzer a : analyzerList) {
-332 final String msg = String.format("Closing Analyzer '%s'" , a.getName());
-333 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
-334 try {
-335 a.close();
-336 } catch (Exception ex) {
-337 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex);
-338 }
-339 }
-340 }
-341 }
-342
-343
-344
-345
-346
-347 private void doUpdates() {
-348 final UpdateService service = UpdateService.getInstance();
-349 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
-350 while (iterator.hasNext()) {
-351 final CachedWebDataSource source = iterator.next();
-352 try {
-353 source.update();
-354 } catch (UpdateException ex) {
-355 Logger.getLogger(Engine.class .getName()).log(Level.WARNING,
-356 "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
-357 Logger.getLogger(Engine.class .getName()).log(Level.FINE,
-358 String.format("Unable to update details for %s" , source.getClass().getName()), ex);
-359 }
-360 }
-361 }
-362
-363
-364
-365
-366
-367
-368
-369 public List<Analyzer> getAnalyzers() {
-370 final List<Analyzer> ret = new ArrayList<Analyzer>();
-371 for (AnalysisPhase phase : AnalysisPhase.values()) {
-372 final List<Analyzer> analyzerList = analyzers.get(phase);
-373 ret.addAll(analyzerList);
-374 }
-375 return ret;
-376 }
-377
-378
-379
-380
-381
-382
-383
-384
-385 public boolean supportsExtension(String ext) {
-386 if (ext == null ) {
-387 return false;
-388 }
-389 for (AnalysisPhase phase : AnalysisPhase.values()) {
-390 final List<Analyzer> analyzerList = analyzers.get(phase);
-391 for (Analyzer a : analyzerList) {
-392 if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) {
-393 return true ;
-394 }
-395 }
-396 }
-397 return false;
-398 }
-399 }
+79 if (autoUpdate) {
+80 doUpdates();
+81 }
+82 loadAnalyzers();
+83 }
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94 @Deprecated
+95 public Engine (boolean autoUpdate) {
+96 if (autoUpdate) {
+97 doUpdates();
+98 }
+99 loadAnalyzers();
+100 }
+101
+102
+103
+104
+105
+106 private void loadAnalyzers() {
+107
+108 for (AnalysisPhase phase : AnalysisPhase.values()) {
+109 analyzers.put(phase, new ArrayList<Analyzer>());
+110 }
+111
+112 final AnalyzerService service = AnalyzerService.getInstance();
+113 final Iterator<Analyzer> iterator = service.getAnalyzers();
+114 while (iterator.hasNext()) {
+115 final Analyzer a = iterator.next();
+116 analyzers.get(a.getAnalysisPhase()).add(a);
+117 if (a.getSupportedExtensions() != null ) {
+118 extensions.addAll(a.getSupportedExtensions());
+119 }
+120 }
+121 }
+122
+123
+124
+125
+126
+127
+128
+129 public List<Analyzer> getAnalyzers(AnalysisPhase phase) {
+130 return analyzers.get(phase);
+131 }
+132
+133
+134
+135
+136
+137
+138 public List<Dependency> getDependencies() {
+139 return dependencies;
+140 }
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151 public void scan(String[] paths) {
+152 for (String path : paths) {
+153 final File file = new File(path);
+154 scan(file);
+155 }
+156 }
+157
+158
+159
+160
+161
+162
+163
+164
+165 public void scan(String path) {
+166 final File file = new File(path);
+167 scan(file);
+168 }
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179 public void scan(File[] files) {
+180 for (File file : files) {
+181 scan(file);
+182 }
+183 }
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194 public void scan(Set<File> files) {
+195 for (File file : files) {
+196 scan(file);
+197 }
+198 }
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209 public void scan(List<File> files) {
+210 for (File file : files) {
+211 scan(file);
+212 }
+213 }
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224 public void scan(File file) {
+225 if (file.exists()) {
+226 if (file.isDirectory()) {
+227 scanDirectory(file);
+228 } else {
+229 scanFile(file);
+230 }
+231 }
+232 }
+233
+234
+235
+236
+237
+238
+239
+240 protected void scanDirectory(File dir) {
+241 final File[] files = dir.listFiles();
+242 if (files != null ) {
+243 for (File f : files) {
+244 if (f.isDirectory()) {
+245 scanDirectory(f);
+246 } else {
+247 scanFile(f);
+248 }
+249 }
+250 }
+251 }
+252
+253
+254
+255
+256
+257
+258
+259 protected void scanFile(File file) {
+260 if (!file.isFile()) {
+261 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+262 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+263 return ;
+264 }
+265 final String fileName = file.getName();
+266 final String extension = FileUtils.getFileExtension(fileName);
+267 if (extension != null ) {
+268 if (extensions.contains(extension)) {
+269 final Dependency dependency = new Dependency (file);
+270 dependencies.add(dependency);
+271 }
+272 } else {
+273 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
+274 file.toString());
+275 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, msg);
+276 }
+277 }
+278
+279
+280
+281
+282 public void analyzeDependencies() {
+283
+284 try {
+285 ensureDataExists();
+286 } catch (NoDataException ex) {
+287 final String msg = String.format("%n%n%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+288 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
+289 Logger.getLogger(Engine.class .getName()).log(Level.FINE, null , ex);
+290 return ;
+291 }
+292
+293
+294 for (AnalysisPhase phase : AnalysisPhase.values()) {
+295 final List<Analyzer> analyzerList = analyzers.get(phase);
+296 for (Analyzer a : analyzerList) {
+297 try {
+298 final String msg = String.format("Initializing %s" , a.getName());
+299 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+300 a.initialize();
+301 } catch (Exception ex) {
+302 final String msg = String.format("Exception occurred initializing %s." , a.getName());
+303 Logger.getLogger(Engine.class .getName()).log(Level.SEVERE, msg);
+304 Logger.getLogger(Engine.class .getName()).log(Level.INFO, null , ex);
+305 try {
+306 a.close();
+307 } catch (Exception ex1) {
+308 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex1);
+309 }
+310 }
+311 }
+312 }
+313
+314
+315 for (AnalysisPhase phase : AnalysisPhase.values()) {
+316 final List<Analyzer> analyzerList = analyzers.get(phase);
+317
+318 for (Analyzer a : analyzerList) {
+319
+320
+321
+322
+323 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+324 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+325 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+326 dependencySet.addAll(dependencies);
+327 for (Dependency d : dependencySet) {
+328 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+329 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msgFile);
+330 if (a.supportsExtension(d.getFileExtension())) {
+331 try {
+332 a.analyze(d, this );
+333 } catch (AnalysisException ex) {
+334 d.addAnalysisException(ex);
+335 }
+336 }
+337 }
+338 }
+339 }
+340
+341
+342 for (AnalysisPhase phase : AnalysisPhase.values()) {
+343 final List<Analyzer> analyzerList = analyzers.get(phase);
+344 for (Analyzer a : analyzerList) {
+345 final String msg = String.format("Closing Analyzer '%s'" , a.getName());
+346 Logger.getLogger(Engine.class .getName()).log(Level.FINE, msg);
+347 try {
+348 a.close();
+349 } catch (Exception ex) {
+350 Logger.getLogger(Engine.class .getName()).log(Level.FINEST, null , ex);
+351 }
+352 }
+353 }
+354 }
+355
+356
+357
+358
+359
+360 private void doUpdates() {
+361 final UpdateService service = UpdateService.getInstance();
+362 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+363 while (iterator.hasNext()) {
+364 final CachedWebDataSource source = iterator.next();
+365 try {
+366 source.update();
+367 } catch (UpdateException ex) {
+368 Logger.getLogger(Engine.class .getName()).log(Level.WARNING,
+369 "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
+370 Logger.getLogger(Engine.class .getName()).log(Level.FINE,
+371 String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+372 }
+373 }
+374 }
+375
+376
+377
+378
+379
+380
+381
+382 public List<Analyzer> getAnalyzers() {
+383 final List<Analyzer> ret = new ArrayList<Analyzer>();
+384 for (AnalysisPhase phase : AnalysisPhase.values()) {
+385 final List<Analyzer> analyzerList = analyzers.get(phase);
+386 ret.addAll(analyzerList);
+387 }
+388 return ret;
+389 }
+390
+391
+392
+393
+394
+395
+396
+397
+398 public boolean supportsExtension(String ext) {
+399 if (ext == null ) {
+400 return false;
+401 }
+402 for (AnalysisPhase phase : AnalysisPhase.values()) {
+403 final List<Analyzer> analyzerList = analyzers.get(phase);
+404 for (Analyzer a : analyzerList) {
+405 if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) {
+406 return true ;
+407 }
+408 }
+409 }
+410 return false;
+411 }
+412
+413
+414
+415
+416
+417
+418
+419 private void ensureDataExists() throws NoDataException {
+420 CpeIndexReader cpe = null ;
+421 boolean noDataExists = false;
+422 try {
+423 cpe = new CpeIndexReader ();
+424 cpe.open();
+425 if (cpe.numDocs() <= 0) {
+426 noDataExists = true ;
+427 }
+428 } catch (IOException ex) {
+429 noDataExists = true ;
+430 } catch (NullPointerException ex) {
+431 noDataExists = true ;
+432 } finally {
+433 if (cpe != null ) {
+434 cpe.close();
+435 }
+436 }
+437 if (noDataExists) {
+438 throw new NoDataException ("No data exists in the data store. Please check that you are able to connect "
+439 + "to the Internet and re-run dependency-check. If the problem persists determine whether you need "
+440 + "to set a proxy url and port.\\n\\nIf you are unable to solve this problem please contact the mailing "
+441 + "list for help: dependency-check@googlegroups.com" );
+442
+443 }
+444 }
+445 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
index 44d7c5ccf..f81ec6b76 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
@@ -42,296 +42,368 @@
32 import java.util.Set;
33 import java.util.logging.Level;
34 import java.util.logging.Logger;
-35
-36
-37
-38 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-39 import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
-40 import org.h2.store.fs.FileUtils;
-41 import org.owasp.dependencycheck.Engine;
-42 import org.owasp.dependencycheck.dependency.Dependency;
-43 import org.owasp.dependencycheck.utils.Settings;
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61 public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
-62
-63
-64
-65
-66 private static final int BUFFER_SIZE = 4096;
-67
-68
-69
-70
-71 private static int dirCount = 0;
-72
-73
-74
-75 private File tempFileLocation = null ;
-76
-77
-78
-79
-80 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
-81
-82
-83
-84 private int scanDepth = 0;
-85
+35 import org.apache.commons.compress.archivers.ArchiveEntry;
+36 import org.apache.commons.compress.archivers.ArchiveInputStream;
+37 import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+38 import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
+39 import org.apache.commons.compress.compressors.CompressorInputStream;
+40 import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
+41 import org.apache.commons.compress.compressors.gzip.GzipUtils;
+42 import org.h2.store.fs.FileUtils;
+43 import org.owasp.dependencycheck.Engine;
+44 import org.owasp.dependencycheck.dependency.Dependency;
+45 import org.owasp.dependencycheck.utils.Settings;
+46
+47
+48
+49
+50
+51
+52
+53 public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
+54
+55
+56
+57
+58 private static final int BUFFER_SIZE = 4096;
+59
+60
+61
+62
+63 private static int dirCount = 0;
+64
+65
+66
+67 private File tempFileLocation = null ;
+68
+69
+70
+71
+72 private static final int MAX_SCAN_DEPTH = Settings.getInt("archive.scan.depth" , 3);
+73
+74
+75
+76 private int scanDepth = 0;
+77
+78
+79
+80
+81 private static final String ANALYZER_NAME = "Archive Analyzer" ;
+82
+83
+84
+85 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
86
-87
+87
88
-89 private static final String ANALYZER_NAME = "Archive Analyzer" ;
-90
-91
-92
-93 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INITIAL;
-94
-95
-96
-97 private static final Set<String> EXTENSIONS = newHashSet("zip" , "ear" , "war" );
-98
-99
-100
-101
-102
-103
-104 public Set<String> getSupportedExtensions() {
-105 return EXTENSIONS;
-106 }
-107
-108
-109
-110
-111
-112
-113 public String getName() {
-114 return ANALYZER_NAME;
-115 }
-116
-117
-118
-119
-120
-121
-122
-123
-124 public boolean supportsExtension(String extension) {
-125 return EXTENSIONS.contains(extension);
-126 }
-127
-128
-129
-130
-131
-132
-133 public AnalysisPhase getAnalysisPhase() {
-134 return ANALYSIS_PHASE;
-135 }
-136
-137
-138
-139
-140
-141
-142
-143
-144 @Override
-145 public void initialize() throws Exception {
-146 final File baseDir = Settings.getTempDirectory();
-147 if (!baseDir.exists()) {
-148 if (!baseDir.mkdirs()) {
-149 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
-150 throw new AnalysisException (msg);
-151 }
-152 }
-153 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
-154 if (!tempFileLocation.delete()) {
-155 throw new AnalysisException ("Unable to delete temporary file '" + tempFileLocation.getAbsolutePath() + "'." );
-156 }
-157 if (!tempFileLocation.mkdirs()) {
-158 throw new AnalysisException ("Unable to create directory '" + tempFileLocation.getAbsolutePath() + "'." );
-159 }
-160 }
-161
-162
-163
-164
-165
-166
-167
-168 @Override
-169 public void close() throws Exception {
-170 if (tempFileLocation != null && tempFileLocation.exists()) {
-171 FileUtils.deleteRecursive(tempFileLocation.getAbsolutePath(), true );
-172 }
-173 }
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184 @Override
-185 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
-186 final File f = new File(dependency.getActualFilePath());
-187 final File tmpDir = getNextTempDirectory();
-188 extractFiles(f, tmpDir, engine);
-189
-190
-191 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
-192 engine.scan(tmpDir);
-193 final List<Dependency> newDependencies = engine.getDependencies();
-194 if (dependencies.size() != newDependencies.size()) {
-195
-196 final Set<Dependency> dependencySet = new HashSet<Dependency>();
-197 dependencySet.addAll(newDependencies);
-198 dependencySet.removeAll(dependencies);
-199
-200 for (Dependency d : dependencySet) {
-201
-202 final String displayPath = String.format("%s%s" ,
-203 dependency.getFilePath(),
-204 d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
-205 final String displayName = String.format("%s%s%s" ,
-206 dependency.getFileName(),
-207 File.separator,
-208 d.getFileName());
-209 d.setFilePath(displayPath);
-210 d.setFileName(displayName);
-211
-212
-213
-214
-215 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
-216 scanDepth += 1;
-217 analyze(d, engine);
-218 scanDepth -= 1;
-219 }
-220 }
-221 }
-222 Collections.sort(engine.getDependencies());
-223 }
-224
-225
-226
-227
-228
-229
-230
-231 private File getNextTempDirectory() throws AnalysisException {
-232 dirCount += 1;
-233 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
-234 if (!directory.mkdirs()) {
-235 throw new AnalysisException ("Unable to create temp directory '" + directory.getAbsolutePath() + "'." );
-236 }
-237 return directory;
-238 }
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248 private void extractFiles(File archive, File extractTo, Engine engine) throws AnalysisException {
-249 if (archive == null || extractTo == null ) {
-250 return ;
-251 }
-252
-253 FileInputStream fis = null ;
-254
-255 ZipArchiveInputStream zis = null ;
-256
-257 try {
-258 fis = new FileInputStream(archive);
-259 } catch (FileNotFoundException ex) {
-260 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.INFO, null , ex);
-261 throw new AnalysisException ("Archive file was not found." , ex);
-262 }
-263 zis = new ZipArchiveInputStream(new BufferedInputStream(fis));
-264 ZipArchiveEntry entry;
-265
-266 try {
-267 while ((entry = zis.getNextZipEntry()) != null ) {
-268 if (entry.isDirectory()) {
-269 final File d = new File(extractTo, entry.getName());
-270 if (!d.mkdirs()) {
-271 throw new AnalysisException ("Unable to create '" + d.getAbsolutePath() + "'." );
-272 }
-273 } else {
-274 final File file = new File(extractTo, entry.getName());
-275 final String ext = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(file.getName());
-276 if (engine.supportsExtension(ext)) {
-277 BufferedOutputStream bos = null ;
-278 FileOutputStream fos;
-279 try {
-280 fos = new FileOutputStream(file);
-281 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
-282 int count;
-283 final byte data[] = new byte[BUFFER_SIZE];
-284 while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
-285 bos.write(data, 0, count);
-286 }
-287 bos.flush();
-288 } catch (FileNotFoundException ex) {
-289 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
-290 throw new AnalysisException ("Unable to find file '" + file.getName() + "'." , ex);
-291 } catch (IOException ex) {
-292 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
-293 throw new AnalysisException ("IO Exception while parsing file '" + file.getName() + "'." , ex);
-294 } finally {
-295 if (bos != null ) {
-296 try {
-297 bos.close();
-298 } catch (IOException ex) {
-299 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
-300 }
-301 }
-302 }
-303 }
-304 }
-305 }
-306 } catch (IOException ex) {
-307 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
-308 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
-309 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
-310 throw new AnalysisException (msg, ex);
-311 } catch (Throwable ex) {
-312 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
-313 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
-314 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, null , ex);
-315 throw new AnalysisException (msg, ex);
-316 } finally {
-317 try {
-318 zis.close();
-319 } catch (IOException ex) {
-320 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
-321 }
-322 }
-323 }
-324 }
+89 private static final Set<String> EXTENSIONS = newHashSet("zip" , "ear" , "war" , "tar" , "gz" , "tgz" );
+90
+91
+92
+93
+94
+95
+96 public Set<String> getSupportedExtensions() {
+97 return EXTENSIONS;
+98 }
+99
+100
+101
+102
+103
+104
+105 public String getName() {
+106 return ANALYZER_NAME;
+107 }
+108
+109
+110
+111
+112
+113
+114
+115
+116 public boolean supportsExtension(String extension) {
+117 return EXTENSIONS.contains(extension);
+118 }
+119
+120
+121
+122
+123
+124
+125 public AnalysisPhase getAnalysisPhase() {
+126 return ANALYSIS_PHASE;
+127 }
+128
+129
+130
+131
+132
+133
+134
+135
+136 @Override
+137 public void initialize() throws Exception {
+138 final File baseDir = Settings.getTempDirectory();
+139 if (!baseDir.exists()) {
+140 if (!baseDir.mkdirs()) {
+141 final String msg = String.format("Unable to make a temporary folder '%s'" , baseDir.getPath());
+142 throw new AnalysisException (msg);
+143 }
+144 }
+145 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+146 if (!tempFileLocation.delete()) {
+147 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+148 throw new AnalysisException (msg);
+149 }
+150 if (!tempFileLocation.mkdirs()) {
+151 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+152 throw new AnalysisException (msg);
+153 }
+154 }
+155
+156
+157
+158
+159
+160
+161
+162 @Override
+163 public void close() throws Exception {
+164 if (tempFileLocation != null && tempFileLocation.exists()) {
+165 FileUtils.deleteRecursive(tempFileLocation.getAbsolutePath(), true );
+166 }
+167 }
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178 @Override
+179 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+180 final File f = new File(dependency.getActualFilePath());
+181 final File tmpDir = getNextTempDirectory();
+182 extractFiles(f, tmpDir, engine);
+183
+184
+185 final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
+186 engine.scan(tmpDir);
+187 final List<Dependency> newDependencies = engine.getDependencies();
+188 if (dependencies.size() != newDependencies.size()) {
+189
+190 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+191 dependencySet.addAll(newDependencies);
+192 dependencySet.removeAll(dependencies);
+193
+194 for (Dependency d : dependencySet) {
+195
+196 final String displayPath = String.format("%s%s" ,
+197 dependency.getFilePath(),
+198 d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
+199 final String displayName = String.format("%s%s%s" ,
+200 dependency.getFileName(),
+201 File.separator,
+202 d.getFileName());
+203 d.setFilePath(displayPath);
+204 d.setFileName(displayName);
+205
+206
+207
+208
+209 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
+210 scanDepth += 1;
+211 analyze(d, engine);
+212 scanDepth -= 1;
+213 }
+214 }
+215 }
+216 Collections.sort(engine.getDependencies());
+217 }
+218
+219
+220
+221
+222
+223
+224
+225 private File getNextTempDirectory() throws AnalysisException {
+226 dirCount += 1;
+227 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+228
+229 if (directory.exists()) {
+230 return getNextTempDirectory();
+231 }
+232 if (!directory.mkdirs()) {
+233 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+234 throw new AnalysisException (msg);
+235 }
+236 return directory;
+237 }
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247 private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
+248 if (archive == null || destination == null ) {
+249 return ;
+250 }
+251
+252 FileInputStream fis = null ;
+253 try {
+254 fis = new FileInputStream(archive);
+255 } catch (FileNotFoundException ex) {
+256 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.INFO, null , ex);
+257 throw new AnalysisException ("Archive file was not found." , ex);
+258 }
+259 final String archiveExt = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(archive.getName()).toLowerCase();
+260 try {
+261 if ("zip" .equals(archiveExt) || "war" .equals(archiveExt) || "ear" .equals(archiveExt)) {
+262 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+263 } else if ("tar" .equals(archiveExt)) {
+264 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+265 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
+266 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
+267 final String uncompressedExt = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(uncompressedName).toLowerCase();
+268 if (engine.supportsExtension(uncompressedExt)) {
+269 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
+270 }
+271 }
+272 } catch (ArchiveExtractionException ex) {
+273 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
+274 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
+275 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+276 } catch (IOException ex) {
+277 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+278 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.WARNING, msg);
+279 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+280 } finally {
+281 try {
+282 fis.close();
+283 } catch (IOException ex) {
+284 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+285 }
+286 }
+287 }
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298 private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
+299 ArchiveEntry entry;
+300 try {
+301 while ((entry = input.getNextEntry()) != null ) {
+302 if (entry.isDirectory()) {
+303 final File d = new File(destination, entry.getName());
+304 if (!d.exists()) {
+305 if (!d.mkdirs()) {
+306 final String msg = String.format("Unable to create '%s'." , d.getAbsolutePath());
+307 throw new AnalysisException (msg);
+308 }
+309 }
+310 } else {
+311 final File file = new File(destination, entry.getName());
+312 final String ext = org.owasp.dependencycheck.utils.FileUtils.getFileExtension(file.getName());
+313 if (engine.supportsExtension(ext)) {
+314 BufferedOutputStream bos = null ;
+315 FileOutputStream fos;
+316 try {
+317 fos = new FileOutputStream(file);
+318 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+319 int count;
+320 final byte data[] = new byte[BUFFER_SIZE];
+321 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+322 bos.write(data, 0, count);
+323 }
+324 bos.flush();
+325 } catch (FileNotFoundException ex) {
+326 Logger.getLogger(ArchiveAnalyzer.class
+327 .getName()).log(Level.FINE, null , ex);
+328 final String msg = String.format("Unable to find file '%s'." , file.getName());
+329 throw new AnalysisException (msg, ex);
+330 } catch (IOException ex) {
+331 Logger.getLogger(ArchiveAnalyzer.class
+332 .getName()).log(Level.FINE, null , ex);
+333 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+334 throw new AnalysisException (msg, ex);
+335 } finally {
+336 if (bos != null ) {
+337 try {
+338 bos.close();
+339 } catch (IOException ex) {
+340 Logger.getLogger(ArchiveAnalyzer.class
+341 .getName()).log(Level.FINEST, null , ex);
+342 }
+343 }
+344 }
+345 }
+346 }
+347 }
+348 } catch (IOException ex) {
+349 throw new ArchiveExtractionException (ex);
+350 } catch (Throwable ex) {
+351 throw new ArchiveExtractionException (ex);
+352 } finally {
+353 if (input != null ) {
+354 try {
+355 input.close();
+356 } catch (IOException ex) {
+357 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+358 }
+359 }
+360 }
+361 }
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371 private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
+372 FileOutputStream out = null ;
+373 try {
+374 out = new FileOutputStream(outputFile);
+375 final byte[] buffer = new byte[BUFFER_SIZE];
+376 int n = 0;
+377 while (-1 != (n = inputStream.read(buffer))) {
+378 out.write(buffer, 0, n);
+379 }
+380 } catch (FileNotFoundException ex) {
+381 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+382 throw new ArchiveExtractionException (ex);
+383 } catch (IOException ex) {
+384 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINE, null , ex);
+385 throw new ArchiveExtractionException (ex);
+386 } finally {
+387 if (out != null ) {
+388 try {
+389 out.close();
+390 } catch (IOException ex) {
+391 Logger.getLogger(ArchiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+392 }
+393 }
+394 }
+395 }
+396 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
index 08519a7da..b13dfc8d6 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
@@ -33,309 +33,324 @@
23 import java.util.Iterator;
24 import java.util.ListIterator;
25 import java.util.Set;
-26 import java.util.regex.Matcher;
-27 import java.util.regex.Pattern;
-28 import org.owasp.dependencycheck.Engine;
-29 import org.owasp.dependencycheck.dependency.Dependency;
-30 import org.owasp.dependencycheck.utils.DependencyVersion;
-31 import org.owasp.dependencycheck.utils.DependencyVersionUtil;
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44 public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Analyzer {
-45
-46
-47
-48
-49
-50 private static final Pattern STARTING_TEXT_PATTERN = Pattern.compile("^[a-zA-Z]*" );
-51
-52
-53
-54 private boolean analyzed = false;
-55
-56
-57
-58
-59
-60 private static final Set<String> EXTENSIONS = null ;
-61
-62
-63
-64 private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
-65
-66
-67
-68 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
-69
-70
-71
-72
-73
-74
-75 public Set<String> getSupportedExtensions() {
-76 return EXTENSIONS;
-77 }
-78
-79
-80
-81
-82
-83
-84 public String getName() {
-85 return ANALYZER_NAME;
-86 }
-87
-88
-89
-90
-91
-92
-93
-94
-95 public boolean supportsExtension(String extension) {
-96 return true ;
-97 }
-98
-99
-100
-101
-102
-103
-104 public AnalysisPhase getAnalysisPhase() {
-105 return ANALYSIS_PHASE;
-106 }
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119 @Override
-120 public void analyze(Dependency ignore, Engine engine) throws AnalysisException {
-121 if (!analyzed) {
-122 analyzed = true ;
-123 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
-124 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
-125
-126 while (mainIterator.hasNext()) {
-127 final Dependency dependency = mainIterator.next();
-128 if (mainIterator.hasNext()) {
-129 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
-130 while (subIterator.hasNext()) {
-131 final Dependency nextDependency = subIterator.next();
-132
-133 if (identifiersMatch(dependency, nextDependency)
-134 && hasSameBasePath(dependency, nextDependency)
-135 && fileNameMatch(dependency, nextDependency)) {
-136
-137 if (isCore(dependency, nextDependency)) {
-138 dependency.addRelatedDependency(nextDependency);
-139
-140 final Iterator<Dependency> i = nextDependency.getRelatedDependencies().iterator();
-141 while (i.hasNext()) {
-142 dependency.addRelatedDependency(i.next());
-143 i.remove();
-144 }
-145 dependenciesToRemove.add(nextDependency);
-146 } else {
-147 if (isCore(nextDependency, dependency)) {
-148 nextDependency.addRelatedDependency(dependency);
-149
-150 final Iterator<Dependency> i = dependency.getRelatedDependencies().iterator();
-151 while (i.hasNext()) {
-152 nextDependency.addRelatedDependency(i.next());
-153 i.remove();
-154 }
-155 dependenciesToRemove.add(dependency);
+26 import java.util.logging.Level;
+27 import java.util.logging.Logger;
+28 import java.util.regex.Matcher;
+29 import java.util.regex.Pattern;
+30 import org.owasp.dependencycheck.Engine;
+31 import org.owasp.dependencycheck.dependency.Dependency;
+32 import org.owasp.dependencycheck.utils.DependencyVersion;
+33 import org.owasp.dependencycheck.utils.DependencyVersionUtil;
+34 import org.owasp.dependencycheck.utils.LogUtils;
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47 public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Analyzer {
+48
+49
+50
+51
+52
+53 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 Set<String> EXTENSIONS = null ;
+64
+65
+66
+67 private static final String ANALYZER_NAME = "Dependency Bundling Analyzer" ;
+68
+69
+70
+71 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.PRE_FINDING_ANALYSIS;
+72
+73
+74
+75
+76
+77
+78 public Set<String> getSupportedExtensions() {
+79 return EXTENSIONS;
+80 }
+81
+82
+83
+84
+85
+86
+87 public String getName() {
+88 return ANALYZER_NAME;
+89 }
+90
+91
+92
+93
+94
+95
+96
+97
+98 public boolean supportsExtension(String extension) {
+99 return true ;
+100 }
+101
+102
+103
+104
+105
+106
+107 public AnalysisPhase getAnalysisPhase() {
+108 return ANALYSIS_PHASE;
+109 }
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122 @Override
+123 public void analyze(Dependency ignore, Engine engine) throws AnalysisException {
+124 if (!analyzed) {
+125 analyzed = true ;
+126 final Set<Dependency> dependenciesToRemove = new HashSet<Dependency>();
+127 final ListIterator<Dependency> mainIterator = engine.getDependencies().listIterator();
+128
+129 while (mainIterator.hasNext()) {
+130 final Dependency dependency = mainIterator.next();
+131 if (mainIterator.hasNext()) {
+132 final ListIterator<Dependency> subIterator = engine.getDependencies().listIterator(mainIterator.nextIndex());
+133 while (subIterator.hasNext()) {
+134 final Dependency nextDependency = subIterator.next();
+135
+136 if (identifiersMatch(dependency, nextDependency)
+137 && hasSameBasePath(dependency, nextDependency)
+138 && fileNameMatch(dependency, nextDependency)) {
+139
+140 if (isCore(dependency, nextDependency)) {
+141 dependency.addRelatedDependency(nextDependency);
+142
+143 final Iterator<Dependency> i = nextDependency.getRelatedDependencies().iterator();
+144 while (i.hasNext()) {
+145 dependency.addRelatedDependency(i.next());
+146 i.remove();
+147 }
+148 dependenciesToRemove.add(nextDependency);
+149 } else {
+150 nextDependency.addRelatedDependency(dependency);
+151
+152 final Iterator<Dependency> i = dependency.getRelatedDependencies().iterator();
+153 while (i.hasNext()) {
+154 nextDependency.addRelatedDependency(i.next());
+155 i.remove();
156 }
-157 }
-158 }
-159 }
-160 }
-161 }
-162
-163
-164 for (Dependency d : dependenciesToRemove) {
-165 engine.getDependencies().remove(d);
-166 }
-167 }
-168 }
-169
-170
-171
-172
-173
-174
-175
-176
-177 private String getBaseRepoPath(final String path) {
-178 int pos = path.indexOf("repository" + File.separator) + 11;
-179 if (pos < 0) {
-180 return path;
-181 }
-182 int tmp = path.indexOf(File.separator, pos);
-183 if (tmp <= 0) {
-184 return path;
-185 }
-186 if (tmp > 0) {
-187 pos = tmp + 1;
-188 }
-189 tmp = path.indexOf(File.separator, pos);
-190 if (tmp > 0) {
-191 pos = tmp + 1;
-192 }
-193 return path.substring(0, pos);
-194 }
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205 private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
-206 if (dependency1 == null || dependency1.getFileName() == null
-207 || dependency2 == null || dependency2.getFileName() == null ) {
-208 return false;
-209 }
-210 String fileName1 = dependency1.getFileName();
-211 String fileName2 = dependency2.getFileName();
-212
-213
-214
-215 final File one = new File(fileName1);
-216 final File two = new File(fileName2);
-217 final String oneParent = one.getParent();
-218 final String twoParent = two.getParent();
-219 if (oneParent != null ) {
-220 if (twoParent != null && oneParent.equals(twoParent)) {
-221 fileName1 = one.getName();
-222 fileName2 = two.getName();
-223 } else {
-224 return false;
-225 }
-226 } else if (twoParent != null ) {
-227 return false;
-228 }
-229
-230
-231 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
-232 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
-233 if (version1 != null && version2 != null ) {
-234 if (!version1.equals(version2)) {
-235 return false;
-236 }
-237 }
-238
-239
-240 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
-241 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
-242 if (match1.find() && match2.find()) {
-243 return match1.group().equals(match2.group());
-244 }
-245
-246 return false;
-247 }
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258 private boolean identifiersMatch(Dependency dependency1, Dependency dependency2) {
-259 if (dependency1 == null || dependency1.getIdentifiers() == null
-260 || dependency2 == null || dependency2.getIdentifiers() == null ) {
-261 return false;
-262 }
-263 return dependency1.getIdentifiers().size() > 0
-264 && dependency2.getIdentifiers().equals(dependency1.getIdentifiers());
-265 }
-266
-267
-268
-269
-270
-271
-272
-273
-274 private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
-275 if (dependency1 == null || dependency2 == null ) {
-276 return false;
-277 }
-278 final File lFile = new File(dependency1.getFilePath());
-279 String left = lFile.getParent();
-280 final File rFile = new File(dependency2.getFilePath());
-281 String right = rFile.getParent();
-282 if (left == null ) {
-283 if (right == null ) {
-284 return true ;
-285 }
-286 return false;
-287 }
-288 if (left.equalsIgnoreCase(right)) {
-289 return true ;
-290 }
-291 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
-292 left = getBaseRepoPath(left);
-293 right = getBaseRepoPath(right);
-294 }
-295 return left.equalsIgnoreCase(right);
-296 }
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311 private boolean isCore(Dependency left, Dependency right) {
-312 final String leftName = left.getFileName().toLowerCase();
-313 final String rightName = right.getFileName().toLowerCase();
-314
-315 if (rightName.contains("core" ) && !leftName.contains("core" )) {
-316 return false;
-317 } else if (!rightName.contains("core" ) && leftName.contains("core" )) {
-318 return true ;
-319 } else {
-320
-321
-322 if (leftName.length() > rightName.length()) {
-323 return false;
-324 }
-325 return true ;
-326 }
-327 }
-328 }
+157 dependenciesToRemove.add(dependency);
+158 }
+159 }
+160 }
+161 }
+162 }
+163
+164
+165 for (Dependency d : dependenciesToRemove) {
+166 engine.getDependencies().remove(d);
+167 }
+168 }
+169 }
+170
+171
+172
+173
+174
+175
+176
+177
+178 private String getBaseRepoPath(final String path) {
+179 int pos = path.indexOf("repository" + File.separator) + 11;
+180 if (pos < 0) {
+181 return path;
+182 }
+183 int tmp = path.indexOf(File.separator, pos);
+184 if (tmp <= 0) {
+185 return path;
+186 }
+187 if (tmp > 0) {
+188 pos = tmp + 1;
+189 }
+190 tmp = path.indexOf(File.separator, pos);
+191 if (tmp > 0) {
+192 pos = tmp + 1;
+193 }
+194 return path.substring(0, pos);
+195 }
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206 private boolean fileNameMatch(Dependency dependency1, Dependency dependency2) {
+207 if (dependency1 == null || dependency1.getFileName() == null
+208 || dependency2 == null || dependency2.getFileName() == null ) {
+209 return false;
+210 }
+211 String fileName1 = dependency1.getFileName();
+212 String fileName2 = dependency2.getFileName();
+213
+214
+215
+216 final File one = new File(fileName1);
+217 final File two = new File(fileName2);
+218 final String oneParent = one.getParent();
+219 final String twoParent = two.getParent();
+220 if (oneParent != null ) {
+221 if (twoParent != null && oneParent.equals(twoParent)) {
+222 fileName1 = one.getName();
+223 fileName2 = two.getName();
+224 } else {
+225 return false;
+226 }
+227 } else if (twoParent != null ) {
+228 return false;
+229 }
+230
+231
+232 final DependencyVersion version1 = DependencyVersionUtil.parseVersion(fileName1);
+233 final DependencyVersion version2 = DependencyVersionUtil.parseVersion(fileName2);
+234 if (version1 != null && version2 != null ) {
+235 if (!version1.equals(version2)) {
+236 return false;
+237 }
+238 }
+239
+240
+241 final Matcher match1 = STARTING_TEXT_PATTERN.matcher(fileName1);
+242 final Matcher match2 = STARTING_TEXT_PATTERN.matcher(fileName2);
+243 if (match1.find() && match2.find()) {
+244 return match1.group().equals(match2.group());
+245 }
+246
+247 return false;
+248 }
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259 private boolean identifiersMatch(Dependency dependency1, Dependency dependency2) {
+260 if (dependency1 == null || dependency1.getIdentifiers() == null
+261 || dependency2 == null || dependency2.getIdentifiers() == null ) {
+262 return false;
+263 }
+264 final boolean matches = dependency1.getIdentifiers().size() > 0
+265 && dependency2.getIdentifiers().equals(dependency1.getIdentifiers());
+266 if (LogUtils.isVerboseLoggingEnabled()) {
+267 final String msg = String.format("IdentifiersMatch=%s (%s, %s)" , matches, dependency1.getFileName(), dependency2.getFileName());
+268 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
+269 }
+270 return matches;
+271 }
+272
+273
+274
+275
+276
+277
+278
+279
+280 private boolean hasSameBasePath(Dependency dependency1, Dependency dependency2) {
+281 if (dependency1 == null || dependency2 == null ) {
+282 return false;
+283 }
+284 final File lFile = new File(dependency1.getFilePath());
+285 String left = lFile.getParent();
+286 final File rFile = new File(dependency2.getFilePath());
+287 String right = rFile.getParent();
+288 if (left == null ) {
+289 if (right == null ) {
+290 return true ;
+291 }
+292 return false;
+293 }
+294 if (left.equalsIgnoreCase(right)) {
+295 return true ;
+296 }
+297 if (left.matches(".*[/\\\\]repository[/\\\\].*" ) && right.matches(".*[/\\\\]repository[/\\\\].*" )) {
+298 left = getBaseRepoPath(left);
+299 right = getBaseRepoPath(right);
+300 }
+301 return left.equalsIgnoreCase(right);
+302 }
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313 private boolean isCore(Dependency left, Dependency right) {
+314 final String leftName = left.getFileName().toLowerCase();
+315 final String rightName = right.getFileName().toLowerCase();
+316 final boolean returnVal;
+317 if (rightName.contains("core" ) && !leftName.contains("core" )) {
+318 returnVal = false;
+319 } else if (!rightName.contains("core" ) && leftName.contains("core" )) {
+320 returnVal = true ;
+321 } else {
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331 if (leftName.length() > rightName.length()) {
+332 returnVal = false;
+333 } else {
+334 returnVal = true ;
+335 }
+336 }
+337 if (LogUtils.isVerboseLoggingEnabled()) {
+338 final String msg = String.format("IsCore=%s (%s, %s)" , returnVal, left.getFileName(), right.getFileName());
+339 Logger.getLogger(DependencyBundlingAnalyzer.class .getName()).log(Level.FINE, msg);
+340 }
+341 return returnVal;
+342 }
+343 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
index 07ef48e42..879c1e8c9 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
@@ -119,230 +119,266 @@
109 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
110 removeJreEntries(dependency);
111 removeBadMatches(dependency);
-112 removeSpuriousCPE(dependency);
-113 addFalseNegativeCPEs(dependency);
-114 }
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132 private void removeSpuriousCPE(Dependency dependency) {
-133 final List<Identifier> ids = new ArrayList<Identifier>();
-134 ids.addAll(dependency.getIdentifiers());
-135 Collections.sort(ids);
-136 final ListIterator<Identifier> mainItr = ids.listIterator();
-137 while (mainItr.hasNext()) {
-138 final Identifier currentId = mainItr.next();
-139 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
-140 if (currentCpe == null ) {
-141 continue ;
-142 }
-143 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
-144 while (subItr.hasNext()) {
-145 final Identifier nextId = subItr.next();
-146 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
-147 if (nextCpe == null ) {
-148 continue ;
-149 }
-150
-151 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
-152 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
-153
-154 final String currentVersion = currentCpe.getVersion();
-155 final String nextVersion = nextCpe.getVersion();
-156 if (currentVersion == null && nextVersion == null ) {
-157
-158 Logger.getLogger(FalsePositiveAnalyzer.class
-159 .getName()).log(Level.FINE, "currentVersion and nextVersion are both null?" );
-160 } else if (currentVersion == null && nextVersion != null ) {
-161 dependency.getIdentifiers().remove(currentId);
-162 } else if (nextVersion == null && currentVersion != null ) {
-163 dependency.getIdentifiers().remove(nextId);
-164 } else if (currentVersion.length() < nextVersion.length()) {
-165 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
-166 dependency.getIdentifiers().remove(currentId);
-167 }
-168 } else {
-169 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
-170 dependency.getIdentifiers().remove(nextId);
-171 }
-172 }
-173 }
-174 }
-175 }
-176 }
-177 }
-178
-179
-180
-181
-182 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
-183 + "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
-184 + "jdk|jre|jsf|jsse)($|:.*)" );
-185
-186
-187
-188 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
-189
-190
-191
-192
-193
-194
-195
-196 private void removeJreEntries(Dependency dependency) {
-197 final Set<Identifier> identifiers = dependency.getIdentifiers();
-198 final Iterator<Identifier> itr = identifiers.iterator();
-199 while (itr.hasNext()) {
-200 final Identifier i = itr.next();
-201 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
-202 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
-203 if (coreCPE.matches() && !coreFiles.matches()) {
-204 itr.remove();
-205 }
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227 }
-228 }
-229
-230
-231
-232
-233
-234
-235
-236
-237 private VulnerableSoftware parseCpe(String type, String value) {
-238 if (!"cpe" .equals(type)) {
-239 return null ;
-240 }
-241 final VulnerableSoftware cpe = new VulnerableSoftware ();
-242 try {
-243 cpe.parseName(value);
-244 } catch (UnsupportedEncodingException ex) {
-245 Logger.getLogger(FalsePositiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
-246 return null ;
-247 }
-248 return cpe;
-249 }
-250
-251
-252
-253
-254
-255
-256
-257
-258 private void removeBadMatches(Dependency dependency) {
-259 final Set<Identifier> identifiers = dependency.getIdentifiers();
-260 final Iterator<Identifier> itr = identifiers.iterator();
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271 while (itr.hasNext()) {
-272 final Identifier i = itr.next();
-273
-274 if ("cpe" .equals(i.getType())) {
-275 if ((i.getValue().matches(".*c\\+\\+.*" )
-276 || i.getValue().startsWith("cpe:/a:jquery:jquery" )
-277 || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
-278 || i.getValue().startsWith("cpe:/a:yahoo:yui" )
-279 || i.getValue().startsWith("cpe:/a:file:file" )
-280 || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
-281 || i.getValue().startsWith("cpe:/a:cvs:cvs" )
-282 || i.getValue().startsWith("cpe:/a:ftp:ftp" )
-283 || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
-284 && dependency.getFileName().toLowerCase().endsWith(".jar" )) {
-285 itr.remove();
-286 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
-287 && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
-288 itr.remove();
-289 }
-290 }
-291 }
-292 }
-293
-294
-295
-296
-297
-298
+112 removeWrongVersionMatches(dependency);
+113 removeSpuriousCPE(dependency);
+114 addFalseNegativeCPEs(dependency);
+115 }
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133 @SuppressWarnings("null" )
+134 private void removeSpuriousCPE(Dependency dependency) {
+135 final List<Identifier> ids = new ArrayList<Identifier>();
+136 ids.addAll(dependency.getIdentifiers());
+137 Collections.sort(ids);
+138 final ListIterator<Identifier> mainItr = ids.listIterator();
+139 while (mainItr.hasNext()) {
+140 final Identifier currentId = mainItr.next();
+141 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
+142 if (currentCpe == null ) {
+143 continue ;
+144 }
+145 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
+146 while (subItr.hasNext()) {
+147 final Identifier nextId = subItr.next();
+148 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
+149 if (nextCpe == null ) {
+150 continue ;
+151 }
+152
+153 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
+154 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
+155
+156 final String currentVersion = currentCpe.getVersion();
+157 final String nextVersion = nextCpe.getVersion();
+158 if (currentVersion == null && nextVersion == null ) {
+159
+160 Logger.getLogger(FalsePositiveAnalyzer.class
+161 .getName()).log(Level.FINE, "currentVersion and nextVersion are both null?" );
+162 } else if (currentVersion == null && nextVersion != null ) {
+163 dependency.getIdentifiers().remove(currentId);
+164 } else if (nextVersion == null && currentVersion != null ) {
+165 dependency.getIdentifiers().remove(nextId);
+166 } else if (currentVersion.length() < nextVersion.length()) {
+167 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
+168 dependency.getIdentifiers().remove(currentId);
+169 }
+170 } else {
+171 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
+172 dependency.getIdentifiers().remove(nextId);
+173 }
+174 }
+175 }
+176 }
+177 }
+178 }
+179 }
+180
+181
+182
+183
+184 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+185 + "java(_platfrom_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
+186 + "jdk|jre|jsf|jsse)($|:.*)" );
+187
+188
+189
+190 public static final Pattern CORE_FILES = Pattern.compile("^((alt[-])?rt|jsf[-].*|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+191
+192
+193
+194
+195
+196
+197
+198 private void removeJreEntries(Dependency dependency) {
+199 final Set<Identifier> identifiers = dependency.getIdentifiers();
+200 final Iterator<Identifier> itr = identifiers.iterator();
+201 while (itr.hasNext()) {
+202 final Identifier i = itr.next();
+203 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
+204 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
+205 if (coreCPE.matches() && !coreFiles.matches()) {
+206 itr.remove();
+207 }
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229 }
+230 }
+231
+232
+233
+234
+235
+236
+237
+238
+239 private VulnerableSoftware parseCpe(String type, String value) {
+240 if (!"cpe" .equals(type)) {
+241 return null ;
+242 }
+243 final VulnerableSoftware cpe = new VulnerableSoftware ();
+244 try {
+245 cpe.parseName(value);
+246 } catch (UnsupportedEncodingException ex) {
+247 Logger.getLogger(FalsePositiveAnalyzer.class .getName()).log(Level.FINEST, null , ex);
+248 return null ;
+249 }
+250 return cpe;
+251 }
+252
+253
+254
+255
+256
+257
+258
+259
+260 private void removeBadMatches(Dependency dependency) {
+261 final Set<Identifier> identifiers = dependency.getIdentifiers();
+262 final Iterator<Identifier> itr = identifiers.iterator();
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273 while (itr.hasNext()) {
+274 final Identifier i = itr.next();
+275
+276 if ("cpe" .equals(i.getType())) {
+277 if ((i.getValue().matches(".*c\\+\\+.*" )
+278 || i.getValue().startsWith("cpe:/a:jquery:jquery" )
+279 || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
+280 || i.getValue().startsWith("cpe:/a:yahoo:yui" )
+281 || i.getValue().startsWith("cpe:/a:file:file" )
+282 || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
+283 || i.getValue().startsWith("cpe:/a:cvs:cvs" )
+284 || i.getValue().startsWith("cpe:/a:ftp:ftp" )
+285 || i.getValue().startsWith("cpe:/a:ssh:ssh" ))
+286 && dependency.getFileName().toLowerCase().endsWith(".jar" )) {
+287 itr.remove();
+288 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
+289 && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
+290 itr.remove();
+291 }
+292 }
+293 }
+294 }
+295
+296
+297
+298
299
-300
+300
301
-302 private void addFalseNegativeCPEs(Dependency dependency) {
-303 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
-304 while (itr.hasNext()) {
-305 final Identifier i = itr.next();
-306 if ("cpe" .equals(i.getType()) && i.getValue() != null
-307 && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
-308 || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
-309 || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
-310 || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
-311 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
-312 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
-313 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
-314 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
-315 try {
-316 dependency.addIdentifier("cpe" ,
-317 newCpe,
-318 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
-319 dependency.addIdentifier("cpe" ,
-320 newCpe2,
-321 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
-322 dependency.addIdentifier("cpe" ,
-323 newCpe3,
-324 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
-325 dependency.addIdentifier("cpe" ,
-326 newCpe4,
-327 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
-328 } catch (UnsupportedEncodingException ex) {
-329 Logger.getLogger(FalsePositiveAnalyzer.class
-330 .getName()).log(Level.FINE, null , ex);
-331 }
-332 }
-333 }
-334 }
-335 }
+302 private void removeWrongVersionMatches(Dependency dependency) {
+303 final Set<Identifier> identifiers = dependency.getIdentifiers();
+304 final Iterator<Identifier> itr = identifiers.iterator();
+305
+306 final String fileName = dependency.getFileName();
+307 if (fileName != null && fileName.contains("axis2" )) {
+308 while (itr.hasNext()) {
+309 final Identifier i = itr.next();
+310 if ("cpe" .equals(i.getType())) {
+311 final String cpe = i.getValue();
+312 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
+313 itr.remove();
+314 }
+315 }
+316 }
+317 } else if (fileName != null && fileName.contains("axis" )) {
+318 while (itr.hasNext()) {
+319 final Identifier i = itr.next();
+320 if ("cpe" .equals(i.getType())) {
+321 final String cpe = i.getValue();
+322 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
+323 itr.remove();
+324 }
+325 }
+326 }
+327 }
+328 }
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338 private void addFalseNegativeCPEs(Dependency dependency) {
+339 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+340 while (itr.hasNext()) {
+341 final Identifier i = itr.next();
+342 if ("cpe" .equals(i.getType()) && i.getValue() != null
+343 && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
+344 || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
+345 || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+346 || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
+347 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
+348 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
+349 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
+350 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
+351 try {
+352 dependency.addIdentifier("cpe" ,
+353 newCpe,
+354 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe, "UTF-8" )));
+355 dependency.addIdentifier("cpe" ,
+356 newCpe2,
+357 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe2, "UTF-8" )));
+358 dependency.addIdentifier("cpe" ,
+359 newCpe3,
+360 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe3, "UTF-8" )));
+361 dependency.addIdentifier("cpe" ,
+362 newCpe4,
+363 String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s" , URLEncoder.encode(newCpe4, "UTF-8" )));
+364 } catch (UnsupportedEncodingException ex) {
+365 Logger.getLogger(FalsePositiveAnalyzer.class
+366 .getName()).log(Level.FINE, null , ex);
+367 }
+368 }
+369 }
+370 }
+371 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
index 17d96686d..d005cee14 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.analyzer
@@ -32,6 +32,9 @@
ArchiveAnalyzer
+
+
+ ArchiveExtractionException
CPEAnalyzer
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
index fe34b9c93..ced8c3225 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.analyzer
@@ -64,6 +64,11 @@
ArchiveAnalyzer
+
+
+
+ ArchiveExtractionException
+
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-frame.html
index 8a0153b46..9136b0bbb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.concurrency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.concurrency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-summary.html
index f239ec7d3..01e86cc14 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/concurrency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.concurrency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.concurrency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeIndexReader.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeIndexReader.html
index c956dbccf..128676d90 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeIndexReader.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeIndexReader.html
@@ -204,7 +204,19 @@
194 vendorSearchFieldAnalyzer.clear();
195 }
196 }
-197 }
+197
+198
+199
+200
+201
+202
+203 public int numDocs() {
+204 if (indexReader == null ) {
+205 return -1;
+206 }
+207 return indexReader.numDocs();
+208 }
+209 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
index 7658ec3ef..94269af36 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
index 801723e98..f0fcdefd2 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
index 6ceaa1cee..bcd5cc147 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
index 72cd0e262..1139e0080 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
index be9ce32e6..db4759dbc 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
index 3e4bb090f..090ffce05 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
index bacaa5bd9..76960d2a7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
index 0911a17f1..8e5baabb6 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/package-frame.html
index 4d68e22a7..773975e7f 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data
@@ -17,6 +17,9 @@
CachedWebDataSource
+
+
+ NoDataException
UpdateException
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/package-summary.html
index 378f7be75..761e5f803 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data
@@ -39,6 +39,11 @@
CachedWebDataSource
+
+
+
+ NoDataException
+
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
index b0961a846..0250c3b25 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
index f7003d0b3..bc3088046 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
index 6ea46af8f..b4f34ab21 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
index f22240f3e..82d76f7fb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
index 9f140085d..aab76446e 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
index b464f6c45..8fe0695fb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
index 94b5d2338..22020d2ca 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.jaxb.pom
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.jaxb.pom
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
index 236c6aed4..4cfb82964 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.jaxb.pom
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.jaxb.pom
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
index 34fc52700..569fc4cb9 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
index f4aac54d1..33b5b7267 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
index f5861341b..df9656564 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
index e728bbb56..cf1eb0e46 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/Downloader.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/Downloader.html
index 439932ad7..1d8b0ead9 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/Downloader.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/Downloader.html
@@ -33,190 +33,208 @@
23 import java.io.FileOutputStream;
24 import java.io.IOException;
25 import java.io.InputStream;
-26 import java.net.HttpURLConnection;
-27 import java.net.InetSocketAddress;
-28 import java.net.Proxy;
-29 import java.net.SocketAddress;
-30 import java.net.URISyntaxException;
-31 import java.net.URL;
-32 import java.util.logging.Level;
-33 import java.util.logging.Logger;
-34 import java.util.zip.GZIPInputStream;
-35 import java.util.zip.InflaterInputStream;
-36
-37
-38
-39
-40
-41
-42 public final class Downloader {
-43
-44
-45
-46
-47 private Downloader () {
-48 }
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58 public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
-59 HttpURLConnection conn = null ;
-60 try {
-61 conn = Downloader.getConnection(url);
-62 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
-63 conn.connect();
-64 } catch (IOException ex) {
-65 try {
-66 if (conn != null ) {
-67 conn.disconnect();
-68 }
-69 } finally {
-70 conn = null ;
-71 }
-72 throw new DownloadFailedException ("Error downloading file." , ex);
-73 }
-74 final String encoding = conn.getContentEncoding();
-75
-76 BufferedOutputStream writer = null ;
-77 InputStream reader = null ;
-78 try {
-79 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
-80 reader = new GZIPInputStream(conn.getInputStream());
-81 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
-82 reader = new InflaterInputStream(conn.getInputStream());
-83 } else {
-84 reader = conn.getInputStream();
-85 }
-86
-87 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
-88 final byte[] buffer = new byte[4096];
-89 int bytesRead;
-90 while ((bytesRead = reader.read(buffer)) > 0) {
-91 writer.write(buffer, 0, bytesRead);
-92 }
-93 } catch (Exception ex) {
-94 throw new DownloadFailedException ("Error saving downloaded file." , ex);
-95 } finally {
-96 if (writer != null ) {
-97 try {
-98 writer.close();
-99 } catch (Exception ex) {
-100 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
-101 "Error closing the writer in Downloader." , ex);
-102 }
-103 }
-104 if (reader != null ) {
-105 try {
-106 reader.close();
-107 } catch (Exception ex) {
-108 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
-109 "Error closing the reader in Downloader." , ex);
-110 }
-111 }
-112 try {
-113 conn.disconnect();
-114 } finally {
-115 conn = null ;
-116 }
-117 }
-118 }
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130 public static long getLastModified(URL url) throws DownloadFailedException {
-131 long timestamp = 0;
-132
-133 if ("file" .equalsIgnoreCase(url.getProtocol())) {
-134 File lastModifiedFile;
-135 try {
-136
-137
-138
-139
-140
-141
-142
-143
-144 lastModifiedFile = new File(url.toURI());
-145
-146 } catch (URISyntaxException ex) {
-147 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
-148 throw new DownloadFailedException (msg);
-149 }
-150 timestamp = lastModifiedFile.lastModified();
-151 } else {
-152 HttpURLConnection conn = null ;
-153 try {
-154 conn = Downloader.getConnection(url);
-155 conn.setRequestMethod("HEAD" );
-156 conn.connect();
-157 timestamp = conn.getLastModified();
-158 } catch (Exception ex) {
-159 throw new DownloadFailedException ("Error making HTTP HEAD request." , ex);
-160 } finally {
-161 if (conn != null ) {
-162 try {
-163 conn.disconnect();
-164 } finally {
-165 conn = null ;
-166 }
-167 }
-168 }
-169 }
-170 return timestamp;
-171 }
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182 private static HttpURLConnection getConnection(URL url) throws DownloadFailedException {
-183 HttpURLConnection conn = null ;
-184 Proxy proxy = null ;
-185 final String proxyUrl = Settings.getString(Settings.KEYS.PROXY_URL);
-186 try {
-187 if (proxyUrl != null ) {
-188 final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
-189 final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
-190 proxy = new Proxy(Proxy.Type.HTTP, addr);
-191 conn = (HttpURLConnection) url.openConnection(proxy);
-192 } else {
-193 conn = (HttpURLConnection) url.openConnection();
-194 }
-195 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
-196 conn.setConnectTimeout(timeout);
-197 } catch (IOException ex) {
-198 if (conn != null ) {
-199 try {
-200 conn.disconnect();
-201 } finally {
-202 conn = null ;
-203 }
-204 }
-205 throw new DownloadFailedException ("Error getting connection." , ex);
-206 }
-207 return conn;
-208 }
-209 }
+26 import java.net.Authenticator;
+27 import java.net.HttpURLConnection;
+28 import java.net.InetSocketAddress;
+29 import java.net.PasswordAuthentication;
+30 import java.net.Proxy;
+31 import java.net.SocketAddress;
+32 import java.net.URISyntaxException;
+33 import java.net.URL;
+34 import java.util.logging.Level;
+35 import java.util.logging.Logger;
+36 import java.util.zip.GZIPInputStream;
+37 import java.util.zip.InflaterInputStream;
+38
+39
+40
+41
+42
+43
+44 public final class Downloader {
+45
+46
+47
+48
+49 private Downloader () {
+50 }
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60 public static void fetchFile(URL url, File outputPath) throws DownloadFailedException {
+61 HttpURLConnection conn = null ;
+62 try {
+63 conn = Downloader.getConnection(url);
+64 conn.setRequestProperty("Accept-Encoding" , "gzip, deflate" );
+65 conn.connect();
+66 } catch (IOException ex) {
+67 try {
+68 if (conn != null ) {
+69 conn.disconnect();
+70 }
+71 } finally {
+72 conn = null ;
+73 }
+74 throw new DownloadFailedException ("Error downloading file." , ex);
+75 }
+76 final String encoding = conn.getContentEncoding();
+77
+78 BufferedOutputStream writer = null ;
+79 InputStream reader = null ;
+80 try {
+81 if (encoding != null && "gzip" .equalsIgnoreCase(encoding)) {
+82 reader = new GZIPInputStream(conn.getInputStream());
+83 } else if (encoding != null && "deflate" .equalsIgnoreCase(encoding)) {
+84 reader = new InflaterInputStream(conn.getInputStream());
+85 } else {
+86 reader = conn.getInputStream();
+87 }
+88
+89 writer = new BufferedOutputStream(new FileOutputStream(outputPath));
+90 final byte[] buffer = new byte[4096];
+91 int bytesRead;
+92 while ((bytesRead = reader.read(buffer)) > 0) {
+93 writer.write(buffer, 0, bytesRead);
+94 }
+95 } catch (Exception ex) {
+96 throw new DownloadFailedException ("Error saving downloaded file." , ex);
+97 } finally {
+98 if (writer != null ) {
+99 try {
+100 writer.close();
+101 } catch (Exception ex) {
+102 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
+103 "Error closing the writer in Downloader." , ex);
+104 }
+105 }
+106 if (reader != null ) {
+107 try {
+108 reader.close();
+109 } catch (Exception ex) {
+110 Logger.getLogger(Downloader.class .getName()).log(Level.FINEST,
+111 "Error closing the reader in Downloader." , ex);
+112 }
+113 }
+114 try {
+115 conn.disconnect();
+116 } finally {
+117 conn = null ;
+118 }
+119 }
+120 }
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132 public static long getLastModified(URL url) throws DownloadFailedException {
+133 long timestamp = 0;
+134
+135 if ("file" .equalsIgnoreCase(url.getProtocol())) {
+136 File lastModifiedFile;
+137 try {
+138
+139
+140
+141
+142
+143
+144
+145
+146 lastModifiedFile = new File(url.toURI());
+147
+148 } catch (URISyntaxException ex) {
+149 final String msg = String.format("Unable to locate '%s'; is the cve.url-2.0.modified property set correctly?" , url.toString());
+150 throw new DownloadFailedException (msg);
+151 }
+152 timestamp = lastModifiedFile.lastModified();
+153 } else {
+154 HttpURLConnection conn = null ;
+155 try {
+156 conn = Downloader.getConnection(url);
+157 conn.setRequestMethod("HEAD" );
+158 conn.connect();
+159 timestamp = conn.getLastModified();
+160 } catch (Exception ex) {
+161 throw new DownloadFailedException ("Error making HTTP HEAD request." , ex);
+162 } finally {
+163 if (conn != null ) {
+164 try {
+165 conn.disconnect();
+166 } finally {
+167 conn = null ;
+168 }
+169 }
+170 }
+171 }
+172 return timestamp;
+173 }
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184 private static HttpURLConnection getConnection(URL url) throws DownloadFailedException {
+185 HttpURLConnection conn = null ;
+186 Proxy proxy = null ;
+187 final String proxyUrl = Settings.getString(Settings.KEYS.PROXY_URL);
+188 try {
+189 if (proxyUrl != null ) {
+190 final int proxyPort = Settings.getInt(Settings.KEYS.PROXY_PORT);
+191 final SocketAddress addr = new InetSocketAddress(proxyUrl, proxyPort);
+192
+193 final String username = Settings.getString(Settings.KEYS.PROXY_USERNAME);
+194 final String password = Settings.getString(Settings.KEYS.PROXY_PASSWORD);
+195 if (username != null && password != null ) {
+196 final Authenticator auth = new Authenticator() {
+197 @Override
+198 public PasswordAuthentication getPasswordAuthentication() {
+199 if (getRequestorType().equals(RequestorType.PROXY)) {
+200 return new PasswordAuthentication(username, password.toCharArray());
+201 }
+202 return super .getPasswordAuthentication();
+203 }
+204 };
+205 Authenticator.setDefault(auth);
+206 }
+207
+208 proxy = new Proxy(Proxy.Type.HTTP, addr);
+209 conn = (HttpURLConnection) url.openConnection(proxy);
+210 } else {
+211 conn = (HttpURLConnection) url.openConnection();
+212 }
+213 final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
+214 conn.setConnectTimeout(timeout);
+215 } catch (IOException ex) {
+216 if (conn != null ) {
+217 try {
+218 conn.disconnect();
+219 } finally {
+220 conn = null ;
+221 }
+222 }
+223 throw new DownloadFailedException ("Error getting connection." , ex);
+224 }
+225 return conn;
+226 }
+227 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/LogUtils.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/LogUtils.html
index ede6fcd53..335b95728 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/LogUtils.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/LogUtils.html
@@ -60,29 +60,43 @@
50 LogManager.getLogManager().reset();
51 LogManager.getLogManager().readConfiguration(in);
52 if (verboseLogFile != null && !verboseLogFile.isEmpty()) {
-53 final Logger logger = Logger.getLogger("" );
-54 final FileHandler handler = new FileHandler(verboseLogFile, true );
-55 handler.setFormatter(new SimpleFormatter());
-56 handler.setLevel(Level.FINE);
-57 handler.setFilter(new LogFilter ());
-58 logger.addHandler(handler);
-59 logger.setLevel(Level.FINE);
-60 }
-61 } catch (IOException ex) {
-62 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "IO Error preparing the logger" , ex);
-63 } catch (SecurityException ex) {
-64 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "Error preparing the logger" , ex);
-65 } finally {
-66 if (in != null ) {
-67 try {
-68 in.close();
-69 } catch (Exception ex) {
-70 Logger.getLogger(LogUtils.class .getName()).log(Level.FINEST, "Error closing resource stream" , ex);
-71 }
-72 }
-73 }
-74 }
-75 }
+53 verboseLoggingEnabled = true ;
+54 final Logger logger = Logger.getLogger("" );
+55 final FileHandler handler = new FileHandler(verboseLogFile, true );
+56 handler.setFormatter(new SimpleFormatter());
+57 handler.setLevel(Level.FINE);
+58 handler.setFilter(new LogFilter ());
+59 logger.addHandler(handler);
+60 logger.setLevel(Level.FINE);
+61 }
+62 } catch (IOException ex) {
+63 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "IO Error preparing the logger" , ex);
+64 } catch (SecurityException ex) {
+65 Logger.getLogger(LogUtils.class .getName()).log(Level.FINE, "Error preparing the logger" , ex);
+66 } finally {
+67 if (in != null ) {
+68 try {
+69 in.close();
+70 } catch (Exception ex) {
+71 Logger.getLogger(LogUtils.class .getName()).log(Level.FINEST, "Error closing resource stream" , ex);
+72 }
+73 }
+74 }
+75 }
+76
+77
+78
+79 private static boolean verboseLoggingEnabled = false;
+80
+81
+82
+83
+84
+85
+86 public static boolean isVerboseLoggingEnabled() {
+87 return verboseLoggingEnabled;
+88 }
+89 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/Settings.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/Settings.html
index 6be7860a4..2321776ba 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/Settings.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/Settings.html
@@ -136,312 +136,320 @@
126
127 public static final String PROXY_PORT = "proxy.port" ;
128
-129
+129
130
-131 public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
+131 public static final String PROXY_USERNAME = "proxy.username" ;
132
-133
+133
134
-135 public static final String TEMP_DIRECTORY = "temp.directory" ;
-136 }
-137
-138
-139
-140 private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
-141
-142
-143
-144 private static final Settings INSTANCE = new Settings ();
+135 public static final String PROXY_PASSWORD = "proxy.password" ;
+136
+137
+138
+139 public static final String CONNECTION_TIMEOUT = "connection.timeout" ;
+140
+141
+142
+143 public static final String TEMP_DIRECTORY = "temp.directory" ;
+144 }
145
-146
+146
147
-148 private Properties props = null ;
-149
-150
-151
-152
-153
-154 private Settings () {
-155 InputStream in = null ;
-156 props = new Properties();
-157 try {
-158 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
-159 props.load(in);
-160 } catch (IOException ex) {
-161 Logger.getLogger(Settings.class .getName()).log(Level.SEVERE, "Unable to load default settings." );
-162 Logger.getLogger(Settings.class .getName()).log(Level.FINE, null , ex);
-163 } finally {
-164 if (in != null ) {
-165 try {
-166 in.close();
-167 } catch (IOException ex) {
-168 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
-169 }
-170 }
-171 }
-172 }
-173
-174
-175
-176
-177
-178
-179
-180 public static void setString(String key, String value) {
-181 INSTANCE.props.setProperty(key, value);
-182 }
-183
-184
-185
-186
-187
-188
-189
-190 public static void setBoolean(String key, boolean value) {
-191 if (value) {
-192 INSTANCE.props.setProperty(key, Boolean.TRUE.toString());
-193 } else {
-194 INSTANCE.props.setProperty(key, Boolean.FALSE.toString());
-195 }
-196 }
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210 public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
-211 final FileInputStream fis = new FileInputStream(filePath);
-212 mergeProperties(fis);
-213 }
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227 public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
-228 final FileInputStream fis = new FileInputStream(filePath);
-229 mergeProperties(fis);
-230 }
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242 public static void mergeProperties(InputStream stream) throws IOException {
-243 INSTANCE.props.load(stream);
-244 }
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258 public static File getFile(String key) {
-259 final String file = getString(key);
-260 final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY);
-261 if (baseDir != null ) {
-262 if (baseDir.startsWith("[JAR]/" )) {
-263 final File jarPath = getJarPath();
-264 final File newBase = new File(jarPath, baseDir.substring(6));
-265 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
-266 return newBase;
-267 }
-268 return new File(newBase, file);
-269 }
-270 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
-271 return new File(baseDir);
-272 }
-273 return new File(baseDir, file);
-274 }
-275 return new File(file);
-276 }
-277
-278
-279
-280
-281
-282
-283
-284 private static File getJarPath() {
-285 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
-286 String decodedPath = "." ;
-287 try {
-288 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
-289 } catch (UnsupportedEncodingException ex) {
-290 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
-291 }
-292
-293 final File path = new File(decodedPath);
-294 if (path.getName().toLowerCase().endsWith(".jar" )) {
-295 return path.getParentFile();
-296 } else {
-297 return new File("." );
-298 }
-299 }
+148 private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+149
+150
+151
+152 private static final Settings INSTANCE = new Settings ();
+153
+154
+155
+156 private Properties props = null ;
+157
+158
+159
+160
+161
+162 private Settings () {
+163 InputStream in = null ;
+164 props = new Properties();
+165 try {
+166 in = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+167 props.load(in);
+168 } catch (IOException ex) {
+169 Logger.getLogger(Settings.class .getName()).log(Level.SEVERE, "Unable to load default settings." );
+170 Logger.getLogger(Settings.class .getName()).log(Level.FINE, null , ex);
+171 } finally {
+172 if (in != null ) {
+173 try {
+174 in.close();
+175 } catch (IOException ex) {
+176 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
+177 }
+178 }
+179 }
+180 }
+181
+182
+183
+184
+185
+186
+187
+188 public static void setString(String key, String value) {
+189 INSTANCE.props.setProperty(key, value);
+190 }
+191
+192
+193
+194
+195
+196
+197
+198 public static void setBoolean(String key, boolean value) {
+199 if (value) {
+200 INSTANCE.props.setProperty(key, Boolean.TRUE.toString());
+201 } else {
+202 INSTANCE.props.setProperty(key, Boolean.FALSE.toString());
+203 }
+204 }
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218 public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
+219 final FileInputStream fis = new FileInputStream(filePath);
+220 mergeProperties(fis);
+221 }
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235 public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
+236 final FileInputStream fis = new FileInputStream(filePath);
+237 mergeProperties(fis);
+238 }
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250 public static void mergeProperties(InputStream stream) throws IOException {
+251 INSTANCE.props.load(stream);
+252 }
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266 public static File getFile(String key) {
+267 final String file = getString(key);
+268 final String baseDir = getString(Settings.KEYS.DATA_DIRECTORY);
+269 if (baseDir != null ) {
+270 if (baseDir.startsWith("[JAR]/" )) {
+271 final File jarPath = getJarPath();
+272 final File newBase = new File(jarPath, baseDir.substring(6));
+273 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
+274 return newBase;
+275 }
+276 return new File(newBase, file);
+277 }
+278 if (Settings.KEYS.DATA_DIRECTORY.equals(key)) {
+279 return new File(baseDir);
+280 }
+281 return new File(baseDir, file);
+282 }
+283 return new File(file);
+284 }
+285
+286
+287
+288
+289
+290
+291
+292 private static File getJarPath() {
+293 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
+294 String decodedPath = "." ;
+295 try {
+296 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
+297 } catch (UnsupportedEncodingException ex) {
+298 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, null , ex);
+299 }
300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311 public static String getString(String key, String defaultValue) {
-312 final String str = System.getProperty(key, INSTANCE.props.getProperty(key, defaultValue));
-313 return str;
-314 }
-315
-316
-317
-318
-319
-320
-321 public static File getTempDirectory() {
-322 return new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
-323 }
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334 public static String getString(String key) {
-335 return System.getProperty(key, INSTANCE.props.getProperty(key));
-336 }
-337
-338
-339
-340
-341
-342
-343
-344 public static void removeProperty(String key) {
-345 INSTANCE.props.remove(key);
-346 }
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359 public static int getInt(String key) throws InvalidSettingException {
-360 int value;
-361 try {
-362 value = Integer.parseInt(Settings.getString(key));
-363 } catch (NumberFormatException ex) {
-364 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-365 }
-366 return value;
-367 }
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380 public static int getInt(String key, int defaultValue) {
-381 int value;
-382 try {
-383 value = Integer.parseInt(Settings.getString(key));
-384 } catch (NumberFormatException ex) {
-385 final String msg = String.format("Could not convert property '%s' to an int." , key);
-386 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, msg, ex);
-387 value = defaultValue;
-388 }
-389 return value;
-390 }
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403 public static long getLong(String key) throws InvalidSettingException {
-404 long value;
-405 try {
-406 value = Long.parseLong(Settings.getString(key));
-407 } catch (NumberFormatException ex) {
-408 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-409 }
-410 return value;
-411 }
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425 public static boolean getBoolean(String key) throws InvalidSettingException {
-426 boolean value;
-427 try {
-428 value = Boolean.parseBoolean(Settings.getString(key));
-429 } catch (NumberFormatException ex) {
-430 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-431 }
-432 return value;
-433 }
-434 }
+301 final File path = new File(decodedPath);
+302 if (path.getName().toLowerCase().endsWith(".jar" )) {
+303 return path.getParentFile();
+304 } else {
+305 return new File("." );
+306 }
+307 }
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319 public static String getString(String key, String defaultValue) {
+320 final String str = System.getProperty(key, INSTANCE.props.getProperty(key, defaultValue));
+321 return str;
+322 }
+323
+324
+325
+326
+327
+328
+329 public static File getTempDirectory() {
+330 return new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
+331 }
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342 public static String getString(String key) {
+343 return System.getProperty(key, INSTANCE.props.getProperty(key));
+344 }
+345
+346
+347
+348
+349
+350
+351
+352 public static void removeProperty(String key) {
+353 INSTANCE.props.remove(key);
+354 }
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367 public static int getInt(String key) throws InvalidSettingException {
+368 int value;
+369 try {
+370 value = Integer.parseInt(Settings.getString(key));
+371 } catch (NumberFormatException ex) {
+372 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+373 }
+374 return value;
+375 }
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388 public static int getInt(String key, int defaultValue) {
+389 int value;
+390 try {
+391 value = Integer.parseInt(Settings.getString(key));
+392 } catch (NumberFormatException ex) {
+393 final String msg = String.format("Could not convert property '%s' to an int." , key);
+394 Logger.getLogger(Settings.class .getName()).log(Level.FINEST, msg, ex);
+395 value = defaultValue;
+396 }
+397 return value;
+398 }
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411 public static long getLong(String key) throws InvalidSettingException {
+412 long value;
+413 try {
+414 value = Long.parseLong(Settings.getString(key));
+415 } catch (NumberFormatException ex) {
+416 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+417 }
+418 return value;
+419 }
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433 public static boolean getBoolean(String key) throws InvalidSettingException {
+434 boolean value;
+435 try {
+436 value = Boolean.parseBoolean(Settings.getString(key));
+437 } catch (NumberFormatException ex) {
+438 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+439 }
+440 return value;
+441 }
+442 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
index e05719506..359a906b7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
index 8642d9d19..9718a3676 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.0.5 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref/overview-frame.html b/dependency-check-core/xref/overview-frame.html
index 82d091fcb..dcdbc84c4 100644
--- a/dependency-check-core/xref/overview-frame.html
+++ b/dependency-check-core/xref/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-core/xref/overview-summary.html b/dependency-check-core/xref/overview-summary.html
index 500676f28..208b34525 100644
--- a/dependency-check-core/xref/overview-summary.html
+++ b/dependency-check-core/xref/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Core 1.0.4 Reference
+ Dependency-Check Core 1.0.5 Reference
diff --git a/dependency-check-jenkins/index.html b/dependency-check-jenkins/index.html
index ee9aa5ae4..7938e961f 100644
--- a/dependency-check-jenkins/index.html
+++ b/dependency-check-jenkins/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins -
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-jenkins/license.html b/dependency-check-jenkins/license.html
index e312292a9..65553c313 100644
--- a/dependency-check-jenkins/license.html
+++ b/dependency-check-jenkins/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-jenkins/project-info.html b/dependency-check-jenkins/project-info.html
index ab9770612..31427a03e 100644
--- a/dependency-check-jenkins/project-info.html
+++ b/dependency-check-jenkins/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-jenkins/project-summary.html b/dependency-check-jenkins/project-summary.html
index 543b06bac..d70abf372 100644
--- a/dependency-check-jenkins/project-summary.html
+++ b/dependency-check-jenkins/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -181,13 +181,10 @@
dependency-check-jenkins
Version
-1.0.4
+1.0.5
Type
-jar
-
-JDK Rev
-1.6
+ pom
diff --git a/dependency-check-maven/apidocs/allclasses-frame.html b/dependency-check-maven/apidocs/allclasses-frame.html
index b31ab521b..7dc9ae9d6 100644
--- a/dependency-check-maven/apidocs/allclasses-frame.html
+++ b/dependency-check-maven/apidocs/allclasses-frame.html
@@ -2,13 +2,13 @@
-
+
-All Classes (Dependency-Check Maven Plugin 1.0.4 API)
+All Classes (Dependency-Check Maven Plugin 1.0.5 API)
-
+
diff --git a/dependency-check-maven/apidocs/allclasses-noframe.html b/dependency-check-maven/apidocs/allclasses-noframe.html
index eb037f994..09bc20346 100644
--- a/dependency-check-maven/apidocs/allclasses-noframe.html
+++ b/dependency-check-maven/apidocs/allclasses-noframe.html
@@ -2,13 +2,13 @@
-
+
-All Classes (Dependency-Check Maven Plugin 1.0.4 API)
+All Classes (Dependency-Check Maven Plugin 1.0.5 API)
-
+
diff --git a/dependency-check-maven/apidocs/constant-values.html b/dependency-check-maven/apidocs/constant-values.html
index 642b09c11..934158e0f 100644
--- a/dependency-check-maven/apidocs/constant-values.html
+++ b/dependency-check-maven/apidocs/constant-values.html
@@ -2,13 +2,13 @@
-
+
-Constant Field Values (Dependency-Check Maven Plugin 1.0.4 API)
+Constant Field Values (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Constant Field Values (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Constant Field Values (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Constant Field Values (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/deprecated-list.html b/dependency-check-maven/apidocs/deprecated-list.html
index df6139c2b..5a630edb3 100644
--- a/dependency-check-maven/apidocs/deprecated-list.html
+++ b/dependency-check-maven/apidocs/deprecated-list.html
@@ -2,13 +2,13 @@
-
+
-Deprecated List (Dependency-Check Maven Plugin 1.0.4 API)
+Deprecated List (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Deprecated List (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Deprecated List (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Deprecated List (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/help-doc.html b/dependency-check-maven/apidocs/help-doc.html
index 848b19e8e..c290160dd 100644
--- a/dependency-check-maven/apidocs/help-doc.html
+++ b/dependency-check-maven/apidocs/help-doc.html
@@ -2,13 +2,13 @@
-
+
-API Help (Dependency-Check Maven Plugin 1.0.4 API)
+API Help (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ API Help (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="API Help (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="API Help (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/index-all.html b/dependency-check-maven/apidocs/index-all.html
index 6999ac52a..1be579d6e 100644
--- a/dependency-check-maven/apidocs/index-all.html
+++ b/dependency-check-maven/apidocs/index-all.html
@@ -2,13 +2,13 @@
-
+
-Index (Dependency-Check Maven Plugin 1.0.4 API)
+Index (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Index (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Index (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Index (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/index.html b/dependency-check-maven/apidocs/index.html
index 6c5d74be3..d310d0524 100644
--- a/dependency-check-maven/apidocs/index.html
+++ b/dependency-check-maven/apidocs/index.html
@@ -2,10 +2,10 @@
-
+
-Dependency-Check Maven Plugin 1.0.4 API
+Dependency-Check Maven Plugin 1.0.5 API
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
index 69817c52e..788fd02af 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
@@ -2,13 +2,13 @@
-
+
-HelpMojo (Dependency-Check Maven Plugin 1.0.4 API)
+HelpMojo (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ HelpMojo (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="HelpMojo (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="HelpMojo (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
index 41563e7bc..a2e15dc9a 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
@@ -2,13 +2,13 @@
-
+
-Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.0.4 API)
+Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Ch
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
index d59a9103e..2930070b1 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
@@ -2,13 +2,13 @@
-
+
-Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.0.4 API)
+Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven P
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
index 591b678d4..bb548e6c7 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
@@ -2,13 +2,13 @@
-
+
-org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)
+org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.5 API)
-
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
index 762a0fa21..d8e7eefa8 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
@@ -2,13 +2,13 @@
-
+
-org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)
+org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
index 4fab1b85b..6a0cb347e 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
@@ -2,13 +2,13 @@
-
+
-org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.0.4 API)
+org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
index 122f011be..c0d59a6a2 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
@@ -2,13 +2,13 @@
-
+
-Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)
+Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/apidocs/overview-tree.html b/dependency-check-maven/apidocs/overview-tree.html
index c6f39fcce..9efe7dd28 100644
--- a/dependency-check-maven/apidocs/overview-tree.html
+++ b/dependency-check-maven/apidocs/overview-tree.html
@@ -2,13 +2,13 @@
-
+
-Class Hierarchy (Dependency-Check Maven Plugin 1.0.4 API)
+Class Hierarchy (Dependency-Check Maven Plugin 1.0.5 API)
-
+
@@ -16,7 +16,7 @@ Class Hierarchy (Dependency-Check Maven Plugin 1.0.4 API)
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Class Hierarchy (Dependency-Check Maven Plugin 1.0.4 API)";
+ parent.document.title="Class Hierarchy (Dependency-Check Maven Plugin 1.0.5 API)";
}
}
diff --git a/dependency-check-maven/check-mojo.html b/dependency-check-maven/check-mojo.html
index fde2b309b..b52c010f5 100644
--- a/dependency-check-maven/check-mojo.html
+++ b/dependency-check-maven/check-mojo.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven -
dependency-check:check
@@ -55,7 +55,7 @@
-
+
/
@@ -69,8 +69,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -150,7 +150,7 @@
Full name :
-org.owasp:dependency-check-maven:1.0.4:check
+org.owasp:dependency-check-maven:1.0.5:check
Description :
@@ -326,6 +326,17 @@ Reports pageDefault value is : Dependency-Check .Us
+proxyPassword
+
+String
+
+-
+
+The Proxy password.User property is : proxyPassword .
+
+
+
+
proxyPort
String
@@ -335,7 +346,7 @@ Reports pageDefault value is : Dependency-Check .Us
The Proxy Port.User property is : proxyPort .
-
+
proxyUrl
@@ -346,6 +357,17 @@ Reports pageDefault value is : Dependency-Check .Us
The Proxy URL.User property is : proxyUrl .
+
+
+proxyUsername
+
+String
+
+-
+
+The Proxy username.User property is : proxyUsername .
+
+
reportName
@@ -489,6 +511,18 @@ Reports page
Default : ${project.build.directory}
+proxyPassword :
+
+The Proxy password.
+
+
+
+Type : java.lang.String
+
+Required : No
+
+User Property : proxyPassword
+
proxyPort :
The Proxy Port.
@@ -513,6 +547,18 @@ Reports page
User Property : proxyUrl
+proxyUsername :
+
+The Proxy username.
+
+
+
+Type : java.lang.String
+
+Required : No
+
+User Property : proxyUsername
+
reportName :
The name of the site report destination.
diff --git a/dependency-check-maven/checkstyle.html b/dependency-check-maven/checkstyle.html
index df6f86256..e41e6b5cc 100644
--- a/dependency-check-maven/checkstyle.html
+++ b/dependency-check-maven/checkstyle.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Checkstyle Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
diff --git a/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html b/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
index 59015728a..3cc2bd56f 100644
--- a/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
+++ b/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-maven/cobertura/frame-summary.html b/dependency-check-maven/cobertura/frame-summary.html
index c70570abb..91c0b9521 100644
--- a/dependency-check-maven/cobertura/frame-summary.html
+++ b/dependency-check-maven/cobertura/frame-summary.html
@@ -16,8 +16,8 @@
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
index 06b762a81..e0e8edff7 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
@@ -12,7 +12,7 @@
@@ -337,492 +337,494 @@
163
164
-
+
165
166 0 @SuppressWarnings("CanBeFinal" )
167
- @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false )
+ @Parameter(property = "proxyUsername" , defaultValue = "" , required = false )
168
- private String connectionTimeout = null ;
+ private String proxyUsername = null ;
169
-
- 170
-
- 171
- 172
-
- 173
-
- 174
-
- 175
+ 170
+
+ 171
+ 172 0 @SuppressWarnings("CanBeFinal" )
+ 173
+ @Parameter(property = "proxyPassword" , defaultValue = "" , required = false )
+ 174
+ private String proxyPassword = null ;
+ 175
+
176
- private Engine executeDependencyCheck() {
+
177
-
- 178 0 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
- 179 0 LogUtils.prepareLogger(in, logFile);
+
+ 178 0 @SuppressWarnings("CanBeFinal" )
+ 179
+ @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false )
180
+ private String connectionTimeout = null ;
+ 181
- 181 0 populateSettings();
- 182 0 final Engine engine = new Engine();
- 183 0 final Set<Artifact> artifacts = project.getArtifacts();
- 184 0 for (Artifact a : artifacts) {
- 185 0 if (!TEST_SCOPE.equals(a.getScope())) {
- 186 0 engine.scan(a.getFile().getAbsolutePath());
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
187
- }
+
188
- }
- 189 0 engine.analyzeDependencies();
- 190 0 return engine;
- 191
- }
+ private Engine executeDependencyCheck() {
+ 189
+
+ 190 0 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
+ 191 0 LogUtils.prepareLogger(in, logFile);
192
- 193
-
- 194
-
- 195
-
- 196
-
- 197
-
- 198
- private void generateExternalReports(Engine engine) {
- 199 0 final ReportGenerator r = new ReportGenerator(project.getName(), engine.getDependencies(), engine.getAnalyzers());
+ 193 0 populateSettings();
+ 194 0 final Engine engine = new Engine();
+ 195 0 final Set<Artifact> artifacts = project.getArtifacts();
+ 196 0 for (Artifact a : artifacts) {
+ 197 0 if (!TEST_SCOPE.equals(a.getScope())) {
+ 198 0 engine.scan(a.getFile().getAbsolutePath());
+ 199
+ }
200
- try {
- 201 0 r.generateReports(outputDirectory.getCanonicalPath(), format);
- 202 0 } catch (IOException ex) {
- 203 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.SEVERE, null , ex);
- 204 0 } catch (Exception ex) {
- 205 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.SEVERE, null , ex);
- 206 0 }
- 207 0 }
- 208
+ }
+ 201 0 engine.analyzeDependencies();
+ 202 0 return engine;
+ 203
+ }
+ 204
- 209
+ 205
- 210
-
- 211
+ 206
+
+ 207
- 212
-
- 213
-
- 214
+ 208
+
+ 209
- 215
- private void generateMavenSiteReport(final Engine engine, Sink sink) {
- 216 0 final List<Dependency> dependencies = engine.getDependencies();
- 217
-
- 218 0 writeSiteReportHeader(sink, project.getName());
- 219 0 writeSiteReportTOC(sink, dependencies);
+ 210
+ private void generateExternalReports(Engine engine) {
+ 211 0 final ReportGenerator r = new ReportGenerator(project.getName(), engine.getDependencies(), engine.getAnalyzers());
+ 212
+ try {
+ 213 0 r.generateReports(outputDirectory.getCanonicalPath(), format);
+ 214 0 } catch (IOException ex) {
+ 215 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.SEVERE, null , ex);
+ 216 0 } catch (Exception ex) {
+ 217 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.SEVERE, null , ex);
+ 218 0 }
+ 219 0 }
220
- 221 0 int cnt = 0;
- 222 0 for (Dependency d : dependencies) {
- 223 0 writeSiteReportDependencyHeader(sink, d);
- 224 0 cnt = writeSiteReportDependencyAnalysisExceptions(d, cnt, sink);
- 225 0 cnt = writeSiteReportDependencyEvidenceUsed(d, cnt, sink);
- 226 0 cnt = writeSiteReportDependencyRelatedDependencies(d, cnt, sink);
- 227 0 writeSiteReportDependencyIdentifiers(d, sink);
- 228 0 writeSiteReportDependencyVulnerabilities(d, sink, cnt);
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+ private void generateMavenSiteReport(final Engine engine, Sink sink) {
+ 228 0 final List<Dependency> dependencies = engine.getDependencies();
229
- }
- 230 0 sink.body_();
- 231 0 }
+
+ 230 0 writeSiteReportHeader(sink, project.getName());
+ 231 0 writeSiteReportTOC(sink, dependencies);
232
- 233
-
- 234
-
- 235
-
- 236
-
- 237
-
- 238
-
- 239
-
- 240
-
+ 233 0 int cnt = 0;
+ 234 0 for (Dependency d : dependencies) {
+ 235 0 writeSiteReportDependencyHeader(sink, d);
+ 236 0 cnt = writeSiteReportDependencyAnalysisExceptions(d, cnt, sink);
+ 237 0 cnt = writeSiteReportDependencyEvidenceUsed(d, cnt, sink);
+ 238 0 cnt = writeSiteReportDependencyRelatedDependencies(d, cnt, sink);
+ 239 0 writeSiteReportDependencyIdentifiers(d, sink);
+ 240 0 writeSiteReportDependencyVulnerabilities(d, sink, cnt);
241
- private void writeSiteReportDependencyVulnerabilities(Dependency d, Sink sink, int collapsibleHeaderCount) {
- 242 0 int cnt = collapsibleHeaderCount;
- 243 0 if (d.getVulnerabilities() != null && !d.getVulnerabilities().isEmpty()) {
- 244 0 for (Vulnerability v : d.getVulnerabilities()) {
+ }
+ 242 0 sink.body_();
+ 243 0 }
+ 244
+
245
-
- 246 0 sink.paragraph();
- 247 0 sink.bold();
+
+ 246
+
+ 247
+
248
+
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+ private void writeSiteReportDependencyVulnerabilities(Dependency d, Sink sink, int collapsibleHeaderCount) {
+ 254 0 int cnt = collapsibleHeaderCount;
+ 255 0 if (d.getVulnerabilities() != null && !d.getVulnerabilities().isEmpty()) {
+ 256 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 257
+
+ 258 0 sink.paragraph();
+ 259 0 sink.bold();
+ 260
try {
- 249 0 sink.link("http://web.nvd.nist.gov/view/vuln/detail?vulnId=" + URLEncoder.encode(v.getName(), "US-ASCII" ));
- 250 0 sink.text(v.getName());
- 251 0 sink.link_();
- 252 0 sink.bold_();
- 253 0 } catch (UnsupportedEncodingException ex) {
- 254 0 sink.text(v.getName());
- 255 0 sink.bold_();
- 256 0 sink.lineBreak();
- 257 0 sink.text("http://web.nvd.nist.gov/view/vuln/detail?vulnId=" + v.getName());
- 258 0 }
- 259 0 sink.paragraph_();
- 260 0 sink.paragraph();
- 261 0 sink.text("Severity: " );
- 262 0 if (v.getCvssScore() < 4.0) {
- 263 0 sink.text("Low" );
- 264
+ 261 0 sink.link("http://web.nvd.nist.gov/view/vuln/detail?vulnId=" + URLEncoder.encode(v.getName(), "US-ASCII" ));
+ 262 0 sink.text(v.getName());
+ 263 0 sink.link_();
+ 264 0 sink.bold_();
+ 265 0 } catch (UnsupportedEncodingException ex) {
+ 266 0 sink.text(v.getName());
+ 267 0 sink.bold_();
+ 268 0 sink.lineBreak();
+ 269 0 sink.text("http://web.nvd.nist.gov/view/vuln/detail?vulnId=" + v.getName());
+ 270 0 }
+ 271 0 sink.paragraph_();
+ 272 0 sink.paragraph();
+ 273 0 sink.text("Severity: " );
+ 274 0 if (v.getCvssScore() < 4.0) {
+ 275 0 sink.text("Low" );
+ 276
} else {
- 265 0 if (v.getCvssScore() >= 7.0) {
- 266 0 sink.text("High" );
- 267
+ 277 0 if (v.getCvssScore() >= 7.0) {
+ 278 0 sink.text("High" );
+ 279
} else {
- 268 0 sink.text("Medium" );
- 269
+ 280 0 sink.text("Medium" );
+ 281
}
- 270
+ 282
}
- 271 0 sink.lineBreak();
- 272 0 sink.text("CVSS Score: " + v.getCvssScore());
- 273 0 if (v.getCwe() != null && !v.getCwe().isEmpty()) {
- 274 0 sink.lineBreak();
- 275 0 sink.text("CWE: " );
- 276 0 sink.text(v.getCwe());
- 277
+ 283 0 sink.lineBreak();
+ 284 0 sink.text("CVSS Score: " + v.getCvssScore());
+ 285 0 if (v.getCwe() != null && !v.getCwe().isEmpty()) {
+ 286 0 sink.lineBreak();
+ 287 0 sink.text("CWE: " );
+ 288 0 sink.text(v.getCwe());
+ 289
}
- 278 0 sink.paragraph_();
- 279 0 sink.paragraph();
- 280 0 sink.text(v.getDescription());
- 281 0 if (v.getReferences() != null && !v.getReferences().isEmpty()) {
- 282 0 sink.list();
- 283 0 for (Reference ref : v.getReferences()) {
- 284 0 sink.listItem();
- 285 0 sink.text(ref.getSource());
- 286 0 sink.text(" - " );
- 287 0 sink.link(ref.getUrl());
- 288 0 sink.text(ref.getName());
- 289 0 sink.link_();
- 290 0 sink.listItem_();
- 291
+ 290 0 sink.paragraph_();
+ 291 0 sink.paragraph();
+ 292 0 sink.text(v.getDescription());
+ 293 0 if (v.getReferences() != null && !v.getReferences().isEmpty()) {
+ 294 0 sink.list();
+ 295 0 for (Reference ref : v.getReferences()) {
+ 296 0 sink.listItem();
+ 297 0 sink.text(ref.getSource());
+ 298 0 sink.text(" - " );
+ 299 0 sink.link(ref.getUrl());
+ 300 0 sink.text(ref.getName());
+ 301 0 sink.link_();
+ 302 0 sink.listItem_();
+ 303
}
- 292 0 sink.list_();
- 293
+ 304 0 sink.list_();
+ 305
}
- 294 0 sink.paragraph_();
- 295 0 if (v.getVulnerableSoftware() != null && !v.getVulnerableSoftware().isEmpty()) {
- 296 0 sink.paragraph();
- 297
+ 306 0 sink.paragraph_();
+ 307 0 if (v.getVulnerableSoftware() != null && !v.getVulnerableSoftware().isEmpty()) {
+ 308 0 sink.paragraph();
+ 309
- 298 0 cnt += 1;
- 299 0 sink.rawText("Vulnerable Software <a href=\"javascript:toggleElement(this, 'vulnSoft" + cnt + "')\">[-]</a>" );
- 300 0 sink.rawText("<div id=\"vulnSoft" + cnt + "\" style=\"display:block\">" );
- 301 0 sink.list();
- 302 0 for (VulnerableSoftware vs : v.getVulnerableSoftware()) {
- 303 0 sink.listItem();
- 304
+ 310 0 cnt += 1;
+ 311 0 sink.rawText("Vulnerable Software <a href=\"javascript:toggleElement(this, 'vulnSoft" + cnt + "')\">[-]</a>" );
+ 312 0 sink.rawText("<div id=\"vulnSoft" + cnt + "\" style=\"display:block\">" );
+ 313 0 sink.list();
+ 314 0 for (VulnerableSoftware vs : v.getVulnerableSoftware()) {
+ 315 0 sink.listItem();
+ 316
try {
- 305 0 sink.link("http://web.nvd.nist.gov/view/vuln/search-results?cpe=" + URLEncoder.encode(vs.getName(), "US-ASCII" ));
- 306 0 sink.text(vs.getName());
- 307 0 sink.link_();
- 308 0 if (vs.hasPreviousVersion()) {
- 309 0 sink.text(" and all previous versions." );
- 310
+ 317 0 sink.link("http://web.nvd.nist.gov/view/vuln/search-results?cpe=" + URLEncoder.encode(vs.getName(), "US-ASCII" ));
+ 318 0 sink.text(vs.getName());
+ 319 0 sink.link_();
+ 320 0 if (vs.hasPreviousVersion()) {
+ 321 0 sink.text(" and all previous versions." );
+ 322
}
- 311 0 } catch (UnsupportedEncodingException ex) {
- 312 0 sink.text(vs.getName());
- 313 0 if (vs.hasPreviousVersion()) {
- 314 0 sink.text(" and all previous versions." );
- 315
+ 323 0 } catch (UnsupportedEncodingException ex) {
+ 324 0 sink.text(vs.getName());
+ 325 0 if (vs.hasPreviousVersion()) {
+ 326 0 sink.text(" and all previous versions." );
+ 327
}
- 316 0 sink.text(" (http://web.nvd.nist.gov/view/vuln/search-results?cpe=" + vs.getName() + ")" );
- 317 0 }
- 318
-
- 319 0 sink.listItem_();
- 320
- }
- 321 0 sink.list_();
- 322 0 sink.rawText("</div>" );
- 323 0 sink.paragraph_();
- 324
- }
- 325
- }
- 326
- }
- 327 0 }
- 328
-
- 329
-
+ 328 0 sink.text(" (http://web.nvd.nist.gov/view/vuln/search-results?cpe=" + vs.getName() + ")" );
+ 329 0 }
330
-
- 331
-
+
+ 331 0 sink.listItem_();
332
+ }
+ 333 0 sink.list_();
+ 334 0 sink.rawText("</div>" );
+ 335 0 sink.paragraph_();
+ 336
+ }
+ 337
+ }
+ 338
+ }
+ 339 0 }
+ 340
+
+ 341
+
+ 342
+
+ 343
+
+ 344
- 333
+ 345
- 334
+ 346
- 335
+ 347
private void writeSiteReportDependencyIdentifiers(Dependency d, Sink sink) {
- 336 0 if (d.getIdentifiers() != null && !d.getIdentifiers().isEmpty()) {
- 337 0 sink.sectionTitle4();
- 338 0 sink.text("Identifiers" );
- 339 0 sink.sectionTitle4_();
- 340 0 sink.list();
- 341 0 for (Identifier i : d.getIdentifiers()) {
- 342 0 sink.listItem();
- 343 0 sink.text(i.getType());
- 344 0 sink.text(": " );
- 345 0 if (i.getUrl() != null && i.getUrl().length() > 0) {
- 346 0 sink.link(i.getUrl());
- 347 0 sink.text(i.getValue());
- 348 0 sink.link_();
- 349
- } else {
- 350 0 sink.text(i.getValue());
- 351
- }
- 352 0 if (i.getDescription() != null && i.getDescription().length() > 0) {
- 353 0 sink.lineBreak();
- 354 0 sink.text(i.getDescription());
- 355
- }
- 356 0 sink.listItem_();
- 357
- }
- 358 0 sink.list_();
- 359
- }
- 360 0 }
+ 348 0 if (d.getIdentifiers() != null && !d.getIdentifiers().isEmpty()) {
+ 349 0 sink.sectionTitle4();
+ 350 0 sink.text("Identifiers" );
+ 351 0 sink.sectionTitle4_();
+ 352 0 sink.list();
+ 353 0 for (Identifier i : d.getIdentifiers()) {
+ 354 0 sink.listItem();
+ 355 0 sink.text(i.getType());
+ 356 0 sink.text(": " );
+ 357 0 if (i.getUrl() != null && i.getUrl().length() > 0) {
+ 358 0 sink.link(i.getUrl());
+ 359 0 sink.text(i.getValue());
+ 360 0 sink.link_();
361
-
- 362
-
+ } else {
+ 362 0 sink.text(i.getValue());
363
-
- 364
-
- 365
-
- 366
-
+ }
+ 364 0 if (i.getDescription() != null && i.getDescription().length() > 0) {
+ 365 0 sink.lineBreak();
+ 366 0 sink.text(i.getDescription());
367
-
- 368
-
+ }
+ 368 0 sink.listItem_();
369
+ }
+ 370 0 sink.list_();
+ 371
+ }
+ 372 0 }
+ 373
+
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379
+
+ 380
+
+ 381
- 370
+ 382
private int writeSiteReportDependencyRelatedDependencies(Dependency d, int collapsibleHeaderCount, Sink sink) {
- 371 0 int cnt = collapsibleHeaderCount;
- 372 0 if (d.getRelatedDependencies() != null && !d.getRelatedDependencies().isEmpty()) {
- 373 0 cnt += 1;
- 374 0 sink.sectionTitle4();
- 375 0 sink.rawText("Related Dependencies <a href=\"javascript:toggleElement(this, 'related" + cnt + "')\">[+]</a>" );
- 376 0 sink.sectionTitle4_();
- 377 0 sink.rawText("<div id=\"related" + cnt + "\" style=\"display:none\">" );
- 378 0 sink.list();
- 379 0 for (Dependency r : d.getRelatedDependencies()) {
- 380 0 sink.listItem();
- 381 0 sink.text(r.getFileName());
- 382 0 sink.list();
- 383 0 writeListItem(sink, "File Path: " + r.getFilePath());
- 384 0 writeListItem(sink, "SHA1: " + r.getSha1sum());
- 385 0 writeListItem(sink, "MD5: " + r.getMd5sum());
- 386 0 sink.list_();
- 387 0 sink.listItem_();
- 388
- }
- 389 0 sink.list_();
- 390 0 sink.rawText("</div>" );
- 391
- }
- 392 0 return cnt;
- 393
- }
- 394
-
- 395
-
- 396
-
- 397
-
- 398
-
- 399
-
+ 383 0 int cnt = collapsibleHeaderCount;
+ 384 0 if (d.getRelatedDependencies() != null && !d.getRelatedDependencies().isEmpty()) {
+ 385 0 cnt += 1;
+ 386 0 sink.sectionTitle4();
+ 387 0 sink.rawText("Related Dependencies <a href=\"javascript:toggleElement(this, 'related" + cnt + "')\">[+]</a>" );
+ 388 0 sink.sectionTitle4_();
+ 389 0 sink.rawText("<div id=\"related" + cnt + "\" style=\"display:none\">" );
+ 390 0 sink.list();
+ 391 0 for (Dependency r : d.getRelatedDependencies()) {
+ 392 0 sink.listItem();
+ 393 0 sink.text(r.getFileName());
+ 394 0 sink.list();
+ 395 0 writeListItem(sink, "File Path: " + r.getFilePath());
+ 396 0 writeListItem(sink, "SHA1: " + r.getSha1sum());
+ 397 0 writeListItem(sink, "MD5: " + r.getMd5sum());
+ 398 0 sink.list_();
+ 399 0 sink.listItem_();
400
-
- 401
-
- 402
-
+ }
+ 401 0 sink.list_();
+ 402 0 sink.rawText("</div>" );
403
- private int writeSiteReportDependencyEvidenceUsed(Dependency d, int collapsibleHeaderCount, Sink sink) {
- 404 0 int cnt = collapsibleHeaderCount;
- 405 0 if (d.getEvidenceUsed() != null && d.getEvidenceUsed().size() > 0) {
- 406 0 cnt += 1;
- 407 0 sink.sectionTitle4();
- 408 0 sink.rawText("Evidence Collected <a href=\"javascript:toggleElement(this, 'evidence" + cnt + "')\">[+]</a>" );
- 409 0 sink.sectionTitle4_();
- 410 0 sink.rawText("<div id=\"evidence" + cnt + "\" style=\"display:none\">" );
- 411 0 sink.table();
- 412 0 sink.tableRow();
- 413 0 writeTableHeaderCell(sink, "Source" );
- 414 0 writeTableHeaderCell(sink, "Name" );
- 415 0 writeTableHeaderCell(sink, "Value" );
- 416 0 sink.tableRow_();
- 417 0 for (Evidence e : d.getEvidenceUsed()) {
- 418 0 sink.tableRow();
- 419 0 writeTableCell(sink, e.getSource());
- 420 0 writeTableCell(sink, e.getName());
- 421 0 writeTableCell(sink, e.getValue());
- 422 0 sink.tableRow_();
- 423
- }
- 424 0 sink.table_();
- 425 0 sink.rawText("</div>" );
- 426
}
- 427 0 return cnt;
- 428
+ 404 0 return cnt;
+ 405
}
- 429
+ 406
- 430
+ 407
- 431
-
- 432
-
- 433
+ 408
+
+ 409
- 434
+ 410
- 435
+ 411
- 436
+ 412
- 437
+ 413
+ 414
+
+ 415
+ private int writeSiteReportDependencyEvidenceUsed(Dependency d, int collapsibleHeaderCount, Sink sink) {
+ 416 0 int cnt = collapsibleHeaderCount;
+ 417 0 if (d.getEvidenceUsed() != null && d.getEvidenceUsed().size() > 0) {
+ 418 0 cnt += 1;
+ 419 0 sink.sectionTitle4();
+ 420 0 sink.rawText("Evidence Collected <a href=\"javascript:toggleElement(this, 'evidence" + cnt + "')\">[+]</a>" );
+ 421 0 sink.sectionTitle4_();
+ 422 0 sink.rawText("<div id=\"evidence" + cnt + "\" style=\"display:none\">" );
+ 423 0 sink.table();
+ 424 0 sink.tableRow();
+ 425 0 writeTableHeaderCell(sink, "Source" );
+ 426 0 writeTableHeaderCell(sink, "Name" );
+ 427 0 writeTableHeaderCell(sink, "Value" );
+ 428 0 sink.tableRow_();
+ 429 0 for (Evidence e : d.getEvidenceUsed()) {
+ 430 0 sink.tableRow();
+ 431 0 writeTableCell(sink, e.getSource());
+ 432 0 writeTableCell(sink, e.getName());
+ 433 0 writeTableCell(sink, e.getValue());
+ 434 0 sink.tableRow_();
+ 435
+ }
+ 436 0 sink.table_();
+ 437 0 sink.rawText("</div>" );
438
-
- 439
- private int writeSiteReportDependencyAnalysisExceptions(Dependency d, int collapsibleHeaderCount, Sink sink) {
- 440 0 int cnt = collapsibleHeaderCount;
- 441 0 if (d.getAnalysisExceptions() != null && !d.getAnalysisExceptions().isEmpty()) {
- 442 0 cnt += 1;
- 443 0 sink.sectionTitle4();
- 444 0 sink.rawText("<font style=\"color:red\">Errors occurred during analysis:</font> <a href=\"javascript:toggleElement(this, 'errors"
- 445
- + cnt + "')\">[+]</a>" );
- 446 0 sink.sectionTitle4_();
- 447 0 sink.rawText("<div id=\"errors" + cnt + "\">" );
- 448 0 sink.list();
- 449 0 for (Exception e : d.getAnalysisExceptions()) {
- 450 0 sink.listItem();
- 451 0 sink.text(e.getMessage());
- 452 0 sink.listItem_();
- 453
- }
- 454 0 sink.list_();
- 455 0 sink.rawText("</div>" );
- 456
}
- 457 0 return cnt;
- 458
+ 439 0 return cnt;
+ 440
}
- 459
+ 441
- 460
+ 442
- 461
-
- 462
+ 443
+
+ 444
+
+ 445
- 463
+ 446
- 464
+ 447
+ 448
+
+ 449
+
+ 450
+
+ 451
+ private int writeSiteReportDependencyAnalysisExceptions(Dependency d, int collapsibleHeaderCount, Sink sink) {
+ 452 0 int cnt = collapsibleHeaderCount;
+ 453 0 if (d.getAnalysisExceptions() != null && !d.getAnalysisExceptions().isEmpty()) {
+ 454 0 cnt += 1;
+ 455 0 sink.sectionTitle4();
+ 456 0 sink.rawText("<font style=\"color:red\">Errors occurred during analysis:</font> <a href=\"javascript:toggleElement(this, 'errors"
+ 457
+ + cnt + "')\">[+]</a>" );
+ 458 0 sink.sectionTitle4_();
+ 459 0 sink.rawText("<div id=\"errors" + cnt + "\">" );
+ 460 0 sink.list();
+ 461 0 for (Exception e : d.getAnalysisExceptions()) {
+ 462 0 sink.listItem();
+ 463 0 sink.text(e.getMessage());
+ 464 0 sink.listItem_();
465
-
- 466
- private void writeSiteReportDependencyHeader(Sink sink, Dependency d) {
- 467 0 sink.sectionTitle2();
- 468 0 sink.anchor("sha1" + d.getSha1sum());
- 469 0 sink.text(d.getFileName());
- 470 0 sink.anchor_();
- 471 0 sink.sectionTitle2_();
- 472 0 if (d.getDescription() != null && d.getDescription().length() > 0) {
- 473 0 sink.paragraph();
- 474 0 sink.bold();
- 475 0 sink.text("Description: " );
- 476 0 sink.bold_();
- 477 0 sink.text(d.getDescription());
- 478 0 sink.paragraph_();
- 479
- }
- 480 0 if (d.getLicense() != null && d.getLicense().length() > 0) {
- 481 0 sink.paragraph();
- 482 0 sink.bold();
- 483 0 sink.text("License: " );
- 484 0 sink.bold_();
- 485 0 if (d.getLicense().startsWith("http://" ) && !d.getLicense().contains(" " )) {
- 486 0 sink.link(d.getLicense());
- 487 0 sink.text(d.getLicense());
- 488 0 sink.link_();
- 489
- } else {
- 490 0 sink.text(d.getLicense());
- 491
}
- 492 0 sink.paragraph_();
- 493
+ 466 0 sink.list_();
+ 467 0 sink.rawText("</div>" );
+ 468
}
- 494 0 }
- 495
+ 469 0 return cnt;
+ 470
+ }
+ 471
- 496
+ 472
- 497
-
- 498
+ 473
+
+ 474
- 499
+ 475
+
+ 476
- 500
-
- 501
+ 477
- 502
- private void writeListItem(Sink sink, String text) {
- 503 0 sink.listItem();
- 504 0 sink.text(text);
- 505 0 sink.listItem_();
+ 478
+ private void writeSiteReportDependencyHeader(Sink sink, Dependency d) {
+ 479 0 sink.sectionTitle2();
+ 480 0 sink.anchor("sha1" + d.getSha1sum());
+ 481 0 sink.text(d.getFileName());
+ 482 0 sink.anchor_();
+ 483 0 sink.sectionTitle2_();
+ 484 0 if (d.getDescription() != null && d.getDescription().length() > 0) {
+ 485 0 sink.paragraph();
+ 486 0 sink.bold();
+ 487 0 sink.text("Description: " );
+ 488 0 sink.bold_();
+ 489 0 sink.text(d.getDescription());
+ 490 0 sink.paragraph_();
+ 491
+ }
+ 492 0 if (d.getLicense() != null && d.getLicense().length() > 0) {
+ 493 0 sink.paragraph();
+ 494 0 sink.bold();
+ 495 0 sink.text("License: " );
+ 496 0 sink.bold_();
+ 497 0 if (d.getLicense().startsWith("http://" ) && !d.getLicense().contains(" " )) {
+ 498 0 sink.link(d.getLicense());
+ 499 0 sink.text(d.getLicense());
+ 500 0 sink.link_();
+ 501
+ } else {
+ 502 0 sink.text(d.getLicense());
+ 503
+ }
+ 504 0 sink.paragraph_();
+ 505
+ }
506 0 }
507
508
509
-
+
510
511
@@ -832,17 +834,17 @@
513
514
- private void writeTableCell(Sink sink, String text) {
- 515 0 sink.tableCell();
+ private void writeListItem(Sink sink, String text) {
+ 515 0 sink.listItem();
516 0 sink.text(text);
- 517 0 sink.tableCell_();
+ 517 0 sink.listItem_();
518 0 }
519
520
521
-
+
522
523
@@ -852,307 +854,302 @@
525
526
- private void writeTableHeaderCell(Sink sink, String text) {
- 527 0 sink.tableHeaderCell();
+ private void writeTableCell(Sink sink, String text) {
+ 527 0 sink.tableCell();
528 0 sink.text(text);
- 529 0 sink.tableHeaderCell_();
+ 529 0 sink.tableCell_();
530 0 }
531
532
533
-
+
534
535
536
-
+
537
538
- private void writeSiteReportTOC(Sink sink, final List<Dependency> dependencies) {
- 539 0 sink.list();
- 540 0 for (Dependency d : dependencies) {
- 541 0 sink.listItem();
- 542 0 sink.link("#sha1" + d.getSha1sum());
- 543 0 sink.text(d.getFileName());
- 544 0 sink.link_();
- 545 0 if (!d.getVulnerabilities().isEmpty()) {
- 546 0 sink.rawText(" <font style=\"color:red\">•</font>" );
- 547
- }
- 548 0 if (!d.getRelatedDependencies().isEmpty()) {
- 549 0 sink.list();
- 550 0 for (Dependency r : d.getRelatedDependencies()) {
- 551 0 writeListItem(sink, r.getFileName());
- 552
- }
- 553 0 sink.list_();
- 554
- }
- 555 0 sink.listItem_();
- 556
- }
- 557 0 sink.list_();
- 558 0 }
- 559
+ private void writeTableHeaderCell(Sink sink, String text) {
+ 539 0 sink.tableHeaderCell();
+ 540 0 sink.text(text);
+ 541 0 sink.tableHeaderCell_();
+ 542 0 }
+ 543
- 560
+ 544
- 561
-
- 562
+ 545
+
+ 546
- 563
+ 547
- 564
-
- 565
+ 548
+
+ 549
- 566
- private void writeSiteReportHeader(Sink sink, String projectName) {
- 567 0 sink.head();
- 568 0 sink.title();
- 569 0 sink.text("Dependency-Check Report: " + projectName);
- 570 0 sink.title_();
- 571 0 sink.head_();
- 572 0 sink.body();
- 573 0 sink.rawText("<script type=\"text/javascript\">" );
- 574 0 sink.rawText("function toggleElement(el, targetId) {" );
- 575 0 sink.rawText("if (el.innerText == '[+]') {" );
- 576 0 sink.rawText(" el.innerText = '[-]';" );
- 577 0 sink.rawText(" document.getElementById(targetId).style.display='block';" );
- 578 0 sink.rawText("} else {" );
- 579 0 sink.rawText(" el.innerText = '[+]';" );
- 580 0 sink.rawText(" document.getElementById(targetId).style.display='none';" );
- 581 0 sink.rawText("}" );
- 582
-
- 583 0 sink.rawText("}" );
- 584 0 sink.rawText("</script>" );
- 585 0 sink.section1();
- 586 0 sink.sectionTitle1();
- 587 0 sink.text("Project: " + projectName);
- 588 0 sink.sectionTitle1_();
- 589 0 sink.date();
- 590 0 final Date now = new Date();
- 591 0 sink.text(DateFormat.getDateTimeInstance().format(now));
- 592 0 sink.date_();
- 593 0 sink.section1_();
- 594 0 }
- 595
-
- 596
-
- 597
-
- 598
-
- 599
-
- 600
-
- 601
-
- 602
- private void populateSettings() {
- 603 0 InputStream mojoProperties = null ;
- 604
- try {
- 605 0 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
- 606 0 Settings.mergeProperties(mojoProperties);
- 607 0 } catch (IOException ex) {
- 608 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
- 609 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.FINE, null , ex);
- 610
- } finally {
- 611 0 if (mojoProperties != null ) {
- 612
- try {
- 613 0 mojoProperties.close();
- 614 0 } catch (IOException ex) {
- 615 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.FINEST, null , ex);
- 616 0 }
- 617
+ 550
+ private void writeSiteReportTOC(Sink sink, final List<Dependency> dependencies) {
+ 551 0 sink.list();
+ 552 0 for (Dependency d : dependencies) {
+ 553 0 sink.listItem();
+ 554 0 sink.link("#sha1" + d.getSha1sum());
+ 555 0 sink.text(d.getFileName());
+ 556 0 sink.link_();
+ 557 0 if (!d.getVulnerabilities().isEmpty()) {
+ 558 0 sink.rawText(" <font style=\"color:red\">•</font>" );
+ 559
}
- 618
+ 560 0 if (!d.getRelatedDependencies().isEmpty()) {
+ 561 0 sink.list();
+ 562 0 for (Dependency r : d.getRelatedDependencies()) {
+ 563 0 writeListItem(sink, r.getFileName());
+ 564
+ }
+ 565 0 sink.list_();
+ 566
+ }
+ 567 0 sink.listItem_();
+ 568
}
- 619
+ 569 0 sink.list_();
+ 570 0 }
+ 571
- 620 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
- 621
+ 572
+
+ 573
+
+ 574
+
+ 575
+
+ 576
+
+ 577
+
+ 578
+ private void writeSiteReportHeader(Sink sink, String projectName) {
+ 579 0 sink.head();
+ 580 0 sink.title();
+ 581 0 sink.text("Dependency-Check Report: " + projectName);
+ 582 0 sink.title_();
+ 583 0 sink.head_();
+ 584 0 sink.body();
+ 585 0 sink.rawText("<script type=\"text/javascript\">" );
+ 586 0 sink.rawText("function toggleElement(el, targetId) {" );
+ 587 0 sink.rawText("if (el.innerText == '[+]') {" );
+ 588 0 sink.rawText(" el.innerText = '[-]';" );
+ 589 0 sink.rawText(" document.getElementById(targetId).style.display='block';" );
+ 590 0 sink.rawText("} else {" );
+ 591 0 sink.rawText(" el.innerText = '[+]';" );
+ 592 0 sink.rawText(" document.getElementById(targetId).style.display='none';" );
+ 593 0 sink.rawText("}" );
+ 594
- 622 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
- 623 0 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
+ 595 0 sink.rawText("}" );
+ 596 0 sink.rawText("</script>" );
+ 597 0 sink.section1();
+ 598 0 sink.sectionTitle1();
+ 599 0 sink.text("Project: " + projectName);
+ 600 0 sink.sectionTitle1_();
+ 601 0 sink.date();
+ 602 0 final Date now = new Date();
+ 603 0 sink.text(DateFormat.getDateTimeInstance().format(now));
+ 604 0 sink.date_();
+ 605 0 sink.section1_();
+ 606 0 }
+ 607
+
+ 608
+
+ 609
+
+ 610
+
+ 611
+
+ 612
+
+ 613
+
+ 614
+ private void populateSettings() {
+ 615 0 InputStream mojoProperties = null ;
+ 616
+ try {
+ 617 0 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+ 618 0 Settings.mergeProperties(mojoProperties);
+ 619 0 } catch (IOException ex) {
+ 620 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
+ 621 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.FINE, null , ex);
+ 622
+ } finally {
+ 623 0 if (mojoProperties != null ) {
624
- }
- 625 0 if (proxyPort != null && !proxyPort.isEmpty()) {
- 626 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
- 627
- }
- 628 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
- 629 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+ try {
+ 625 0 mojoProperties.close();
+ 626 0 } catch (IOException ex) {
+ 627 0 Logger.getLogger(DependencyCheckMojo.class .getName()).log(Level.FINEST, null , ex);
+ 628 0 }
+ 629
+ }
630
}
- 631 0 }
- 632
+ 631
+ 632 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
633
-
- 634
-
- 635
-
+
+ 634 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
+ 635 0 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
636
-
- 637
-
- 638
-
+ }
+ 637 0 if (proxyPort != null && !proxyPort.isEmpty()) {
+ 638 0 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
639
-
- 640
- public void execute() throws MojoExecutionException, MojoFailureException {
- 641 0 final Engine engine = executeDependencyCheck();
- 642 0 generateExternalReports(engine);
- 643 0 if (this .failBuildOnCVSS <= 10) {
- 644 0 checkForFailure(engine.getDependencies());
+ }
+ 640 0 if (proxyUsername != null && !proxyUsername.isEmpty()) {
+ 641 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUsername);
+ 642
+ }
+ 643 0 if (proxyPassword != null && !proxyPassword.isEmpty()) {
+ 644 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPassword);
645
}
- 646 0 }
- 647
-
+ 646 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
+ 647 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
648
-
- 649
-
+ }
+ 649 0 }
650
-
+
651
-
+
652
-
+
653
-
+
654
-
+
655
- public void generate(@SuppressWarnings("deprecation" ) org.codehaus.doxia.sink.Sink sink,
+
656
- Locale locale) throws MavenReportException {
- 657 0 generate((Sink) sink, null , locale);
- 658 0 }
- 659
-
- 660
-
- 661
-
- 662
-
+
+ 657
+
+ 658
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ 659 0 final Engine engine = executeDependencyCheck();
+ 660 0 generateExternalReports(engine);
+ 661 0 if (this .failBuildOnCVSS <= 10) {
+ 662 0 checkForFailure(engine.getDependencies());
663
-
- 664
-
+ }
+ 664 0 }
665
-
+
666
-
+
667
-
+
668
- public void generate(Sink sink, SinkFactory sinkFactory, Locale locale) throws MavenReportException {
- 669 0 final Engine engine = executeDependencyCheck();
- 670 0 generateMavenSiteReport(engine, sink);
- 671 0 }
+
+ 669
+
+ 670
+
+ 671
+
672
-
+
673
-
+ public void generate(@SuppressWarnings("deprecation" ) org.codehaus.doxia.sink.Sink sink,
674
-
- 675
-
- 676
-
+ Locale locale) throws MavenReportException {
+ 675 0 generate((Sink) sink, null , locale);
+ 676 0 }
677
-
+
678
-
- 679
- public String getOutputName() {
- 680 0 return reportName;
- 681
- }
- 682
-
- 683
- 684
-
- 685
+ 679
+
+ 680
- 686
-
- 687
+ 681
+
+ 682
+
+ 683
+
+ 684
+
+ 685
- 688
- public String getCategoryName() {
- 689 0 return MavenReport.CATEGORY_PROJECT_REPORTS;
+ 686
+ public void generate(Sink sink, SinkFactory sinkFactory, Locale locale) throws MavenReportException {
+ 687 0 final Engine engine = executeDependencyCheck();
+ 688 0 generateMavenSiteReport(engine, sink);
+ 689 0 }
690
- }
- 691
+ 691
+
692
693
-
+
694
695
-
+
696
-
+
697
-
- 698
- public String getName(Locale locale) {
- 699 0 return name;
- 700
+ public String getOutputName() {
+ 698 0 return reportName;
+ 699
}
+ 700
+
701
-
+
702
-
+
703
-
+
704
-
+
705
-
- 706
- 707
- public void setReportOutputDirectory(File directory) {
- 708 0 reportOutputDirectory = directory;
- 709 0 }
- 710
+ 706
+ public String getCategoryName() {
+ 707 0 return MavenReport.CATEGORY_PROJECT_REPORTS;
+ 708
+ }
+ 709
- 711
+ 710
+ 711
+
712
-
- 713
+ 713
+
714
-
+
715
716
- public File getReportOutputDirectory() {
- 717 0 return reportOutputDirectory;
+ public String getName(Locale locale) {
+ 717 0 return name;
718
}
719
@@ -1160,109 +1157,142 @@
720
721
-
+
722
-
+
723
-
+
724
-
+
725
-
- 726
-
- 727
- public String getDescription(Locale locale) {
- 728 0 return description;
+ public void setReportOutputDirectory(File directory) {
+ 726 0 reportOutputDirectory = directory;
+ 727 0 }
+ 728
+
729
- }
+
730
-
+
731
-
+
732
-
+
733
-
- 734
-
- 735
+ 734
+ public File getReportOutputDirectory() {
+ 735 0 return reportOutputDirectory;
736
- public boolean isExternalReport() {
- 737 0 return externalReport;
- 738
}
- 739
+ 737
- 740
+ 738
+ 739
+
+ 740
+
741
-
- 742
+ 742
+
743
-
+
744
745
- public boolean canGenerateReport() {
- 746 0 return true ;
+ public String getDescription(Locale locale) {
+ 746 0 return description;
747
}
748
-
- 749
- 750
+ 749
+ 750
+
751
-
- 752
-
- 753
- 754
-
- 755
-
- 756
-
- 757
+ 752
+
+ 753
+ 754
+ public boolean isExternalReport() {
+ 755 0 return externalReport;
+ 756
+ }
+ 757
+
758
- private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
- 759 0 final StringBuilder ids = new StringBuilder();
- 760 0 for (Dependency d : dependencies) {
- 761 0 for (Vulnerability v : d.getVulnerabilities()) {
- 762 0 if (v.getCvssScore() >= failBuildOnCVSS) {
- 763 0 if (ids.length() == 0) {
- 764 0 ids.append(v.getName());
+
+ 759
+
+ 760
+
+ 761
+
+ 762
+
+ 763
+ public boolean canGenerateReport() {
+ 764 0 return true ;
765
- } else {
- 766 0 ids.append(", " ).append(v.getName());
+ }
+ 766
+
767
- }
+
768
- }
+
769
- }
+
770
- }
- 771 0 if (ids.length() > 0) {
- 772 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
+
+ 771
+
+ 772
+
773
- + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
+
774
- + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
- 775 0 throw new MojoFailureException(msg);
+
+ 775
+
776
+ private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
+ 777 0 final StringBuilder ids = new StringBuilder();
+ 778 0 for (Dependency d : dependencies) {
+ 779 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 780 0 if (v.getCvssScore() >= failBuildOnCVSS) {
+ 781 0 if (ids.length() == 0) {
+ 782 0 ids.append(v.getName());
+ 783
+ } else {
+ 784 0 ids.append(", " ).append(v.getName());
+ 785
+ }
+ 786
+ }
+ 787
+ }
+ 788
}
- 777 0 }
- 778
+ 789 0 if (ids.length() > 0) {
+ 790 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
+ 791
+ + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
+ 792
+ + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
+ 793 0 throw new MojoFailureException(msg);
+ 794
+ }
+ 795 0 }
+ 796
}
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
index d9e67789f..0f0f6446a 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
@@ -747,6 +747,6 @@
}
-
+
diff --git a/dependency-check-maven/configuration.html b/dependency-check-maven/configuration.html
index 3d6cd5f9b..f4278cf25 100644
--- a/dependency-check-maven/configuration.html
+++ b/dependency-check-maven/configuration.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven -
@@ -54,7 +54,7 @@
-
+
/
@@ -67,8 +67,8 @@
- Last Published: 2013-10-20 |
- Version: 1.0.4
+ Last Published: 2013-11-16 |
+ Version: 1.0.5
@@ -192,24 +192,45 @@
+logFile
+
+The file path to write verbose logging information.
+
+
+
+
connectionTimeout
The Connection Timeout.
-
+
proxyUrl
The Proxy URL.
-
+
proxyPort
The Proxy Port.
+
+
+
+proxyUsername
+
+Defines the proxy user name.
+
+
+
+
+proxyPassword
+
+Defines the proxy password.
+
diff --git a/dependency-check-maven/cpd.html b/dependency-check-maven/cpd.html
index 5a54e27f7..aad61565d 100644
--- a/dependency-check-maven/cpd.html
+++ b/dependency-check-maven/cpd.html
@@ -1,13 +1,13 @@