mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-17 23:04:07 +01:00
removed un-necassary functionality from all analyzers and the base engine
Former-commit-id: e6b97601ff24ced2a2016d03b35869d083b947db
This commit is contained in:
@@ -209,17 +209,15 @@ public class Engine {
|
|||||||
final List<Analyzer> analyzerList = analyzers.get(phase);
|
final List<Analyzer> analyzerList = analyzers.get(phase);
|
||||||
|
|
||||||
for (Analyzer a : analyzerList) {
|
for (Analyzer a : analyzerList) {
|
||||||
final Iterator<Dependency> itrDependencies = dependencies.iterator();
|
//need to create a copy of the collection because some of the
|
||||||
while (itrDependencies.hasNext()) {
|
// analyzers may modify it. This prevents ConcurrentModificationExceptions.
|
||||||
final Dependency d = itrDependencies.next();
|
final Set<Dependency> dependencySet = new HashSet<Dependency>();
|
||||||
|
dependencySet.addAll(dependencies);
|
||||||
|
for (Dependency d : dependencySet) {
|
||||||
if (a.supportsExtension(d.getFileExtension())) {
|
if (a.supportsExtension(d.getFileExtension())) {
|
||||||
try {
|
try {
|
||||||
a.analyze(d, this);
|
a.analyze(d, this);
|
||||||
//the following is mainly to deal with the DependencyBundlingAnalyzer
|
} catch (AnalysisException ex) {
|
||||||
if (a.getPostAnalysisAction() == Analyzer.PostAnalysisAction.REMOVE_DEPENDENCY) {
|
|
||||||
itrDependencies.remove();
|
|
||||||
}
|
|
||||||
} catch (AnalysisException ex) {
|
|
||||||
d.addAnalysisException(ex);
|
d.addAnalysisException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,13 +58,4 @@ public abstract class AbstractAnalyzer implements Analyzer {
|
|||||||
public void close() {
|
public void close() {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to indicate if any steps should be taken after the analysis. The
|
|
||||||
* abstract implementation returns NOTHING.
|
|
||||||
* @return NOTHING
|
|
||||||
*/
|
|
||||||
public PostAnalysisAction getPostAnalysisAction() {
|
|
||||||
return PostAnalysisAction.NOTHING;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,23 +99,4 @@ public interface Analyzer {
|
|||||||
* @throws Exception is thrown if an exception occurs closing the analyzer.
|
* @throws Exception is thrown if an exception occurs closing the analyzer.
|
||||||
*/
|
*/
|
||||||
void close() throws Exception;
|
void close() throws Exception;
|
||||||
|
|
||||||
/**
|
|
||||||
* An enumeration of Post Analysis Actions.
|
|
||||||
*/
|
|
||||||
public enum PostAnalysisAction {
|
|
||||||
/**
|
|
||||||
* No action should be taken.
|
|
||||||
*/
|
|
||||||
NOTHING,
|
|
||||||
/**
|
|
||||||
* The dependency should be removed from the list of dependencies scanned.
|
|
||||||
*/
|
|
||||||
REMOVE_DEPENDENCY
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the post analysis action.
|
|
||||||
* @return the post analysis action
|
|
||||||
*/
|
|
||||||
PostAnalysisAction getPostAnalysisAction();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -512,12 +512,4 @@ public class CPEAnalyzer implements Analyzer {
|
|||||||
public void initialize() throws Exception {
|
public void initialize() throws Exception {
|
||||||
this.open();
|
this.open();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Used to indicate if any steps should be taken after the analysis. The
|
|
||||||
* abstract implementation returns NOTHING.
|
|
||||||
* @return NOTHING
|
|
||||||
*/
|
|
||||||
public PostAnalysisAction getPostAnalysisAction() {
|
|
||||||
return PostAnalysisAction.NOTHING;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,13 +159,4 @@ public class NvdCveAnalyzer implements Analyzer {
|
|||||||
public void initialize() throws Exception {
|
public void initialize() throws Exception {
|
||||||
this.open();
|
this.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to indicate if any steps should be taken after the analysis. The
|
|
||||||
* abstract implementation returns NOTHING.
|
|
||||||
* @return NOTHING
|
|
||||||
*/
|
|
||||||
public PostAnalysisAction getPostAnalysisAction() {
|
|
||||||
return PostAnalysisAction.NOTHING;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user