@VisibleForTesting is an extremely useful annotation
Obviously it can be used to hide 'code smells', where a refactor of the code would eliminate the need for special testing methods, but there are times where it is the best option (usually interfacing with legacy/3rd party code we have no control over).
I would like to encourage people here to use it, but not if its use is going to lead to more issues being raised
But I'm not sure what approach would be the best. Do we ask that all rules are excluded on code where this annotation is used?
on one side I think that making something more visible for testing is really not a good practice anyway
--
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/202e1a20-7733-4472-96c7-e493e6659c4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f18865b2-c3fe-4a9b-96b4-fb4224bdec77%40googlegroups.com.
Hi Michael,
This rule by rule approach suits me well.
Thanks!
Regards,
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/CABGmqn%3DTc0M-EHC7U617OsJUDj%3D%3Du5zPSAfd9c5ZZvJKW7dpHg%40mail.gmail.com.