rewrite-static-analysis icon indicating copy to clipboard operation
rewrite-static-analysis copied to clipboard

OpenRewrite recipes for identifying and fixing static analysis issues.

Results 112 rewrite-static-analysis issues
Sort by recently updated
recently updated
newest added

## What's changed? Fix for DefaultComesLast recipe creates duplicate case #289 ## What's your motivation? Bug fix

bug

If default comes before a case and simply continues into that case ```java default: case DERIVATION_MODE: System.out.println("default"); break; ``` refactoring with `org.openrewrite.staticanalysis.DefaultComesLast` from `org.openrewrite.recipe:rewrite-static-analysis:1.6.0` results in a duplicate case and...

bug

As [discussed here](https://github.com/openrewrite/rewrite-static-analysis/pull/108#issuecomment-1547448538) the `ExplicitInitialization` currently doesn't remove the explicit initializers from fields in anonymous subclasses (`J.NewClass` instances with a `body`). It would be good if it could be extended...

enhancement
good first issue

## What version of OpenRewrite are you using? I am using the latest version as of 2024-04-02 ## How are you running OpenRewrite? I am using the Maven plugin, and...

bug

## What problem are you trying to solve? When using ParameterizedLogging, the output is not compatible in my IDE, since restriction is placed on autoboxing usage. I wish I can...

recipe

## What problem are you trying to solve? Lets imagine you have wrong class javadoc like this: ``` /** * @param * type of product * @author John * @since...

enhancement
good first issue
recipe

## What version of OpenRewrite are you using? I am using - Maven/Gradle plugin v5.22.0 - rewrite-static-analysis_v1.3.0 ## How are you running OpenRewrite? I am using the Maven plugin, and...

bug

## What's changed? This PR will enable the transformation of lambdas with method invocation as body within assertThrows, a feature that unexpectedly wasn't fixed with https://github.com/openrewrite/rewrite-static-analysis/pull/241. ## What's your motivation?...

enhancement

## What problem are you trying to solve? I've come across ```java if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } ``` which is currently not...

enhancement

## What problem are you trying to solve? Just came across this finding from IntelliJ: ```java String upperFoo = "FoO" "foo".equals(upperFoo.toLowercase()) ``` can be ```java String upperFoo = "FoO" "foo".equalsToIgnoreCase(upperFoo)...

enhancement