I have the below method which is showing a sonar issue saying the method is not used anywhere.
@Provides
@ObjectMapperAnnotation
public ObjectMapper provideObjectMapper() { //NOSONAR
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JsonOrgModule());
return mapper;
}
But this is a method that is called by the guice library and I do not have to call it explicitly. So in order to compress this issue I used the NOSONAR tag as shown above. But it still is showing a major issue as shown below.
Is //NOSONAR used to exclude false-positive or to hide real quality flaw ?
How can I avoid this issue being shown for using the NOSONAR tag? Any help would be much appreciated.
Looks like the squid:NoSonar rule is activated in the Quality Profile used by this project, precisely to avoid developers silently marking stuff as NOSONAR i.e. sweep problems under the carpet.
Moving forward:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With