The SONAR metrics include a section for evaluating the documentation quality, having an item Public undocumented API. This is very high in our project because it reports each and every unit test. However, unit test methods have to be public for Junit.
Is there an easy way to remove unit test methods from the undocumented API metric?
I'm aware of these alternatives:
- We could add JavaDoc comments to each test method. This is not useful, as it just pollutes the code.
- The tests are in Eclipse test fragment projects. We could completely exclude the test classes from the SONAR analysis. However, we generally want to have the same rules applied to test code and production code (e.g. when checking violations).
I have not found a section in the SONAR configuration matching that metric, but I may have missed it.