Package io.codemodder.codemods.sonar
Class RemoveRedundantVariableCreationCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr,io.codemodder.sonar.model.Issue>
io.codemodder.codemods.sonar.RemoveRedundantVariableCreationCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger,io.codemodder.FixOnlyCodeChanger
@Codemod(id="sonar:java/remove-redundant-variable-creation-s1488",
reviewGuidance=MERGE_WITHOUT_REVIEW,
importance=LOW,
executionPriority=HIGH)
public final class RemoveRedundantVariableCreationCodemod
extends io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr,io.codemodder.sonar.model.Issue>
A codemod to remove redundant variable creation
-
Field Summary
Fields inherited from class io.codemodder.providers.sonar.SonarPluginJavaParserChanger
ruleFindingFields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter -
Constructor Summary
ConstructorsConstructorDescriptionRemoveRedundantVariableCreationCodemod(io.codemodder.providers.sonar.RuleIssue issues) -
Method Summary
Modifier and TypeMethodDescriptionio.codemodder.codetf.DetectorRuleio.codemodder.javaparser.ChangesResultonFindingFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr, io.codemodder.sonar.model.Issue issue) Methods inherited from class io.codemodder.providers.sonar.SonarPluginJavaParserChanger
supports, vendorName, visitMethods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIncludesExcludesPattern, getIndividualChangeDescription, getReferences, getSummaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.codemodder.CodeChanger
shouldRun
-
Constructor Details
-
RemoveRedundantVariableCreationCodemod
@Inject public RemoveRedundantVariableCreationCodemod(@ProvidedSonarScan(ruleId="java:S1488") io.codemodder.providers.sonar.RuleIssue issues)
-
-
Method Details
-
onFindingFound
public io.codemodder.javaparser.ChangesResult onFindingFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.ObjectCreationExpr objectCreationExpr, io.codemodder.sonar.model.Issue issue) - Specified by:
onFindingFoundin classio.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.ObjectCreationExpr,io.codemodder.sonar.model.Issue>
-
detectorRule
public io.codemodder.codetf.DetectorRule detectorRule()
-