Reverse assignments

I have a developer that loves writing code ala:

if ( null == foo )


if ( foo == null )

Is there a way of creating a rule that will reverse this sort of thing?

1 comment

Hello Thomas
     You can find and replace such conditions using the following structural search pattern: null == $var$ where $var$ is and identifier (for more information on SSR please see Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

"Develop with pleasure!"


Please sign in to leave a comment.