Good catch, Paulo!
Shall the rule trigger violation for callbackObject parameter? No, it shouldn't. And yes, it should. The triggered violation in this particular case is somewhat arbitrary. But ultimately the MS guidelines are very clear on this -
"Avoid using language-specific types name in parameters and members and data type identifiers in parameters. Types names might not be intuitive for all developers. It is recommended that you select a generic name, such as 'value', instead. If this is not sufficient, be sure to use the type name as it is defined in the .NET Framework Library and avoid language-specific type names completely."
And even for the callbackObject below:
public class A
{
public void Test(object callbackObject)
{
}
}
"In member 'A.Test(object)', consider replacing the data type identifier 'Object' in parameter name 'callbackObject' with a more generic term, such as 'value'."
After all the parameter callbackObject above is of a type object...
So, while the rule is configured to follow MS guidelines pretty strictly, I do agree with your point. In CodeIt.Right we provide multiple ways to tweak rules to you needs if disagree. In this case you can add callbackObject into the ExcludeList property (comma delimited list) of your instance of the rule "NA00003: AvoidLanguageSpecificTypeNamesInParameters" - this will solve the issue.
Thanks!
Thank you,
Serge Baranovsky
http://submain.com - .NET Developer Tools | Microsoft VB MVP | http://vbcity.com - VB Developer Community
» » (Static Code Analysis + Automatic Refactoring) / Painless Coding Guidelines = CodeIt.Right - http://submain.com/codeit.right
» » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines