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 ClassesModifier and TypeInterfaceDescriptionstatic final class
An empty implementation ofRuleSarif
for binding codemods with no SARIF results. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the tool driver that produced this SARIF.List<com.contrastsecurity.sarif.Region>
Get all the regions for the SARIF with the matching rule IDList<com.contrastsecurity.sarif.Result>
getResultsByPath
(Path path) Get all the SARIF results with the matching pathgetRule()
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
-
EMPTY
ARuleSarif
with no results.
-
-
Method Details
-
getRegionsFromResultsByRule
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
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.
-