mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-14 14:11:35 +01:00
Updates to abstract analyzer and subclasses - removed duplicate code
Former-commit-id: 618c113750bf2af612d9e476fd6992db5147fcdc
This commit is contained in:
@@ -43,4 +43,28 @@ public abstract class AbstractAnalyzer implements Analyzer {
|
||||
Collections.addAll(set, strings);
|
||||
return set;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The initialize method does nothing for this Analyzer.
|
||||
*/
|
||||
public void initialize() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* The close method does nothing for this Analyzer.
|
||||
*/
|
||||
public void close() {
|
||||
//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,4 +99,11 @@ public interface Analyzer {
|
||||
* @throws Exception is thrown if an exception occurs closing the analyzer.
|
||||
*/
|
||||
void close() throws Exception;
|
||||
|
||||
public enum PostAnalysisAction {
|
||||
NOTHING,
|
||||
REMOVE_JAR
|
||||
}
|
||||
|
||||
PostAnalysisAction getPostAnalysisAction();
|
||||
}
|
||||
|
||||
@@ -84,23 +84,6 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
||||
return ANALYSIS_PHASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialize method does nothing for this Analyzer.
|
||||
*
|
||||
* @throws Exception never thrown by this analyzer
|
||||
*/
|
||||
public void initialize() throws Exception {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* The close method does nothing for this Analyzer.
|
||||
*
|
||||
* @throws Exception never thrown by this analyzer
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
//do nothing
|
||||
}
|
||||
/**
|
||||
* a list of spring versions.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.owasp.dependencycheck.Engine;
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@gmail.com)
|
||||
*/
|
||||
public class FileNameAnalyzer implements Analyzer {
|
||||
public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
|
||||
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
@@ -109,18 +109,4 @@ public class FileNameAnalyzer implements Analyzer {
|
||||
fileName, Evidence.Confidence.HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialize method does nothing for this Analyzer.
|
||||
*/
|
||||
public void initialize() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* The close method does nothing for this Analyzer.
|
||||
*/
|
||||
public void close() {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.owasp.dependencycheck.dependency.Evidence;
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@gmail.com)
|
||||
*/
|
||||
public class HintAnalyzer implements Analyzer {
|
||||
public class HintAnalyzer extends AbstractAnalyzer implements Analyzer {
|
||||
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
@@ -106,18 +106,4 @@ public class HintAnalyzer implements Analyzer {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialize method does nothing for this Analyzer.
|
||||
*/
|
||||
public void initialize() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* The close method does nothing for this Analyzer.
|
||||
*/
|
||||
public void close() {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.owasp.dependencycheck.dependency.Identifier;
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@gmail.com)
|
||||
*/
|
||||
public class SpringCleaningAnalyzer extends AbstractAnalyzer {
|
||||
public class SpringCleaningAnalyzer extends AbstractAnalyzer implements Analyzer {
|
||||
|
||||
/**
|
||||
* The set of file extensions supported by this analyzer.
|
||||
@@ -86,23 +86,6 @@ public class SpringCleaningAnalyzer extends AbstractAnalyzer {
|
||||
return ANALYSIS_PHASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialize method does nothing for this Analyzer.
|
||||
*
|
||||
* @throws Exception never thrown by this analyzer
|
||||
*/
|
||||
public void initialize() throws Exception {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* The close method does nothing for this Analyzer.
|
||||
*
|
||||
* @throws Exception never thrown by this analyzer
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
//do nothing
|
||||
}
|
||||
/**
|
||||
* a list of spring versions.
|
||||
*/
|
||||
@@ -119,7 +102,6 @@ public class SpringCleaningAnalyzer extends AbstractAnalyzer {
|
||||
* file.
|
||||
*/
|
||||
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
|
||||
|
||||
collectSpringFrameworkIdentifiers(engine);
|
||||
|
||||
final List<Identifier> identifiersToRemove = new ArrayList<Identifier>();
|
||||
|
||||
Reference in New Issue
Block a user