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 GetCustomAttribute(Of T As Attribute)() As T
Dim assembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
Dim attributes As Object() =
assembly.GetCustomAttributes(GetType(T), True)
If attributes Is Nothing OrElse attributes.Length = 0 Then Return
Nothing
Return DirectCast(attributes(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**********@rogers.comwrote in message
news:Xn*********************************@127.0.0.1 ...
"Chris Mullins [MVP]" <cm******@yahoo.comwrote in news:#XjPthDPHHA.2312
@TK2MSFTNGP04.phx.gbl:
>Well, FXCop will complain that you shouldn't be returning List<Teither.
That should be either an Interface, or one of the
System.Collection.ObjectModel collections.
Just curious, how serious do you guys take FXCop? Is it overboard? Or are
most of the suggestions valid?