0

My project uses third party library (let's call it X) with a lot of deprecated code. Sonarqube reports a lot of issues every time I call depracated method or use deprecated type from library X. I found that rule squid:CallToDeprecatedMethod is responsible for that.

What I want to achieve is to have rule squid:CallToDeprecatedMethod enabled for all types and method references excluding library X (or particular package from library X). What's more I want to do it externally without any sonar specific exclusion marks in the codebase (i.e. @SuppressWarnings("squid:xxx"))

I tried Sonarqube's administration->analysis scope options but didn't find anything. Also checked StackOverflow, for example here but found nothing.

My SonarQube version is 5.6.6.

Wojciech Wirzbicki
  • 3,887
  • 6
  • 36
  • 59

1 Answers1

-1

While sonar analysis you can pass sonar exclusion if you dont want in code.

mvn sonar:sonar -Dsonar.exclusion= **/pattern/*.java

shibanisankar
  • 29
  • 1
  • 7
  • I don't want to ignore my source files. All files need to be checked. I want rule squid:CallToDeprecatedMethod to ignore deprecated code from third party's library. – Wojciech Wirzbicki Mar 14 '19 at 07:09