Class PythonPackageAnalyzer

  • All Implemented Interfaces:
    java.io.FileFilter, Analyzer, FileTypeAnalyzer

    @ThreadSafe
    public class PythonPackageAnalyzer
    extends AbstractFileTypeAnalyzer
    Used to analyze a Python package, and collect information that can be used to determine the associated CPE.
    Author:
    Dale Visser
    • Field Detail

      • DEPENDENCY_ECOSYSTEM

        public static final java.lang.String DEPENDENCY_ECOSYSTEM
        A descriptor for the type of dependencies processed or added by this analyzer.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PythonPackageAnalyzer

        public PythonPackageAnalyzer()
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the Python Package Analyzer.
        Returns:
        the name of the analyzer
      • getAnalysisPhase

        public AnalysisPhase getAnalysisPhase()
        Tell that we are used for information collection.
        Returns:
        INFORMATION_COLLECTION
      • getAnalyzerEnabledSettingKey

        protected java.lang.String getAnalyzerEnabledSettingKey()
        Returns the key name for the analyzers enabled setting.
        Specified by:
        getAnalyzerEnabledSettingKey in class AbstractAnalyzer
        Returns:
        the key name for the analyzers enabled setting
      • analyzeDependency

        protected void analyzeDependency​(Dependency dependency,
                                         Engine engine)
                                  throws AnalysisException
        Analyzes python packages and adds evidence to the dependency.
        Specified by:
        analyzeDependency in class AbstractAnalyzer
        Parameters:
        dependency - the dependency being analyzed
        engine - the engine being used to perform the scan
        Throws:
        AnalysisException - thrown if there is an unrecoverable error analyzing the dependency