Skip to main content

Command Palette

Search for a command to run...

SonarQube Fix : Merge the enclosing if statement.

Published
1 min read
SonarQube Fix : Merge the enclosing if statement.
S

I love learning about technology and sharing that with others

So I was fixing the sonarQube reported issues in our codebase.

here we have multiple if statement and those can be bundled together.

Non Compliant code :

screenshot_89.png

Compliant Code :

here we have put the next if condition in the same if statement , we can also create a function and pass that function with the if statement , currently this works for me.

image.png

169 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)