Spam,
Just curious, how serious do you guys take FXCop? Is it overboard? Or are
most of the suggestions valid?
I normally use "Code Analysis" from Visual Studio Team Suite; I take the
suggests very serious. As most of the rules are based on the .NET Design
Guidelines.
I don't consider it overboard, especially when creating control libraries
that others will consume. I consider most (99%) of the suggestions valid,
however there are a couple I turn off. For example I turn off CA1725 as VB
assigns the "wrong" parameter name with it emits properties in interfaces.
(Which reminds me I need to file a bug report). I also watch CA1004 closely
as I will use the type parameters to encapsulate downcasts, especially where
the encapsulated function expects a System.Type; for example:
Public Function GetCustomAttrib ute(Of T As Attribute)() As T
Dim assembly As System.Reflecti on.Assembly =
System.Reflecti on.Assembly.Get ExecutingAssemb ly()
Dim attributes As Object() =
assembly.GetCus tomAttributes(G etType(T), True)
If attributes Is Nothing OrElse attributes.Leng th = 0 Then Return
Nothing
Return DirectCast(attr ibutes(0), T)
End Function
I understand that Code Analysis is derived from (compatible with) FxCop.
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Spam Catcher" <sp**********@r ogers.comwrote in message
news:Xn******** *************** **********@127. 0.0.1...
"Chris Mullins [MVP]" <cm******@yahoo .comwrote in news:#XjPthDPHH A.2312
@TK2MSFTNGP04.p hx.gbl:
>Well, FXCop will complain that you shouldn't be returning List<Teither.
That should be either an Interface, or one of the
System.Collect ion.ObjectModel collections.
Just curious, how serious do you guys take FXCop? Is it overboard? Or are
most of the suggestions valid?