Must-share information (formatted with Markdown):
-
SonarQube Server Developer EditionVersion 10.3 (build 82913)
-
how is SonarQube deployed: zip, Docker, Helm - not sure
-
what are you trying to achieve - make SonarQube see a method in a Nuget package and not raise error: csharpsquid:S3900
-
what have you tried so far to achieve this - I searched the Community Forum and saw this topic, but it doesn’t quite answer my question.
How Does Sonar Cloud Handle Custom Nuget Packages and Jar Files?
I have the following class and method in a Nuget package library:
public static class Checker
{
public static void VerifyArgumentNotNull(object value, string name)
{
if (value == null)
{
throw new ArgumentNullException(name);
}
}
}
I use it in the following way:
Checker.VerifyArgumentNotNull(context, nameof(context));
Which protects against null. However, SonarQube doesn’t recognize this call and still raises:
Arguments of public methods should be validated against null csharpsquid:S3900
Is there any way I can make SonarQube recognize the call to the Nuget library and not raise this error?