Package io.codemodder.codemods
Class AddClarifyingBracesCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.Node>
io.codemodder.codemods.AddClarifyingBracesCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger
@Codemod(id="pixee:java/add-clarifying-braces",
reviewGuidance=MERGE_WITHOUT_REVIEW,
importance=HIGH)
public final class AddClarifyingBracesCodemod
extends io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.Node>
Adds braces in situations where the lack of braces in combination with whitespace makes it seem
like statements are in a different code flow.
-
Field Summary
Fields inherited from class io.codemodder.SarifPluginJavaParserChanger
sarif
Fields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.codemodder.javaparser.ChangesResult
onResultFound
(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.Node node, com.contrastsecurity.sarif.Result result) Methods inherited from class io.codemodder.SarifPluginJavaParserChanger
shouldRun, supports, visit
Methods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIncludesExcludesPattern, getIndividualChangeDescription, getReferences, getSummary
-
Constructor Details
-
AddClarifyingBracesCodemod
@Inject public AddClarifyingBracesCodemod(@PmdScan(ruleId="category/java/codestyle.xml/ControlStatementBraces") io.codemodder.RuleSarif sarif)
-
-
Method Details
-
onResultFound
public io.codemodder.javaparser.ChangesResult onResultFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.Node node, com.contrastsecurity.sarif.Result result) - Specified by:
onResultFound
in classio.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.Node>
-