We have an Android/Blackberry project with a common part. That part, obviously, is written to compile to both Android and Blackberry targets, and, consequently, cannot use some of the newer Java features (e.g., Integer.valueOf). I'd like to skip some of the rules specifically for that part. Is there a way to do this?
You can have SonarQube ignore issues on certain components and against certain coding rules. Go to Project Settings > General Settings > Analysis Scope > Issues. Note that the properties below can only be set through the web interface because they are multi-valued.
There are three ways to add coding rules to SonarQube: Writing a SonarQube plugin in Java that uses SonarQube APIs to add new rules. Adding XPath rules directly through the SonarQube web interface. Importing Generic Issue Reports generated by an independently run tool.
If you separate the common part to an own project you can add a new Quality Profile in Sonar (where you deactivated these rules) and assign it to your common project.
Apart from that you can use the
// NOSONAR
comment to supress a warning on a single line (see FAQ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With