4

I personally don't use FxCop yet. We want to work out the unit testing first before going with code analysis. However, which rules would you permanantly deactivate? Which rules would you deactivate temporarily and in which situation?

Maxime Rouiller
  • 13,614
  • 9
  • 57
  • 107

5 Answers5

5

I dislike rule CA1021: Avoid out parameters. Out parameters are useful for many different patterns (including the .Net Try* pattern). Out can certainly be overused but really it seems overkill to have an FxCop rule for it.

Rule CA1021

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • The Try* pattern does not trigger this rule. See the [MSDN page](http://msdn.microsoft.com/en-us/library/ms182131%28VS.80%29.aspx). – Kris Dec 13 '13 at 09:42
  • The community AddOn there does state that it doesn't violate this rule, but does not explain why. That doesn't seem like a good source. – Jason Kelley Jun 25 '14 at 15:45
3

CA2210 Assemblies should have valid strong names is an annoying one.

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
2

There's a whole list of pedantic crap you'll want to turn off depending on the system you're building. I'd suggest examining the FxCop output and deciding yourself. One mans pedantry is anothers "must have".

Quibblesome
  • 25,225
  • 10
  • 61
  • 100
2

I don't use the naming convention rule that prohibits underscores in method/event names. I've gotten used to "Button1_Click". Visual Studio automatically inserts the underscores, so you have to manually remove them. I just think it's easier to leave them alone. And, I add the underscore when I create a method/event.

DOK
  • 32,337
  • 7
  • 60
  • 92
0

It complains about "ID" and suggests "Id"... even though that follows the "two-character-abbreviations-are-all-capped" rule :O)

Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128
  • 1
    I was coming to this question from http://stackoverflow.com/questions/264823/whats-the-proper-naming-convention-for-a-property-id-id-or-id#264841 about ID or Id. Actually, Id is correct, because the two letter thing only applies to acronyms and not to abbreviations. :) – OregonGhost Nov 05 '08 at 11:11
  • But ID can be an acronym, since it stands for "identity documentation". – Egor Pavlikhin Oct 20 '09 at 06:20
  • 1
    Also known as "Id Documentation"? ;) – Rob Fonseca-Ensor Nov 19 '09 at 09:52