-
Notifications
You must be signed in to change notification settings - Fork 774
Open
Description
kindly consider new rule or optional enhancement of DirectReturn to prefer inlined direct turn instead of ImmediateVariable regarding the same motivation as the original S1488 issue.
private FormatterFunc.Closeable toFunc() {
var runner = new ProcessRunner();
return FormatterFunc.Closeable.of(runner, this::format);
}
private FormatterFunc.Closeable toFunc() {
return FormatterFunc.Closeable.of(new ProcessRunner(), this::format);
}
- https://docs.openrewrite.org/recipes/staticanalysis/inlinevariable
- https://sonarsource.github.io/rspec/#/rspec/S1488
- [java] New Rule: VariableCanBeInlined: Local variables should not be declared and then immediately returned or thrown pmd/pmd#5770
- Issue #16421: Local variables should not be declared and then immediately returned or thrown
S1488checkstyle/checkstyle#16488 - https://github.com/diffplug/spotless/pull/2702/files#r2486044966
Metadata
Metadata
Assignees
Labels
No labels