Class TaintAnalysisResult


  • public class TaintAnalysisResult
    extends Object
    Collected taint paths from one analysis run, indexed by vulnerability type and severity.
    • Constructor Detail

      • TaintAnalysisResult

        public TaintAnalysisResult()
        Creates an empty result.
    • Method Detail

      • getPaths

        public List<TaintPath> getPaths()
        Returns:
        the paths
      • addPath

        public void addPath​(TaintPath path)
        Records a taint path under its vulnerability type and severity.
        Parameters:
        path - the path to record
      • getTotalVulnerabilities

        public int getTotalVulnerabilities()
        Returns:
        the total number of recorded paths, sanitized included
      • getUnsanitizedCount

        public int getUnsanitizedCount()
        Returns:
        the number of unsanitized paths
      • getSanitizedCount

        public int getSanitizedCount()
        Returns:
        the number of sanitized paths
      • getUnsanitizedPaths

        public List<TaintPath> getUnsanitizedPaths()
        Returns:
        the paths with no sanitizer on the way
      • getSanitizedPaths

        public List<TaintPath> getSanitizedPaths()
        Returns:
        the paths that passed through a sanitizer
      • getPathsByVulnerability

        public List<TaintPath> getPathsByVulnerability​(VulnerabilityType type)
        Looks up paths of one vulnerability type.
        Parameters:
        type - the vulnerability type
        Returns:
        the matching paths, or an empty list
      • getPathsBySeverity

        public List<TaintPath> getPathsBySeverity​(Severity severity)
        Looks up paths of one severity.
        Parameters:
        severity - the severity level
        Returns:
        the matching paths, or an empty list
      • getCriticalPaths

        public List<TaintPath> getCriticalPaths()
        Returns:
        the unsanitized paths of critical severity
      • getHighPaths

        public List<TaintPath> getHighPaths()
        Returns:
        the unsanitized paths of high severity
      • hasVulnerabilities

        public boolean hasVulnerabilities()
        Returns:
        whether any unsanitized path was found
      • hasCriticalVulnerabilities

        public boolean hasCriticalVulnerabilities()
        Returns:
        whether any unsanitized critical path was found
      • getVulnerabilityCounts

        public Map<VulnerabilityType,​Integer> getVulnerabilityCounts()
        Tallies unsanitized paths per vulnerability type.
        Returns:
        a map from vulnerability type to path count
      • getSeverityCounts

        public Map<Severity,​Integer> getSeverityCounts()
        Tallies unsanitized paths per severity.
        Returns:
        a map from severity to path count
      • getSummary

        public String getSummary()
        Renders totals plus per-severity and per-type breakdowns.
        Returns:
        a multi-line summary
      • getDetailedReport

        public String getDetailedReport()
        Renders the summary followed by each critical, high, and medium unsanitized path.
        Returns:
        a multi-line report