Class AbstractDependencyComparingAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.AbstractDependencyComparingAnalyzer
- All Implemented Interfaces:
Analyzer
- Direct Known Subclasses:
DependencyBundlingAnalyzer, DependencyMergingAnalyzer
This analyzer ensures dependencies that should be grouped together, to remove excess noise from the report, are grouped. An example would be Spring, Spring Beans, Spring MVC, etc. If they are all for the same version and have the same relative path then these should be grouped into a single dependency under the core/main library.
Note, this grouping only works on dependencies with identified CVE entries
- Author:
- Jeremy Long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidanalyzeDependency(Dependency ignore, Engine engine) Analyzes a set of dependencies.protected abstract booleanevaluateDependencies(Dependency dependency, Dependency nextDependency, Set<Dependency> dependenciesToRemove) Evaluates the dependenciesprotected booleanReturns a flag indicating if this analyzer has run.final booleanDoes not support parallel processing as it only runs once and then operates on all dependencies.Methods inherited from class AbstractAnalyzer
analyze, close, closeAnalyzer, getAnalyzerEnabledSettingKey, getSettings, initialize, isEnabled, prepare, prepareAnalyzer, setEnabledMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Analyzer
getAnalysisPhase, getName
-
Constructor Details
-
AbstractDependencyComparingAnalyzer
public AbstractDependencyComparingAnalyzer()
-
-
Method Details
-
getAnalyzed
protected boolean getAnalyzed()Returns a flag indicating if this analyzer has run. This analyzer only runs once. Note this is currently only used in the unit tests.- Returns:
- a flag indicating if this analyzer has run. This analyzer only runs once
-
supportsParallelProcessing
public final boolean supportsParallelProcessing()Does not support parallel processing as it only runs once and then operates on all dependencies.- Specified by:
supportsParallelProcessingin interfaceAnalyzer- Overrides:
supportsParallelProcessingin classAbstractAnalyzer- Returns:
- whether or not parallel processing is enabled
- See Also:
-
analyzeDependency
Analyzes a set of dependencies. If they have been found to have the same base path and the same set of identifiers they are likely related. The related dependencies are bundled into a single reportable item.- Specified by:
analyzeDependencyin classAbstractAnalyzer- Parameters:
ignore- this analyzer ignores the dependency being analyzedengine- the engine that is scanning the dependencies- Throws:
AnalysisException- is thrown if there is an error reading the JAR file.
-
evaluateDependencies
protected abstract boolean evaluateDependencies(Dependency dependency, Dependency nextDependency, Set<Dependency> dependenciesToRemove) Evaluates the dependencies- Parameters:
dependency- a dependency to comparenextDependency- a dependency to comparedependenciesToRemove- a set of dependencies that will be removed- Returns:
- true if a dependency is removed; otherwise false
-