Package io.codemodder
Interface CodemodProvider
public interface CodemodProvider
A type that helps provide functionality codemods. For instance, we may have providers that run
SAST tools, help codemods understand build files, dependency management, etc.
-
Method Summary
Modifier and TypeMethodDescriptionSet<com.google.inject.AbstractModule>
getModules
(Path repository, List<Path> includedFiles, List<String> pathIncludes, List<String> pathExcludes, List<Class<? extends CodeChanger>> codemodTypes, List<RuleSarif> sarifs, Path sonarIssuesJsonPath) Return a set of Guice modules that allow dependency injectionTools this provider is interested in processing the SARIF output of.
-
Method Details
-
getModules
Set<com.google.inject.AbstractModule> getModules(Path repository, List<Path> includedFiles, List<String> pathIncludes, List<String> pathExcludes, List<Class<? extends CodeChanger>> codemodTypes, List<RuleSarif> sarifs, Path sonarIssuesJsonPath) Return a set of Guice modules that allow dependency injection- Parameters:
repository
- the repository rootcodemodTypes
- the codemod types that are being runsarifs
- the SARIF output of tools that are being runincludedFiles
- the files that qualify for inclusion based on the patterns providedpathIncludes
- the path includes provided to the CLI (which could inform the providers on their own analysis)pathExcludes
- the path excludes provided to the CLI (which could inform the providers on their own analysis)sonarIssuesJsonPath
- the path to a Sonar issues JSON file retrieved from their web API -- may be null- Returns:
- a set of modules that perform dependency injection
-
wantsSarifToolNames
Tools this provider is interested in processing the SARIF output of. Codemodder CLI will look for the SARIF outputted by tools in this list in the repository root and then provide the results togetModules(Path, List, List, List, List, List, Path)
as aList
ofRuleSarif
s.By default, this returns an empty list.
- Returns:
- a list of tool names that output SARIF that this provider wants to process
-