Remove this expression which always evaluates to true
what you will learn here about SonarQube
- Remove this expression which always evaluates to true
Remove this expression which always evaluates to true
Please follow the following steps to know how solve remove this expression which always evaluates to true issue on SonarQube. Remove this expression which always evaluates to true issue will come on SonarQube when you are checking condition which always return true.
Scenario 1
When you have Boolean variable with true value and you are checking that particular variable in if block then you will get remove this expression which always evaluates to true issue on sonarqube. Solution is very simple you don’t need to check anything inside if block which is shown below.
Scenario 2
Remove this expression which always evaluates to true issue you will get on SonarQube when you checking two variables where one boolean variable is always true. Solution is very simple, you just have to check other boolean variable which is responsible for the conditional result which is shown below.
Scenario 3
Remove this expression which always evaluates to true issue you will get on SonarQube when you checking two variables where one boolean variable is always true and you are checking NOT of Boolean variable which is always true. Solution is very simple, you just have to check other boolean variable which is responsible for the conditional result which is shown below.