Skip to content
Advertisement

Pmd rule: Too many static imports may lead to messy code in unitTest is not violated

I have a doubt, I have a class in which I’m using different static import for import constants, my issue is that I’m getting the error message: Too many static imports may lead to messy code. But in the unit test it looks like it is not a bad practice. For example in a unit test class, I’m using this import with any problem:

JavaScript

Conversely in my class:

JavaScript

These imports makes me problems and I get the error message: Too many static imports may lead to messy code. I’m not pretty sure why.

I am not able to access the pmd file to figured out the real cause of this issue. Any clue?

Thanks!

Advertisement

Answer

I have used @SuppressWarnings(“PMD.TooManyStaticImports”) To avoid this issue in my class.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement