Modify or Copy and Update the rule

9 views
Skip to first unread message

Eugen Martynov

unread,
Jul 7, 2017, 10:14:51 AM7/7/17
to SonarQube
Hi guys,

As an example, I have an issue with classes which lifecycle we don't control. Sonar suggests using constructor injection instead of field injection. I would like to switch this rule based on class name Regexp. 
Is it possible? Is there a documentation how to tune rules or create a new one?


Michael Gumowski

unread,
Jul 7, 2017, 10:27:19 AM7/7/17
to Eugen Martynov, SonarQube
Hello Eugen,

Indeed as you don't control lifecycle of such classes, theses issues may be irrelevant. Before considering modifying the rule on our side, you may want to have a look at this article from our documentation: https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus

It describes how to narrow the focus of the analysis. In particular, it provides insights about how to define patterns to ignore issues following multiple criteria, which seems to be the case for you.

Hope this helps,

Michael

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/e90ac50e-a7c7-4d14-b081-f65a5486979a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael Gumowski | SonarSource
Software Developer, Language Team
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages