Can SonarQube apply specified rules to particular codes?

I know that SonarCube could exclude certain codes or modules.

My question is that, currently i have certain project, i only want to scan part of the codes using all SonarCube rules; but at same time, for other parts of same project codes, i only want to apply some of the Sonar rules(for example, rules relates to security).

Any experts can give me some hints, whether sonar can do this using maven or not, and how if possible. thanks.

Hi @wxqsly,

You should refer this document https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus to get a better information regarding your question. Specially try concentrating on this topic Ignore Issues on Multiple Criteria. I think it will help.

1 Like