3-party dll hungarian parameter conflict between CA1725 and SA1305

Jul 1, 2011 at 5:02 AM

I use a 3-party dll. I implement it's interface.

It uses lower-case function names and hungarian parameters.

The lower-case function names generate SA1300 ElementMustBeginWithUpperCaseLetter. I can't change the function names because of implementing that interface, so I have to suppress them at the class level. I think this warning should be suppressed when I'm using dlls that doesn't have source code. So I put SuppressMessage at the class.

Then the hungarian parameters generate SA1305 FieldNamesMustNotUseHungarianNotation warnings. I change all the parameters to obey this rule.

Then CA1725 ParameterNamesShouldMatchBaseDeclaration occurs.

I can't think of a way that can satisfy these two rules. And I'm using TFS Code analysis check-in policy, I don't want to disable the CA1725 rule just to suppress this class's warnings. And I can't suppress them using SuppressMessage, becuase there are nealy one hundred parameters to suppress. So the last choice is to suppress SA1305 at the class level. Keep using hungarian parameters.

So, I think CA1725 and SA1305 are conflict at 3-party dll. Can StyleCop suppress SA1305 when using dll's methods (and when CA1725 enabling?) ? And can StyleCop suppress SA1300 when using dll's methods?