SonarQube C# Rule for Methods Naming Convention as Pascal

Hi Team

SonarQube identifying the methods with which are in Pascal Case. Which is right.

But we have a few words which are related to our organization which should be in caps only.
Ex: CCDAPath Method which we cannot convert as CcdaPath.

Please suggest how to handle these cases.

Note: We have around 2000 places where we have this type of scenario. So it will take a lot of time to disable the analysis on each line for the specific rule.

Hi Chandra,

The usual suggestion in this case is to make these issues as “Won’t Fix” since they are known exemptions.

In your case, since there are so many exceptions, it makes sense to simply disable the rule. Yes, some non-Pascal case violations will enter your code base but the alternative is a lot of noise and manual effort for your developers.

If you really want this rule enabled, you can bulk edit (perhaps via the Web API) all existing violations as “Won’t Fix” and focus on the new violations as they are created.

Cheers

Brian

A better solution would be to have an exemptions list like other programs do for handling spelling.

Thank you @bcipollone for the reply.

I will try to bulk edit (via the Web API) all existing violations as “Won’t Fix”.

Hi @StingyJack Thank you for the reply.

Can you please describe what I need to do in terms of configurations and where I need to do.

Hi @cpuvvadi - My post was supposed to be in reply to @bcipollone because I think sonar needs to add this functionality. So many times a company or product name is in a different casing and needs to be ignored in all identifiers.

Yes @StingyJack It would be really nice we have a feature where we can set exceptions.

How can we make this forward so that the SonarQube team will start the development on this?

I dunno, I’m just another user like you.

1 Like

Thank you @StingyJack.

@bcipollone:

It would be really nice If we have a feature where we can set exceptions for the Naming Convention. This type of words will be there in all organizations.

How can we make this forward so that the SonarQube team will start the development on this?

Thanks, we have

that track this.