Equivalent of S1698 in Web profile ("==" and "!=" should not be used when "equals" is overridden)


(Ankur) #1

SonarQube 6.7.4

There is a useful Java rule S1698 ("==" and “!=” should not be used when “equals” is overridden), but no such rule exists in Web profile (for JSPs etc.). Would be better if this rule is added there too.

(Nicolas Harraudeau) #2

Hi @ankurja,

Thank you for your feedback.
Analyzing non-HTML code in HTML files, such as java in JSP, is indeed a great idea but this is not currently possible. The SonarHTML analyzer (previously named SonarWeb), which uses the HTML profile (previously named Web profile), focuses only on HTML tags. It does not analyze java code.

The S1698 rule is not applicable to HTML code, thus we can’t add it to the HTML profile.

Kind regards

(Ankur) #3

Thanks. Is there any roadmap to add the functionality of analyzing Java code in JSPs in near future ? or any external plugins that can do it today ?

(Nicolas Harraudeau) #4

Hi @ankurja

This is not part of our current roadmap and I am not aware of any 3rd party plugin which can do this either.

Kind regards,