Package io.codemodder

Interface RuleSarif

All Known Implementing Classes:
RuleSarif.EmptyRuleSarif

public interface RuleSarif
Defines a model for interacting with SARIF.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    An empty implementation of RuleSarif for binding codemods with no SARIF results.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final RuleSarif
    A RuleSarif with no results.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the tool driver that produced this SARIF.
    List<com.contrastsecurity.sarif.Region>
    Get all the regions for the SARIF with the matching rule ID
    List<com.contrastsecurity.sarif.Result>
    Get all the SARIF results with the matching path
    Returns the string ID for the rule.
    com.contrastsecurity.sarif.SarifSchema210
    Return the entire SARIF as a model in case more comprehensive inspection is needed.
  • Field Details

  • Method Details

    • getRegionsFromResultsByRule

      List<com.contrastsecurity.sarif.Region> getRegionsFromResultsByRule(Path path)
      Get all the regions for the SARIF with the matching rule ID
      Parameters:
      path - the file being scanned
      Returns:
      the source code regions where the given rule was found in the given file
    • getResultsByPath

      List<com.contrastsecurity.sarif.Result> getResultsByPath(Path path)
      Get all the SARIF results with the matching path
      Parameters:
      path - the file being scanned
      Returns:
      the results associated with the given file
    • rawDocument

      com.contrastsecurity.sarif.SarifSchema210 rawDocument()
      Return the entire SARIF as a model in case more comprehensive inspection is needed.
    • getRule

      String getRule()
      Returns the string ID for the rule.
    • getDriver

      String getDriver()
      Returns the tool driver that produced this SARIF.