Index
All Classes and Interfaces|All Packages|Constant Field Values
A
- addImportIfMissing(CompilationUnit, Class<?>) - Static method in class io.codemodder.ast.ASTTransforms
-
Add an import in alphabetical order.
- addImportIfMissing(CompilationUnit, String) - Static method in class io.codemodder.ast.ASTTransforms
-
Add an import in alphabetical order.
- addStatementAfterStatement(Statement, Statement) - Static method in class io.codemodder.ast.ASTTransforms
-
Adds an
Statement
after anotherStatement
. - addStatementAt(NodeWithStatements<N>, Statement, int) - Static method in class io.codemodder.ast.ASTTransforms
-
Adds a statement to a node at a given index.
- addStatementBeforeStatement(Statement, Statement) - Static method in class io.codemodder.ast.ASTTransforms
-
Adds an
Statement
before anotherStatement
. - addStaticImportIfMissing(CompilationUnit, String) - Static method in class io.codemodder.ast.ASTTransforms
- AGPL_3_0 - Static variable in class io.codemodder.DependencyLicenses
- ALL_COMMENTS - Static variable in interface io.codemodder.NodeCollector
-
A
NodeCollector
implementation that collects all comments from aCompilationUnit
. - ALL_FROM_TYPE - Static variable in interface io.codemodder.NodeCollector
-
A
NodeCollector
implementation that collects all nodes of a specified type. - any() - Static method in interface io.codemodder.IncludesExcludes
-
Return an
IncludesExcludes
that matches all files and lines. - APACHE_2_0 - Static variable in class io.codemodder.DependencyLicenses
- APPENDER_NAME - Static variable in class io.codemodder.LoggingConfigurator
- areChangesApplied() - Method in interface io.codemodder.javaparser.ChangesResult
- artifact() - Method in interface io.codemodder.DependencyGAV
-
The artifact of the dependency.
- artifact() - Method in class io.codemodder.DependencyGAV.Default
- asPath() - Method in interface io.codemodder.CodeDirectory
-
The filesystem directory path we are running against.
- ASTExpectations - Class in io.codemodder.javaparser
-
A utility for validating the shape of ASTs and filtering them to retrieve.
- ASTExpectations.ExpressionStatementExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering expression statements.
- ASTExpectations.FieldAccessExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering name expressions.
- ASTExpectations.LocalVariableDeclaratorExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering a single variable declaration.
- ASTExpectations.MethodCallExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering method call expressions.
- ASTExpectations.NameExpressionExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering name expressions.
- ASTExpectations.NodeExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering generic AST nodes.
- ASTExpectations.StringLiteralExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering string literals.
- ASTExpectations.VariableDeclarationExprExpectation - Class in io.codemodder.javaparser
-
A type for querying and filtering variable declaration(s).
- ASTs - Class in io.codemodder.ast
-
A static library for querying and returning patterns over AST nodes.
- ASTs() - Constructor for class io.codemodder.ast.ASTs
- ASTs.ReverseEvaluationOrder - Class in io.codemodder.ast
-
A
Node
iterator iterating over all the nodes that precedes a given node in the pre-order of its AST. - ASTTransforms - Class in io.codemodder.ast
- ASTTransforms() - Constructor for class io.codemodder.ast.ASTTransforms
B
- BOOLEAN - Enum constant in enum class io.codemodder.CodemodParameter.ParameterType
- BSD_2_CLAUSE - Static variable in class io.codemodder.DependencyLicenses
- BSD_3_CLAUSE - Static variable in class io.codemodder.DependencyLicenses
- build(String, String, SarifSchema210, CodeDirectory) - Method in interface io.codemodder.RuleSarifFactory
-
Builds
RuleSarif
s if it supportstoolName
. - buildFindingId(Result, Path, int) - Static method in class io.codemodder.SarifFindingKeyUtil
-
Builds a finding ID for a SARIF finding based on the provided result, file path, and line number.
C
- CallReplacer - Interface in io.codemodder.javaparser
- CallReplacer.CallReplacerBuilder - Interface in io.codemodder.javaparser
-
Builder for
CallReplacer
. - changes() - Method in interface io.codemodder.CodemodFileScanningResult
-
Returns the changes that were made to the file.
- changesApplied - Static variable in interface io.codemodder.javaparser.ChangesResult
- changesAppliedWith(List<DependencyGAV>) - Static method in interface io.codemodder.javaparser.ChangesResult
- ChangesResult - Interface in io.codemodder.javaparser
-
Represents the result of changes made during parsing.
- CodeChanger - Interface in io.codemodder
-
The base of a codemod type.
- codeDirectory() - Method in interface io.codemodder.CodemodInvocationContext
-
The root directory where the project being transformed lives.
- CodeDirectory - Interface in io.codemodder
-
Holds a code directory (e.g., a repository root).
- Codemod - Annotation Interface in io.codemodder
-
Used to mark types providing codemod functionality and provide the necessary metadata.
- CodemodChange - Class in io.codemodder
-
Represents a change made to the code.
- CodemodExecutionPriority - Enum Class in io.codemodder
-
A description of how important it is that a codemod execute in the list of codemods being run.
- CodemodExecutor - Interface in io.codemodder
-
A type responsible for executing a codemod on a set of files.
- CodemodFileScanningResult - Interface in io.codemodder
-
Represents the result of scanning a file for changes.
- codemodId() - Method in interface io.codemodder.CodemodInvocationContext
-
The ID of the codemod changing the file.
- CodemodIdPair - Class in io.codemodder
-
A codemod and its ID.
- CodemodIdPair(String, CodeChanger) - Constructor for class io.codemodder.CodemodIdPair
- CodemodInvocationContext - Interface in io.codemodder
-
The context we provide to each codemod.
- CodemodLoader - Class in io.codemodder
-
This type is responsible for loading codemods and the surrounding subsystem.
- CodemodLoader(List<Class<? extends CodeChanger>>, CodemodRegulator, Path, List<String>, List<String>, List<Path>, Map<String, List<RuleSarif>>, List<ParameterArgument>, List<Path>, Path, Path) - Constructor for class io.codemodder.CodemodLoader
- CodemodPackageUpdateResult - Interface in io.codemodder
-
A
- CodemodParameter - Annotation Interface in io.codemodder
-
Describes a codemod parameter.
- CodemodParameter.ParameterType - Enum Class in io.codemodder
- CodemodProvider - Interface in io.codemodder
-
A type that helps provide functionality codemods.
- CodemodRegulator - Interface in io.codemodder
-
A type that is relied on to inform our in-flight analysis on whether codemods are allowed.
- CodemodRegulator.DefaultCodemodRegulator - Class in io.codemodder
- CodemodReporterStrategy - Interface in io.codemodder
-
A type responsible for reporting codemod changes.
- CodemodResources - Class in io.codemodder
-
A utility class for accessing a codemod's resources in it's "default location" the classpath.
- CodemodRunner - Interface in io.codemodder
-
Type responsible for running a codemod on a single file, performing the analysis and file changes.
- CodeTFProvider - Interface in io.codemodder
-
A type that plugins can implement to enrich or modify CodeTF results.
- collectNodes(CompilationUnit, Class<? extends Node>) - Method in interface io.codemodder.NodeCollector
-
Collects nodes of the specified type from the
CompilationUnit
. - column() - Method in record class io.codemodder.Position
-
Returns the value of the
column
record component. - combineResources(TryStmt) - Static method in class io.codemodder.ast.ASTTransforms
-
Given a
TryStmt
without any finally and catch clauses, and that is the first statement of a try with resources block, merge the two try statements into one. - compareTo(SourceDirectory) - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- CompositeJavaParserChanger - Class in io.codemodder
-
A type that allows composing multiple
JavaParserChanger
instances are under the same umbrella. - CompositeJavaParserChanger(CodemodReporterStrategy, JavaParserChanger...) - Constructor for class io.codemodder.CompositeJavaParserChanger
- CompositeJavaParserChanger(JavaParserChanger...) - Constructor for class io.codemodder.CompositeJavaParserChanger
- configure(LoggerContext) - Method in class io.codemodder.LoggingConfigurator
- content() - Method in interface io.codemodder.Line
- contents() - Method in interface io.codemodder.CodemodInvocationContext
-
The original contents of the file before this codemod
- create() - Static method in interface io.codemodder.EncodingDetector
- create() - Static method in interface io.codemodder.SarifParser
- create(DependencyGAV) - Method in interface io.codemodder.DependencyDescriptor
-
Creates a description for a dependency that a codemod wants to add to the project.
- create(List<DependencyGAV>, List<DependencyGAV>, List<CodeTFChangesetEntry>, Set<Path>) - Static method in interface io.codemodder.DependencyUpdateResult
- create(List<SourceDirectory>) - Method in interface io.codemodder.javaparser.JavaParserFactory
-
Create a JavaParser instance for the given project source directories.
- createDefault() - Static method in interface io.codemodder.FileCache
- createDefault() - Static method in interface io.codemodder.SourceDirectoryLister
- createDefault(int) - Static method in interface io.codemodder.FileCache
- createDefault(String, String, String) - Static method in interface io.codemodder.DependencyGAV
-
Create a new
DependencyGAV
with the given group, artifact, and version -- the bare minimum to describe a dependency for injection. - createDefault(String, String, String, String, String, String, Boolean) - Static method in interface io.codemodder.DependencyGAV
-
Create a new
DependencyGAV
with the given group, artifact, version, justification, license, and repository URL. - createDefault(Path, List<String>) - Static method in interface io.codemodder.SourceDirectory
- createMarkdownDescriptor() - Static method in interface io.codemodder.DependencyDescriptor
-
Create a descriptor that uses markdown.
D
- Default(List<PathMatcher>, List<PathMatcher>) - Constructor for class io.codemodder.IncludesExcludes.Default
- Default(Set<Integer>, Path) - Constructor for class io.codemodder.XPathStreamProcessChange.Default
- DefaultRuleSetting - Enum Class in io.codemodder
-
During analysis, this will be the default setting for every rule.
- DefaultSourceDirectoryLister() - Constructor for class io.codemodder.SourceDirectoryLister.DefaultSourceDirectoryLister
- defaultValue() - Element in annotation interface io.codemodder.CodemodParameter
-
The default value if the user didn't specify one.
- dependencies() - Method in interface io.codemodder.CodemodInvocationContext
-
The list of dependencies that were found at pom file
- DependencyDescriptor - Interface in io.codemodder
-
A type that describes a new dependency being added to a project.
- DependencyGAV - Interface in io.codemodder
-
Models a Java dependency we might want to add.
- DependencyGAV.Default - Class in io.codemodder
- DependencyLicenses - Class in io.codemodder
-
The license, if known, of a dependency.
- DependencyUpdateResult - Interface in io.codemodder
-
Represents the result of a dependency update operation.
- detect(Path) - Method in interface io.codemodder.EncodingDetector
-
Try to detect the encoding of a file.
- detectorRule() - Method in interface io.codemodder.FixOnlyCodeChanger
-
A description of the rule.
- DISABLED - Enum constant in enum class io.codemodder.DefaultRuleSetting
E
- Either<L,
R> - Class in io.codemodder -
An implementation of the Either monad.
- empty() - Static method in interface io.codemodder.CodemodReporterStrategy
- EMPTY - Static variable in interface io.codemodder.RuleSarif
-
A
RuleSarif
with no results. - EMPTY_UPDATE - Static variable in interface io.codemodder.DependencyUpdateResult
-
An update reporting no actions and no errors.
- EmptyRuleSarif() - Constructor for class io.codemodder.RuleSarif.EmptyRuleSarif
- ENABLED - Enum constant in enum class io.codemodder.DefaultRuleSetting
- EncodingDetector - Interface in io.codemodder
-
Detects the encoding of a file.
- end() - Method in record class io.codemodder.SourceCodeRegion
-
Returns the value of the
end
record component. - EPL_1_0 - Static variable in class io.codemodder.DependencyLicenses
- EPL_2_0 - Static variable in class io.codemodder.DependencyLicenses
- equals(Object) - Method in class io.codemodder.CodemodChange
- equals(Object) - Method in class io.codemodder.DependencyGAV.Default
- equals(Object) - Method in record class io.codemodder.Position
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class io.codemodder.SourceCodeRegion
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- erroredFiles() - Method in interface io.codemodder.DependencyUpdateResult
-
The set of files that we attempted to update, but failed.
- EXACT_MATCH - Static variable in interface io.codemodder.RegionNodeMatcher
-
Return true if the
Node
andRegion
start and end at the same location. - execute(List<Path>) - Method in interface io.codemodder.CodemodExecutor
-
Execute the codemod on the given file paths.
- executionPriority() - Element in annotation interface io.codemodder.Codemod
-
How important it is that this codemod execute sooner in the list of codemods being run.
- expect(Node) - Static method in class io.codemodder.javaparser.ASTExpectations
-
The starting point for validating the shape of an AST and returning a subgraph.
- ExpressionStmtVariableDeclaration - Class in io.codemodder.ast
-
Holds the nodes in the AST that represents a local variable declaration statement.
F
- FileCache - Interface in io.codemodder
-
A cache for file contents.
- files() - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- files() - Method in interface io.codemodder.SourceDirectory
-
The full path of all the source code files within this directory.
- filesFailedToChange() - Method in interface io.codemodder.CodemodPackageUpdateResult
- filter(Predicate<L>, R) - Method in class io.codemodder.Either
-
If it contains the left value, applies the
Predicate
pred
and return anEither
containingorElse
if it fails. - findAllAssignments(LocalVariableDeclaration) - Static method in class io.codemodder.ast.ASTs
-
Finds all assignments of a local variable declaration
- findAllMethodCalls() - Method in interface io.codemodder.ast.LocalDeclaration
-
Finds all method calls for the variable/parameter in this declaration.
- findAllReferences() - Method in interface io.codemodder.ast.LocalDeclaration
-
Finds all references to this variable/parameter in its scope.
- findAllReferences(LocalVariableDeclaration) - Static method in class io.codemodder.ast.ASTs
-
Returns a
List
containing all the referenced oflocalDeclaration
in its scope. - findBlockStatementFrom(Node) - Static method in class io.codemodder.ast.ASTs
-
Searches up the AST to find the
BlockStmt
given theNode
. - findEarliestLocalDeclarationOf(SimpleName) - Static method in class io.codemodder.ast.ASTs
-
Staring from the
Node
start
, checks if there exists a local variable declaration whose name isname
. - findEarliestLocalDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Staring from the
Node
start
, checks if there exists a local variable declaration whose name isname
. - findEarliestLocalVariableDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Staring from the
Node
start
, checks if there exists a local variable declaration whose name isname
. - findFilesWithTrailingPath(String) - Method in interface io.codemodder.CodeDirectory
-
Find a file with the given trailing path.
- findMethodBodyFrom(Node) - Static method in class io.codemodder.ast.ASTs
-
Searches up the AST to find the method body from the given
Node
. - findNonCallableSimpleNameSource(SimpleName) - Static method in class io.codemodder.ast.ASTs
-
Tries to find the declaration that originates a
SimpleName
use that is a Simple Expression Name, Simple Type Name, or Type Parameter within the AST. - findNonCallableSimpleNameSource(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Tries to find a declaration of
name
that is in scope at the givenNode
start
within the AST. - findParentStatementFrom(Node) - Static method in class io.codemodder.ast.ASTs
-
Searches up the AST to find the
Statement
given theNode
. - findScope() - Method in class io.codemodder.ast.ExpressionStmtVariableDeclaration
- findScope() - Method in class io.codemodder.ast.ForEachDeclaration
- findScope() - Method in class io.codemodder.ast.ForInitDeclaration
- findScope() - Method in class io.codemodder.ast.LocalVariableDeclaration
- findScope() - Method in class io.codemodder.ast.TryResourceDeclaration
- findThisDeclaration(ThisExpr) - Static method in class io.codemodder.ast.ASTs
-
Finds the
ClassOrInterfaceDeclaration
that is referenced by aThisExpr
. - findTypeFrom(Node) - Static method in class io.codemodder.ast.ASTs
-
Searches up the AST to find the
ClassOrInterfaceDeclaration
givenNode
. - FixOnlyCodeChanger - Interface in io.codemodder
-
A codemod that only fixes issues and does not perform its own detection, instead relying on external analysis from other tools.
- flatMap(Function<L, Either<A, R>>) - Method in class io.codemodder.Either
-
Applies
func
to the right value if present and returns anEither
containing the result. - flatMapRight(Function<R, Either<L, A>>) - Method in class io.codemodder.Either
-
Applies
func
to the right value if present and returns anEither
containing the result. - ForEachDeclaration - Class in io.codemodder.ast
-
Holds the nodes in the AST that represents a variable declaration in an enhanced for statement .
- ForEachDeclaration(ForEachStmt, VariableDeclarationExpr, VariableDeclarator) - Constructor for class io.codemodder.ast.ForEachDeclaration
- ForInitDeclaration - Class in io.codemodder.ast
-
Holds the nodes in the AST that represents a variable declaration in a for statement init expression.
- ForInitDeclaration(ForStmt, VariableDeclarationExpr, VariableDeclarator) - Constructor for class io.codemodder.ast.ForInitDeclaration
- from(int) - Static method in class io.codemodder.CodemodChange
-
A
CodemodChange
convenience builder for weaves that don't require a new dependency. - from(int, FixedFinding) - Static method in class io.codemodder.CodemodChange
- from(int, DependencyGAV) - Static method in class io.codemodder.CodemodChange
-
A
CodemodChange
convenience builder for weaves that only requires one new dependency. - from(int, Parameter, String) - Static method in class io.codemodder.CodemodChange
-
A
- from(int, String) - Static method in class io.codemodder.CodemodChange
- from(int, List<DependencyGAV>) - Static method in class io.codemodder.CodemodChange
-
Builds a weave.
- from(int, List<DependencyGAV>, FixedFinding) - Static method in class io.codemodder.CodemodChange
- from(Path) - Static method in interface io.codemodder.CodeDirectory
- from(List<CodemodChange>, List<UnfixedFinding>) - Static method in interface io.codemodder.CodemodFileScanningResult
-
Creates a new instance of
CodemodFileScanningResult
from the given values. - from(List<CodeTFPackageAction>, List<CodeTFChangesetEntry>, Set<Path>) - Static method in interface io.codemodder.CodemodPackageUpdateResult
- from(Provider<JavaParser>) - Static method in interface io.codemodder.javaparser.JavaParserFacade
-
Return a simple implementation of the
JavaParserFacade
interface. - from(T) - Method in interface io.codemodder.SourceCodeRegionExtractor
-
Extract a region from a SARIF result.
- FROM_SARIF_FIRST_LOCATION - Static variable in interface io.codemodder.SourceCodeRegionExtractor
- FROM_SARIF_FIRST_THREADFLOW_EVENT - Static variable in interface io.codemodder.SourceCodeRegionExtractor
- fromClasspath(Class<? extends CodeChanger>) - Static method in interface io.codemodder.CodemodReporterStrategy
-
A
CodemodReporterStrategy
that reports based on text from a predictable location on classpath. - fromDescription(String) - Static method in enum class io.codemodder.DefaultRuleSetting
- fromExcludedLines(Set<Integer>) - Static method in interface io.codemodder.LineIncludesExcludes
- fromForDeclaration(ForStmt, VariableDeclarator) - Static method in class io.codemodder.ast.LocalScope
-
Calculates the scope of a local declaration in a
ForStmt
. - fromForEachDeclaration(ForEachStmt) - Static method in class io.codemodder.ast.LocalScope
-
Calculates the scope of a local declaration in a
ForEachStmt
. - fromIncludedLines(Set<Integer>) - Static method in interface io.codemodder.LineIncludesExcludes
- fromLocalDeclaration(ExpressionStmt, VariableDeclarator) - Static method in class io.codemodder.ast.LocalScope
-
Calculates the scope of a local declaration in a
ExpressionStmt
. - fromOptional(Optional<L>, R) - Static method in class io.codemodder.Either
- fromParameter(Parameter) - Static method in class io.codemodder.ast.LocalScope
-
Calculates the scope of a local declaration in a
Parameter
. - fromSarif(Region) - Static method in record class io.codemodder.SourceCodeRegion
-
Translate the SARIF model into the common model.
- fromTryResource(TryStmt, VariableDeclarator) - Static method in class io.codemodder.ast.LocalScope
-
Calculates the scope of a local declaration in a
TryStmt
. - fromVariableDeclarator(VariableDeclarator) - Static method in class io.codemodder.ast.LocalVariableDeclaration
-
For a given
VariableDeclarator
vd
, check if it is part of a local declaration and return its associatedLocalVariableDeclaration
object, if applicable.
G
- get(Path) - Method in interface io.codemodder.FileCache
-
Get the string contents of a file.
- getAllDependencies(Path, Path) - Method in interface io.codemodder.ProjectProvider
-
Returns all dependencies found at given file
- getChange(Path, CodemodChange) - Method in interface io.codemodder.CodemodReporterStrategy
- getChanger() - Method in class io.codemodder.CodemodIdPair
- getClassResourceAsString(Class<?>, String) - Static method in class io.codemodder.CodemodResources
-
Returns a class resource as a
String
. - getCodemods() - Method in class io.codemodder.CodemodLoader
- getDeclaration() - Method in interface io.codemodder.ast.LocalDeclaration
-
The node where the declaration occurs.
- getDeclaration() - Method in class io.codemodder.ast.LocalVariableDeclaration
- getDeclaration() - Method in class io.codemodder.ast.ParameterDeclaration
- getDefaultValue() - Method in interface io.codemodder.Parameter
-
Get the default value of the codemod parameter.
- getDependenciesNeeded() - Method in class io.codemodder.CodemodChange
-
A list of the dependencies that are required to be added to the project in order to support this change.
- getDependenciesRequired() - Method in interface io.codemodder.javaparser.ChangesResult
- getDescription() - Method in interface io.codemodder.CodeChanger
-
A deep description of what this codemod's changes.
- getDescription() - Method in class io.codemodder.CodemodChange
-
A description of the change that is being made.
- getDescription() - Method in interface io.codemodder.CodemodReporterStrategy
- getDescription() - Method in enum class io.codemodder.DefaultRuleSetting
- getDescription() - Method in class io.codemodder.javaparser.JavaParserChanger
- getDescription() - Method in class io.codemodder.RawFileChanger
- getDriver() - Method in class io.codemodder.LazyLoadingRuleSarif
- getDriver() - Method in class io.codemodder.RuleSarif.EmptyRuleSarif
- getDriver() - Method in interface io.codemodder.RuleSarif
-
Returns the tool driver that produced this SARIF.
- getExpressions() - Method in class io.codemodder.ast.LocalScope
- getFixedFindings() - Method in class io.codemodder.CodemodChange
-
The fixed finding that was addressed by this change.
- getId() - Method in class io.codemodder.CodemodIdPair
- getIncludesExcludesForFile(File) - Method in class io.codemodder.IncludesExcludes.Default
- getIncludesExcludesForFile(File) - Method in interface io.codemodder.IncludesExcludes
-
Do we have any includes that match the file and line number?
- getIncludesExcludesForFile(File) - Method in class io.codemodder.IncludesExcludes.MatchesEverything
- getIndividualChangeDescription(Path, CodemodChange) - Method in interface io.codemodder.CodeChanger
-
A description of an individual change made by this codemod.
- getIndividualChangeDescription(Path, CodemodChange) - Method in class io.codemodder.javaparser.JavaParserChanger
- getIndividualChangeDescription(Path, CodemodChange) - Method in class io.codemodder.RawFileChanger
- getLabel() - Method in interface io.codemodder.Parameter
-
Get a description of the codemod parameter.
- getLastDataFlowRegion(Result) - Static method in class io.codemodder.Sarif
-
This method returns the last data flow location in the first code flow's first thread flow.
- getLeft() - Method in class io.codemodder.Either
-
Returns the left value, may be
null
- getLinearized() - Method in class io.codemodder.ast.LinearizedStringExpression
- getLineNumberAt(CharSequence, int) - Static method in class io.codemodder.LineNumbers
-
Get the line number you'd expect from an IDE at the given character offset.
- getModules(Path, List<Path>, List<String>, List<String>, List<Class<? extends CodeChanger>>, List<RuleSarif>, List<Path>, Path, Path) - Method in interface io.codemodder.CodemodProvider
-
Return a set of Guice modules that allow dependency injection
- getName() - Method in interface io.codemodder.ast.LocalDeclaration
-
Returns the name used in this declaration as a String.
- getName() - Method in class io.codemodder.ast.LocalVariableDeclaration
-
Returns the name of the local variable in this declaration as a
String
. - getName() - Method in class io.codemodder.ast.ParameterDeclaration
- getName() - Method in interface io.codemodder.Parameter
-
Get the name of the variable.
- getParameters() - Method in class io.codemodder.CodemodChange
-
A list of the codemod parameters that are involved in this change.
- getQuestion() - Method in interface io.codemodder.Parameter
-
Get the question to ask the user for the value.
- getReferences() - Method in interface io.codemodder.CodeChanger
-
A list of references for further reading on the issues this codemod addresses or other supplementary information.
- getReferences() - Method in interface io.codemodder.CodemodReporterStrategy
- getReferences() - Method in class io.codemodder.javaparser.JavaParserChanger
- getReferences() - Method in class io.codemodder.RawFileChanger
- getRegionsFromResultsByRule(Path) - Method in class io.codemodder.LazyLoadingRuleSarif
- getRegionsFromResultsByRule(Path) - Method in class io.codemodder.RuleSarif.EmptyRuleSarif
- getRegionsFromResultsByRule(Path) - Method in interface io.codemodder.RuleSarif
-
Get all the regions for the SARIF with the matching rule ID
- getReplacementFor(String) - Method in class io.codemodder.RegexFileChanger
-
Given a snippet that matches the regex, return the replacement string.
- getResolvedExpressionsMap() - Method in class io.codemodder.ast.LinearizedStringExpression
- getResultsByLocationPath(Path) - Method in class io.codemodder.LazyLoadingRuleSarif
- getResultsByLocationPath(Path) - Method in class io.codemodder.RuleSarif.EmptyRuleSarif
- getResultsByLocationPath(Path) - Method in interface io.codemodder.RuleSarif
-
Get all the SARIF results with the matching path for the first location field
- getRight() - Method in class io.codemodder.Either
-
Returns the right value, may be
null
- getRoot() - Method in class io.codemodder.ast.LinearizedStringExpression
- getRule() - Method in class io.codemodder.LazyLoadingRuleSarif
- getRule() - Method in class io.codemodder.RuleSarif.EmptyRuleSarif
- getRule() - Method in interface io.codemodder.RuleSarif
-
Returns the string ID for the rule.
- getScope() - Method in interface io.codemodder.ast.LocalDeclaration
-
The scope of this declaration.
- getScope() - Method in class io.codemodder.ast.LocalVariableDeclaration
-
Returns the
LocalScope
of the local variable in this declaration. - getScope() - Method in class io.codemodder.ast.ParameterDeclaration
- getStatement() - Method in class io.codemodder.ast.ExpressionStmtVariableDeclaration
-
Returns the
ExpressionStmt
Node
that holds this local declaration. - getStatement() - Method in class io.codemodder.ast.ForEachDeclaration
-
Returns the
ForEachStmt
Node
that holds the declaration. - getStatement() - Method in class io.codemodder.ast.ForInitDeclaration
-
Returns the
ForStmt
Node
that holds the declaration. - getStatement() - Method in class io.codemodder.ast.LocalVariableDeclaration
-
Returns the
Statement
Node
that holds this local declaration. - getStatement() - Method in class io.codemodder.ast.TryResourceDeclaration
-
Returns the
TryStmt
Node
that holds the resource declaration. - getStatements() - Method in class io.codemodder.ast.LocalScope
- getSummary() - Method in interface io.codemodder.CodeChanger
-
The headline for this codemod's changes.
- getSummary() - Method in interface io.codemodder.CodemodReporterStrategy
- getSummary() - Method in class io.codemodder.javaparser.JavaParserChanger
- getSummary() - Method in class io.codemodder.RawFileChanger
- getType() - Method in interface io.codemodder.Parameter
-
Get the type of parameter, should be "string", "number", or "boolean".
- getValue(Path, int) - Method in interface io.codemodder.Parameter
-
Get the value of a given codemod parameter for the given path and line.
- getVariableDeclarationExpr() - Method in class io.codemodder.ast.LocalVariableDeclaration
-
Returns the
VariableDeclarationExpr
Node
that holds this local declaration. - getVariableDeclarator() - Method in class io.codemodder.ast.LocalVariableDeclaration
-
Returns the
VariableDeclarator
Node
that holds this local declaration. - GPL_2_0 - Static variable in class io.codemodder.DependencyLicenses
- GPL_3_0 - Static variable in class io.codemodder.DependencyLicenses
- group() - Method in class io.codemodder.DependencyGAV.Default
- group() - Method in interface io.codemodder.DependencyGAV
-
The group of the dependency.
H
- handle(XMLEventReader, XMLEventWriter, XMLEvent) - Method in interface io.codemodder.XPathStreamEventHandler
-
Handle an
XMLEvent
that matched an XPath expression. - hashCode() - Method in class io.codemodder.CodemodChange
- hashCode() - Method in class io.codemodder.DependencyGAV.Default
- hashCode() - Method in record class io.codemodder.Position
-
Returns a hash code value for this object.
- hashCode() - Method in record class io.codemodder.SourceCodeRegion
-
Returns a hash code value for this object.
- hashCode() - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- hasNamedTarget(AssignExpr) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
AssignExpr
(assignExpr
) ->NameExpr
, where (expr
) is the left hand side of the assignment. - hasNext() - Method in class io.codemodder.ast.ASTs.ReverseEvaluationOrder
- hasNoTransitiveDependencies() - Method in class io.codemodder.DependencyGAV.Default
- hasNoTransitiveDependencies() - Method in interface io.codemodder.DependencyGAV
-
Whether this dependency has transitive dependencies.
- HIGH - Enum constant in enum class io.codemodder.CodemodExecutionPriority
- HIGH - Enum constant in enum class io.codemodder.Importance
I
- id() - Element in annotation interface io.codemodder.Codemod
-
The codemod ID, which must follow this nomenclature:
- ifLeftOrElse(Consumer<? super L>, Consumer<? super R>) - Method in class io.codemodder.Either
- ifLeftOrElseGet(Function<? super L, A>, Function<? super R, A>) - Method in class io.codemodder.Either
- importance() - Element in annotation interface io.codemodder.Codemod
-
How important this codemod's changes are.
- Importance - Enum Class in io.codemodder
-
Represents the importance of a codemod.
- IncludesExcludes - Interface in io.codemodder
-
This is the main interaction point with types for detecting if a path should be included.
- IncludesExcludes.Default - Class in io.codemodder
- IncludesExcludes.MatchesEverything - Class in io.codemodder
- injectedPackages() - Method in interface io.codemodder.DependencyUpdateResult
-
The list of dependencies that were successfully injected into the project.
- inScope(Node) - Method in class io.codemodder.ast.LocalScope
-
Returns true if and only if
n
is contained inscope
- io.codemodder - package io.codemodder
- io.codemodder.ast - package io.codemodder.ast
- io.codemodder.javaparser - package io.codemodder.javaparser
- isAllowed(String) - Method in class io.codemodder.CodemodRegulator.DefaultCodemodRegulator
- isAllowed(String) - Method in interface io.codemodder.CodemodRegulator
-
Taking into account the configuration, understand if this codemod is currently allowed.
- isArgumentOfMethodCall(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
MethodCallExpr
->Expression
(expr
), whereexpr
is an argument. - isArgumentOfObjectCreationExpression(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ObjectCreationExpr
->Expression
(expr
), whereexpr
is an argument. - isAssigned(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
AssignExpr
->Expression
(expr
), where (expr
) is the right hand side expression of the assignment. - isClassFieldDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ClassOrInterfaceDeclaration
(node
) ->FieldDeclaration
->VariableDeclarator
->SimpleName
- isClassTypeParameterOf(ClassOrInterfaceDeclaration, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ClassOrInterfaceDeclaration
(classDecl
) ->TypeParameter
->SimpleName
, withname
as theSimpleName
. - isConstructorArgument(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ObjectCreationExpr
->Expression
(expr
), where (expr
) is one of the constructor arguments. - isConstructorFormalParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ConstructorDeclaration
(node
) ->Parameter
->SimpleName
- isConstructorTypeParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ConstructorDeclaration
(node
) ->TypeParameter
->SimpleName
- isEnumConstantOf(EnumDeclaration, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
EnumDeclaration
(enumDecl
) ->EnumConstantDeclaration
->SimpleName
, withname
as theSimpleName
. - isExceptionParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
CatchClause
(node
) ->Parameter
->SimpleName
- isExpressionStmtDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ExpressionStmt
(node
) ->VariableDeclarationExpr
->VariableDeclarator
->SimpleName
(name
) - isFieldDeclarationOf(BodyDeclaration<?>, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
FieldDeclaration
(bDecl
) ->VariableDeclarator
->SimpleName
, withname
as theSimpleName
. - isFinalOrNeverAssigned(VariableDeclarator, LocalScope) - Static method in class io.codemodder.ast.ASTs
-
Given a
SimpleName
name
and aVariableDeclarationExpr
with a declarator ofname
, verifies ifname
is final or never assigned. - isFinalOrNeverAssigned(LocalVariableDeclaration) - Static method in class io.codemodder.ast.ASTs
-
Given a
LocalVariableDeclaration
verifies if it is final or never assigned. - isForEachVariable(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ForEachStmt
->VariableDeclarationExpr
->VariableDeclarator
(vd
) - isForEachVariableDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ForEachStmt
(node
) ->VariableDeclarationExpr
->VariableDeclarator
->SimpleName
(name
) - isForInitVariable(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ForStmt
->VariableDeclarationExpr
->VariableDeclarator
(vd
) - isForVariableDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ForStmt
(node
) ->VariableDeclarationExpr
->VariableDeclarator
->SimpleName
- isInBlock(Statement) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
Statement
->Node.getParentNode()
() - isInitExpr(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
VariableDeclarator
->Expression
(expr
) - isLambdaExprParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
LambdaExpr
(node
) ->Parameter
->SimpleName
- isLeft() - Method in class io.codemodder.Either
-
Returns
true
if the left value is present. - isLocalRecordDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
LocalRecordDeclarationStmt
(node
) ->RecordDeclaration
->SimpleName
- isLocalTypeDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
LocalClassDeclarationStmt
(node
) ->ClassOrInterfaceDeclaration
->SimpleName
- isLocalVariableDeclarator(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Checks if
vd
is a local declaration. - isMethodFormalParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
MethodDeclaration
(node
) ->Parameter
->SimpleName
- isMethodTypeParameterOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
MethodDeclaration
(node
) ->TypeParameter
->SimpleName
- isNamedMemberOf(BodyDeclaration<?>, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
NodeWithSimpleName
(bDecl
) ->SimpleName
, withname
as theSimpleName
. - isNotInitializedAndAssignedAtMostOnce(LocalVariableDeclaration) - Static method in class io.codemodder.ast.ASTs
-
Checks if a local variable is not initialized and is assigned at most once.
- isOpenSource(String) - Static method in class io.codemodder.DependencyLicenses
- isPatternExprDeclarationOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
PatternExpr
(node
) ->SimpleName
- isReference(NameExpr) - Method in interface io.codemodder.ast.LocalDeclaration
-
Verifies if a given
NameExpr
is a reference to this variable/parameter. - isResource(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
TryStmt
->VariableDeclarationExpr
->VariableDeclarator
(vd
) - isResource(VariableDeclarationExpr) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
TryStmt
->VariableDeclarationExpr
(vde
) - isResourceOf(Node, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
TryStmt
(node
) ->VariableDeclarationExpr
->VariableDeclarator
->SimpleName
(name
) - isReturnExpr(Expression) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ReturnStmt
->VariableDeclarator
->Expression
(expr
) - isRight() - Method in class io.codemodder.Either
-
Returns
true
if the right value is present. - isScopeInMethodCall(Expression) - Static method in class io.codemodder.ast.ASTs
-
Given an
Expression
expr
, check ifexpr
is the scope of aMethodCallExpr
. - isVariableDeclarationExprOf(Expression, String) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
VariableDeclarationExpr
(node
) ->VariableDeclarator
->SimpleName
(name
). - isVariableOfField(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
FieldDeclaration
->VariableDeclarator
(vd
. - isVariableOfLocalDeclarationStmt(VariableDeclarator) - Static method in class io.codemodder.ast.ASTs
-
Test for this pattern:
ExpressionStmt
->VariableDeclarationExpr
->VariableDeclarator
(vd
).
J
- JAVA_SECURITY_TOOLKIT - Static variable in interface io.codemodder.DependencyGAV
-
The pixee Java Security Toolkit is required by many weaves/visitors, so we'll expose it here.
- JAVA_SECURITY_TOOLKIT_GAV - Static variable in interface io.codemodder.DependencyGAV
- JAVA_SECURITY_TOOLKIT_VERSION - Static variable in interface io.codemodder.DependencyGAV
- JavaParserChanger - Class in io.codemodder.javaparser
-
Uses JavaParser to change Java source files.
- JavaParserChanger() - Constructor for class io.codemodder.javaparser.JavaParserChanger
- JavaParserChanger(CodemodReporterStrategy) - Constructor for class io.codemodder.javaparser.JavaParserChanger
- JavaParserCodemodRunner - Class in io.codemodder.javaparser
- JavaParserCodemodRunner(JavaParserFacade, JavaParserChanger, EncodingDetector) - Constructor for class io.codemodder.javaparser.JavaParserCodemodRunner
- JavaParserFacade - Interface in io.codemodder.javaparser
-
Responsible for parsing Java files and maintaining the compilation units across different accesses.
- JavaParserFactory - Interface in io.codemodder.javaparser
-
Responsible for generating
JavaParser
instances. - JavaParserTransformer - Class in io.codemodder.javaparser
-
A utility for making it easy to transform JavaParser ASTs.
- JavaParserTransformer.ExpressionWrapper - Interface in io.codemodder.javaparser
- justification() - Method in class io.codemodder.DependencyGAV.Default
- justification() - Method in interface io.codemodder.DependencyGAV
-
The justification for adding this dependency.
L
- label() - Element in annotation interface io.codemodder.CodemodParameter
-
A description of the parameter.
- LazyLoadingRuleSarif - Class in io.codemodder
- LazyLoadingRuleSarif(Provider<RuleSarif>) - Constructor for class io.codemodder.LazyLoadingRuleSarif
- left(A) - Static method in class io.codemodder.Either
-
Returns an
Either
containingvalue
as a left value. - LGPL_2_1 - Static variable in class io.codemodder.DependencyLicenses
- LGPL_3_0 - Static variable in class io.codemodder.DependencyLicenses
- license() - Method in class io.codemodder.DependencyGAV.Default
- license() - Method in interface io.codemodder.DependencyGAV
-
The license for this dependency.
- line() - Method in class io.codemodder.PathMatcher
- line() - Method in record class io.codemodder.Position
-
Returns the value of the
line
record component. - Line - Interface in io.codemodder
-
Represents a line of code.
- LinearizedStringExpression - Class in io.codemodder.ast
-
Linearizes a string expression
- LinearizedStringExpression(Expression) - Constructor for class io.codemodder.ast.LinearizedStringExpression
- lineIncludesExcludes() - Method in interface io.codemodder.CodemodInvocationContext
-
The includes/excludes for the file being changed.
- LineIncludesExcludes - Interface in io.codemodder
-
For a given file, this type provides an API for callers to understand if certain line numbers are allowed.
- LineIncludesExcludes.ExcludeBasedLineIncludesExcludes - Class in io.codemodder
-
Given a set of lines to exclude, determine if we should allow changes to this line.
- LineIncludesExcludes.IncludeBasedLineIncludesExcludes - Class in io.codemodder
-
Given a set of lines to include, determine if we should allow changes to this line.
- LineIncludesExcludes.MatchesEverything - Class in io.codemodder
- lineNumber() - Method in class io.codemodder.CodemodChange
-
The line number associated with the change.
- LineNumbers - Class in io.codemodder
-
Utilities related to line numbers.
- lines() - Method in interface io.codemodder.CodemodInvocationContext
-
Convenience method for stream-wise processing lines of the file being changed with line numbers.
- linesAffected() - Method in class io.codemodder.XPathStreamProcessChange.Default
- linesAffected() - Method in interface io.codemodder.XPathStreamProcessChange
-
The lines that were affected by the change.
- listJavaSourceDirectories(List<File>) - Method in class io.codemodder.SourceDirectoryLister.DefaultSourceDirectoryLister
-
This method turns the list of source code roots into resolved Java source code directories, with all the Java source files.
- listJavaSourceDirectories(List<File>) - Method in interface io.codemodder.SourceDirectoryLister
-
Return a sorted list of Java source directories.
- LocalDeclaration - Interface in io.codemodder.ast
-
A local declaration.
- LocalScope - Class in io.codemodder.ast
-
Contains the expressions and statements that span the scope of a local declaration.
- LocalVariableDeclaration - Class in io.codemodder.ast
-
Holds the nodes in the AST that represents several types of local declaration of a variable.
- LocalVariableDeclaration() - Constructor for class io.codemodder.ast.LocalVariableDeclaration
- LocalVariableDeclaratorExpectation(Optional<VariableDeclarator>) - Constructor for class io.codemodder.javaparser.ASTExpectations.LocalVariableDeclaratorExpectation
- LoggingConfigurator - Class in io.codemodder
-
A configurator for the log levels that defaults to "quiet" mode.
- LoggingConfigurator() - Constructor for class io.codemodder.LoggingConfigurator
- LOW - Enum constant in enum class io.codemodder.CodemodExecutionPriority
- LOW - Enum constant in enum class io.codemodder.Importance
M
- manifestChanges() - Method in interface io.codemodder.CodemodPackageUpdateResult
- map(Function<L, A>) - Method in class io.codemodder.Either
-
Applies
func
to the left value if present. - mapRight(Function<R, A>) - Method in class io.codemodder.Either
-
Applies
func
to the left value if present. - matches(int) - Method in class io.codemodder.LineIncludesExcludes.ExcludeBasedLineIncludesExcludes
- matches(int) - Method in class io.codemodder.LineIncludesExcludes.IncludeBasedLineIncludesExcludes
- matches(int) - Method in interface io.codemodder.LineIncludesExcludes
-
Return true if the include/exclude rules allow changes to this line.
- matches(int) - Method in class io.codemodder.LineIncludesExcludes.MatchesEverything
- matches(SourceCodeRegion, Range) - Method in interface io.codemodder.RegionNodeMatcher
-
Return true if the given
Region
matches the givenRange
. - matches(File) - Method in class io.codemodder.PathMatcher
-
Return if this path matcher matches the given file.
- MATCHES_LINE - Static variable in interface io.codemodder.RegionNodeMatcher
- MATCHES_START - Static variable in interface io.codemodder.RegionNodeMatcher
-
Return true if the
Node
isRegion
start at the same location. - MatchesEverything() - Constructor for class io.codemodder.IncludesExcludes.MatchesEverything
- MatchesEverything() - Constructor for class io.codemodder.LineIncludesExcludes.MatchesEverything
- MEDIUM - Enum constant in enum class io.codemodder.Importance
- MERGE_AFTER_CURSORY_REVIEW - Enum constant in enum class io.codemodder.ReviewGuidance
- MERGE_AFTER_REVIEW - Enum constant in enum class io.codemodder.ReviewGuidance
- MERGE_WITHOUT_REVIEW - Enum constant in enum class io.codemodder.ReviewGuidance
- mergeConcatenatedLiterals(Expression) - Static method in class io.codemodder.ast.ASTTransforms
-
Given a string expression, merge any literals that are directly concatenated.
- mergeStackedTryStmts(TryStmt) - Static method in class io.codemodder.ast.ASTTransforms
-
Tries to merge the given try stmt with an enveloping one.
- MethodCallExpectation(Optional<MethodCallExpr>) - Constructor for class io.codemodder.javaparser.ASTExpectations.MethodCallExpectation
- MIT - Static variable in class io.codemodder.DependencyLicenses
- MPL_2_0 - Static variable in class io.codemodder.DependencyLicenses
N
- name() - Element in annotation interface io.codemodder.CodemodParameter
-
The name of the parameter.
- newArray(String, Expression...) - Static method in class io.codemodder.javaparser.JavaParserTransformer
-
Creates a new array creation expression.
- newFactory() - Static method in interface io.codemodder.javaparser.JavaParserFactory
- next() - Method in class io.codemodder.ast.ASTs.ReverseEvaluationOrder
- noChanges - Static variable in interface io.codemodder.javaparser.ChangesResult
- NodeCollector - Interface in io.codemodder
-
A type that can collect specific types of nodes from a
CompilationUnit
. - NodeExpectation(Node) - Constructor for class io.codemodder.javaparser.ASTExpectations.NodeExpectation
- none() - Static method in interface io.codemodder.CodemodFileScanningResult
-
Creates an empty instance of
CodemodFileScanningResult
. - NORMAL - Enum constant in enum class io.codemodder.CodemodExecutionPriority
- number() - Method in interface io.codemodder.Line
- NUMBER - Enum constant in enum class io.codemodder.CodemodParameter.ParameterType
O
- of(DefaultRuleSetting, List<String>) - Static method in interface io.codemodder.CodemodRegulator
- onChangeCreated(Path, String, CodeTFChange) - Method in interface io.codemodder.CodeTFProvider
-
Called when a change is created.
- onFileFound(CodemodInvocationContext, List<Result>) - Method in class io.codemodder.SarifPluginRawFileChanger
-
Creates a visitor for the given context and results.
- onRegionMatchingXMLEvent(XMLEventReader, XMLEventWriter, XMLEvent) - Method in interface io.codemodder.XMLEventHandler
-
Perform some action when an
XMLEvent
is determined to match a SARIF region. - onResultCreated(CodeTFResult) - Method in interface io.codemodder.CodeTFProvider
-
Called when a result is created.
- onResultFound(CodemodInvocationContext, CompilationUnit, T, Result) - Method in class io.codemodder.SarifPluginJavaParserChanger
-
Creates a visitor for the given context and locations.
- OUR_ROOT_LOGGER_NAME - Static variable in class io.codemodder.LoggingConfigurator
- overrideEntry(Path, String) - Method in interface io.codemodder.FileCache
-
Put the string contents of a file into the cache.
- OWASP_XSS_JAVA_ENCODER - Static variable in interface io.codemodder.DependencyGAV
-
There are multiple XSS rules require an XSS encoder.
P
- packageActions() - Method in interface io.codemodder.CodemodPackageUpdateResult
- packageChanges() - Method in interface io.codemodder.DependencyUpdateResult
-
An updated model of the changed files in the project, after the dependency update operation.
- Parameter - Interface in io.codemodder
-
A parameter for a codemod, capable of retrieving the right value for a given path and line.
- ParameterDeclaration - Class in io.codemodder.ast
-
Represents the declaration of a parameter in a method, constructor, lambda expression, and catch clause.
- ParameterDeclaration(Parameter) - Constructor for class io.codemodder.ast.ParameterDeclaration
- parseIntoMap(List<Path>, CodeDirectory) - Method in interface io.codemodder.SarifParser
- parseJavaFile(Path) - Method in interface io.codemodder.javaparser.JavaParserFacade
-
Return the
CompilationUnit
for the given Java file. - parsePattern(File, String) - Static method in interface io.codemodder.IncludesExcludes
- path() - Method in interface io.codemodder.CodemodInvocationContext
-
The individual file being changed.
- path() - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- path() - Method in interface io.codemodder.SourceDirectory
-
The filesystem path of the directory.
- PathMatcher - Class in io.codemodder
-
This type is used in include/exclude logic for matching paths.
- PathMatcher(FileSystem, File, String, Integer) - Constructor for class io.codemodder.PathMatcher
- Position - Record Class in io.codemodder
-
Represents a position in a source file.
- Position(Integer, Integer) - Constructor for record class io.codemodder.Position
-
Creates an instance of a
Position
record class. - process(Path, String, XPathStreamEventHandler) - Method in interface io.codemodder.XPathStreamProcessor
-
Scan the given XML file for nodes that match the given XPath expression and hand them off to the given handler.
- ProjectProvider - Interface in io.codemodder
-
A type that plugins can implement to provide a project management functions to codemods.
Q
- question() - Element in annotation interface io.codemodder.CodemodParameter
-
The question to ask the user when they are prompted for this parameter.
R
- rawDocument() - Method in class io.codemodder.LazyLoadingRuleSarif
- rawDocument() - Method in class io.codemodder.RuleSarif.EmptyRuleSarif
- rawDocument() - Method in interface io.codemodder.RuleSarif
-
Return the entire SARIF as a model in case more comprehensive inspection is needed.
- RawFileChanger - Class in io.codemodder
-
Gives access to raw files for performing arbitrary changes.
- RawFileChanger() - Constructor for class io.codemodder.RawFileChanger
- RawFileChanger(CodemodReporterStrategy) - Constructor for class io.codemodder.RawFileChanger
- RegexFileChanger - Class in io.codemodder
-
This type does the heavy lifting for many protections that can work in a simple "search-and-replace" pattern for non-Java code.
- RegexFileChanger(Predicate<Path>, Pattern, boolean, List<DependencyGAV>) - Constructor for class io.codemodder.RegexFileChanger
- RegexFileChanger(Predicate<Path>, Pattern, boolean, List<DependencyGAV>, CodemodReporterStrategy) - Constructor for class io.codemodder.RegexFileChanger
- RegionNodeMatcher - Interface in io.codemodder
-
A type that can match a
Region
to aRange
for determining if we should change the node at this location. - removeEmptyStringConcatenation(BinaryExpr) - Static method in class io.codemodder.ast.ASTTransforms
-
Removes concatenation with empty strings.
- removeEmptyStringConcatenation(Node) - Static method in class io.codemodder.ast.ASTTransforms
-
Removes all concatenations with empty strings in the given subtree.
- removeEntry(Path) - Method in interface io.codemodder.FileCache
-
Remove the string contents of a file from the cache if it exists.
- removeImportIfUnused(CompilationUnit, String) - Static method in class io.codemodder.ast.ASTTransforms
-
Remove an import if we can't find references to it in the code.
- removeUnusedLocalVariables(Node) - Static method in class io.codemodder.ast.ASTTransforms
-
Removes unused variables.
- replace(Expression) - Static method in class io.codemodder.javaparser.JavaParserTransformer
-
Useful for replacing an expression (method call or object creation) with a surrounding method call.
- reporter - Variable in class io.codemodder.javaparser.JavaParserChanger
- reporter - Variable in class io.codemodder.RawFileChanger
- repositoryUrl() - Method in class io.codemodder.DependencyGAV.Default
- repositoryUrl() - Method in interface io.codemodder.DependencyGAV
-
The repository URL for this dependency's source control.
- resolveLocalExpression(Expression) - Static method in class io.codemodder.ast.ASTs
-
Tries to find the source of an expression if it can be uniquely defined, otherwise, returns self.
- result() - Method in class io.codemodder.javaparser.ASTExpectations.ExpressionStatementExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.FieldAccessExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.LocalVariableDeclaratorExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.MethodCallExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.NameExpressionExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.StringLiteralExpectation
- result() - Method in class io.codemodder.javaparser.ASTExpectations.VariableDeclarationExprExpectation
- reversePreOrderIterator(Node) - Static method in class io.codemodder.ast.ASTs
-
Returns an iterator for all the nodes in the AST that precedes
n
in the pre-order ordering. - reviewGuidance() - Element in annotation interface io.codemodder.Codemod
-
The review guidance for the changes introduced by this codemod
- ReviewGuidance - Enum Class in io.codemodder
-
Represents a codemod author's confidence that changes wll be safe and effective.
- right(B) - Static method in class io.codemodder.Either
-
Returns an
Either
containingvalue
as a right value. - RuleSarif - Interface in io.codemodder
-
Defines a model for interacting with SARIF.
- RuleSarif.EmptyRuleSarif - Class in io.codemodder
-
An empty implementation of
RuleSarif
for binding codemods with no SARIF results. - RuleSarifFactory - Interface in io.codemodder
-
Builds
RuleSarif
s. - run(CodemodInvocationContext) - Method in interface io.codemodder.CodemodRunner
-
Run the codemod on a single file.
- run(CodemodInvocationContext) - Method in class io.codemodder.javaparser.JavaParserCodemodRunner
- run(List<Class<? extends CodeChanger>>, String[]) - Static method in class io.codemodder.Runner
-
Runs the given codemods with CLI arguments you get from a main() method.
- run(List<Class<? extends CodeChanger>>, String[], PrintWriter, PrintWriter) - Static method in class io.codemodder.Runner
-
Runs the codemods with a set of customized streams.
- Runner - Class in io.codemodder
-
Provides an entrypoint for CLIs built with the codemodder framework.
- Runner() - Constructor for class io.codemodder.Runner
S
- sarif - Variable in class io.codemodder.SarifPluginJavaParserChanger
- Sarif - Class in io.codemodder
-
Utility class for working with SARIF model objects.
- SarifFindingKeyUtil - Class in io.codemodder
-
Utility class for building keys for SARIF findings.
- SarifParser - Interface in io.codemodder
- SarifPluginJavaParserChanger<T extends com.github.javaparser.ast.Node> - Class in io.codemodder
-
Provides base functionality for making JavaParser-based changes based on results found by a sarif file.
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, CodemodReporterStrategy) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, RegionNodeMatcher) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, RegionNodeMatcher, CodemodReporterStrategy) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, SourceCodeRegionExtractor<Result>) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, SourceCodeRegionExtractor<Result>, RegionNodeMatcher) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginJavaParserChanger(RuleSarif, Class<? extends Node>, SourceCodeRegionExtractor<Result>, RegionNodeMatcher, CodemodReporterStrategy) - Constructor for class io.codemodder.SarifPluginJavaParserChanger
- SarifPluginRawFileChanger - Class in io.codemodder
-
A
RawFileChanger
bundled with aRuleSarif
. - SarifPluginRawFileChanger(RuleSarif) - Constructor for class io.codemodder.SarifPluginRawFileChanger
- SarifPluginRawFileChanger(RuleSarif, CodemodReporterStrategy) - Constructor for class io.codemodder.SarifPluginRawFileChanger
- scope - Variable in class io.codemodder.ast.LocalVariableDeclaration
- shouldInspect(File) - Method in class io.codemodder.IncludesExcludes.Default
- shouldInspect(File) - Method in class io.codemodder.IncludesExcludes.MatchesEverything
- shouldInspect(File) - Method in interface io.codemodder.IncludesExcludes
-
Do we have any includes that include this file?
- shouldRun() - Method in interface io.codemodder.CodeChanger
-
A lifecycle event that is called before any files are processed.
- shouldRun() - Method in class io.codemodder.CompositeJavaParserChanger
- shouldRun() - Method in class io.codemodder.SarifPluginJavaParserChanger
- skippedPackages() - Method in interface io.codemodder.DependencyUpdateResult
-
The list of dependencies that were already available to the given file.
- SourceCodeRegion - Record Class in io.codemodder
-
Describes a region of source code.
- SourceCodeRegion(Position, Position) - Constructor for record class io.codemodder.SourceCodeRegion
-
Creates an instance of a
SourceCodeRegion
record class. - SourceCodeRegionExtractor<T> - Interface in io.codemodder
-
A type responsible for extracting a region from a result
- SourceDirectory - Interface in io.codemodder
-
Represent a normally-structured Java source code directory and all its files underneath it.
- SourceDirectory.DefaultSourceDirectory - Class in io.codemodder
- SourceDirectoryLister - Interface in io.codemodder
-
Represents a worker class that reads a list of repository roots and captures the Java source directories.
- SourceDirectoryLister.DefaultSourceDirectoryLister - Class in io.codemodder
- splitResources(TryStmt, int) - Static method in class io.codemodder.ast.ASTTransforms
-
Given a
TryStmt
split its resources into two nestedTryStmt
s. - start() - Method in record class io.codemodder.SourceCodeRegion
-
Returns the value of the
start
record component. - stream() - Method in class io.codemodder.ast.LocalScope
- STRING - Enum constant in enum class io.codemodder.CodemodParameter.ParameterType
- StringLiteralExpectation(Optional<StringLiteralExpr>) - Constructor for class io.codemodder.javaparser.ASTExpectations.StringLiteralExpectation
- supports(Path) - Method in interface io.codemodder.CodemodRunner
-
The
Predicate
that determines if this runner supports the given file. - supports(Path) - Method in class io.codemodder.javaparser.JavaParserCodemodRunner
T
- targetsLine() - Method in class io.codemodder.PathMatcher
- toBeExpressionStatement() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the node is a
ExpressionStmt
. - toBeFieldAccessExpression() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the node is a
FieldAccessExpr
. - toBeInitializedByMethodCall() - Method in class io.codemodder.javaparser.ASTExpectations.LocalVariableDeclaratorExpectation
-
Return an expectation that asserts that the initializer is a
MethodCallExpr
. - toBeMethodCallExpression() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the node is a
MethodCallExpr
. - toBeNameExpression() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the node is a
NameExpr
. - toBeSingleLocalVariableDefinition() - Method in class io.codemodder.javaparser.ASTExpectations.VariableDeclarationExprExpectation
-
Return an expectation that asserts the local variable declaration has only a single variable.
- toBeStringLiteral() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
- toBeVariableDeclarationStatement() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the node is an
ExpressionStmt
with aVariableDeclarationExpr
for its expression. - toString() - Method in class io.codemodder.ast.LocalVariableDeclaration
- toString() - Method in class io.codemodder.ast.ParameterDeclaration
- toString() - Method in class io.codemodder.CodemodChange
- toString() - Method in class io.codemodder.DependencyGAV.Default
- toString() - Method in class io.codemodder.Either
- toString() - Method in class io.codemodder.IncludesExcludes.Default
- toString() - Method in class io.codemodder.PathMatcher
- toString() - Method in record class io.codemodder.Position
-
Returns a string representation of this record class.
- toString() - Method in record class io.codemodder.SourceCodeRegion
-
Returns a string representation of this record class.
- toString() - Method in class io.codemodder.SourceDirectory.DefaultSourceDirectory
- transformedXml() - Method in class io.codemodder.XPathStreamProcessChange.Default
- transformedXml() - Method in interface io.codemodder.XPathStreamProcessChange
-
A temporary file containing the transformed XML.
- TryResourceDeclaration - Class in io.codemodder.ast
-
Holds the nodes in the AST that represents a variable declaration as a try resource.
- TryResourceDeclaration(TryStmt, VariableDeclarationExpr, VariableDeclarator) - Constructor for class io.codemodder.ast.TryResourceDeclaration
- type() - Element in annotation interface io.codemodder.CodemodParameter
-
The type of the parameter.
U
- unfixedFindings() - Method in interface io.codemodder.CodemodFileScanningResult
-
Returns the results of the findings that were hoping to be addressed.
- UNLICENSE - Static variable in class io.codemodder.DependencyLicenses
- updateDependencies(Path, Path, List<DependencyGAV>) - Method in interface io.codemodder.ProjectProvider
-
Given the file edited during codemod execution, attempt to update the dependencies in the project to allow referencing new types.
V
- validationPattern() - Element in annotation interface io.codemodder.CodemodParameter
-
A regex pattern that describes the valid values for this parameter.
- valueOf(String) - Static method in enum class io.codemodder.CodemodExecutionPriority
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.codemodder.CodemodParameter.ParameterType
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.codemodder.DefaultRuleSetting
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.codemodder.Importance
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class io.codemodder.ReviewGuidance
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class io.codemodder.CodemodExecutionPriority
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.codemodder.CodemodParameter.ParameterType
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.codemodder.DefaultRuleSetting
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.codemodder.Importance
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class io.codemodder.ReviewGuidance
-
Returns an array containing the constants of this enum class, in the order they are declared.
- vd - Variable in class io.codemodder.ast.LocalVariableDeclaration
- vde - Variable in class io.codemodder.ast.LocalVariableDeclaration
- vendorName() - Method in interface io.codemodder.FixOnlyCodeChanger
-
Detection tool name.
- version() - Method in class io.codemodder.DependencyGAV.Default
- version() - Method in interface io.codemodder.DependencyGAV
-
The version of the dependency.
- visit(CodemodInvocationContext, CompilationUnit) - Method in class io.codemodder.CompositeJavaParserChanger
- visit(CodemodInvocationContext, CompilationUnit) - Method in class io.codemodder.javaparser.JavaParserChanger
-
Called when a Java file, which has already been parsed into a compilation unit, is seen.
- visit(CodemodInvocationContext, CompilationUnit) - Method in class io.codemodder.SarifPluginJavaParserChanger
- visitFile(CodemodInvocationContext) - Method in class io.codemodder.RawFileChanger
-
Visit a file.
- visitFile(CodemodInvocationContext) - Method in class io.codemodder.RegexFileChanger
- visitFile(CodemodInvocationContext) - Method in class io.codemodder.SarifPluginRawFileChanger
W
- wantsSarifToolNames() - Method in interface io.codemodder.CodemodProvider
-
Tools this provider is interested in processing the SARIF output of.
- withArguments() - Method in class io.codemodder.javaparser.ASTExpectations.MethodCallExpectation
- withArgumentsSize(int) - Method in class io.codemodder.javaparser.ASTExpectations.MethodCallExpectation
- withBlockParent() - Method in class io.codemodder.javaparser.ASTExpectations.NodeExpectation
-
Return an expectation that asserts the parent node is a
BlockStmt
. - withDirectReferenceCount(int) - Method in class io.codemodder.javaparser.ASTExpectations.LocalVariableDeclaratorExpectation
-
Return an expectation that asserts the variable declaration has only a single variable.
- withExpression(Expression) - Method in interface io.codemodder.javaparser.CallReplacer
-
Performs the actual transformation of replacing the given expression another arbitrary expression.
- withMethodCallExpression() - Method in class io.codemodder.javaparser.ASTExpectations.ExpressionStatementExpectation
- withName(String) - Method in class io.codemodder.javaparser.ASTExpectations.MethodCallExpectation
- withNewArguments(NodeList<Expression>) - Method in interface io.codemodder.javaparser.CallReplacer.CallReplacerBuilder
-
Replace with a static method call with new arguments.
- withOnlyChanges(List<CodemodChange>) - Static method in interface io.codemodder.CodemodFileScanningResult
-
Creates an instance of
CodemodFileScanningResult
with only changes. - withSameArguments() - Method in interface io.codemodder.javaparser.CallReplacer.CallReplacerBuilder
-
Replace with a static method call with the same arguments.
- withSettings(File, List<String>, List<String>) - Static method in interface io.codemodder.IncludesExcludes
-
Create an
IncludesExcludes
. - withSingleVariableDeclarationExpression() - Method in class io.codemodder.javaparser.ASTExpectations.ExpressionStatementExpectation
- withStaticImport() - Method in interface io.codemodder.javaparser.CallReplacer.CallReplacerBuilder
-
Use a static import.
- withStaticMethod(String, String) - Method in interface io.codemodder.javaparser.CallReplacer
-
Performs the actual transformation of replacing the given expression a static method call.
- withStaticMethod(String, String, boolean) - Method in interface io.codemodder.javaparser.JavaParserTransformer.ExpressionWrapper
-
Performs the actual transformation of wrapping the given expression with the given static method.
- wrap(Expression) - Static method in class io.codemodder.javaparser.JavaParserTransformer
-
Useful for wrapping an expression with a surrounding method call.
- wrapIntoResource(ExpressionStmt, VariableDeclarationExpr, LocalScope) - Static method in class io.codemodder.ast.ASTTransforms
-
Given a local variable declaration
stmt
, wherevdecl
is a single initialized declaration of a variablev
with scopescope
,v
is never assigned in its scope, then wrap the declaration into as a resource of a try stmt.
X
- XMLEventHandler - Interface in io.codemodder
-
Type that gets used to modify an XML stream.
- XPathStreamEventHandler - Interface in io.codemodder
-
A handler for
XMLEvent
s that match an XPath expression. - XPathStreamProcessChange - Interface in io.codemodder
-
Represents the results when an XML file is transformed using
XPathStreamProcessor
. - XPathStreamProcessChange.Default - Class in io.codemodder
- XPathStreamProcessor - Interface in io.codemodder
-
Performs configurable actions on nodes that match XPath expressions.
All Classes and Interfaces|All Packages|Constant Field Values