Sonarqube Version 6.1 - LGPL v3 - Community Edition.
Hi-
Could you please help us to understand the C# rule :Optional parameters should not be used. (csharpsquid:S2360)
As per rule description ,use the overloading mechanism instead of the optional parameters, but if we look at the Compliant and Noncompliant code example , the Compliant Solution is using the noncompliant code again. So if you could please take a look and help us to understand the example of given in the rule description as shown below , would be great help.
Noncompliant Code Example
void Notify(string company, string office = "QJZ") // Noncompliant
{
}
Compliant Solution
void Notify(string company)
{
Notify(company, "QJZ");
}
void Notify(string company, string office = "QJZ")
{
}