Java code coverage

I need to apply a different coverage threshold for specific files, making it different from the threshold set for the rest of the project files in the quality gate. How can I achieve that? even using custom rule

Hi,

Sorry, but we just don’t have any provision for this.

Could you help me understand why you want to do this?

 
Thx,
Ann

Hi @ganncamp
I want to set a higher coverage threshold (80%) for the Service classes, as they should always have a test file that covers all scenarios. However, for the other files in the project, a lower coverage threshold (60%) is acceptable. How can I achieve this?

Hi,

There’s no good way to do this.

You would have to analyze as two separate projects, one for Service classes, with an 80% threshold and a separate one for the rest.

But because you would exclude Service classes from the analysis of the rest, and vice versa, I believe that would lead to poorer issue detection since not all the necessary data would be available to either analysis.

 
Ann

@ganncamp
thank you