Songhay Project Down to Four Code-Analysis Warnings!
My Songhay
project was started before .NET 2.0 (probably in the .NET 1.1 timeframe). It’s a dependency in all of my CodePlex.com projects. I started the day with over 60 warnings and whittled them down to four. Here are my notes along the way:
- Jeremy Jameson in “CA1704 Code Analysis Warning and Using Custom Dictionaries in Visual Studio” led me to using a custom dictionary for Code Analysis.
- I got a whole boat load of “CA1059: Members should not expose certain concrete types” errors because I return
XPathDocument
quite a bit in theSonghay.Xml
namespace. I suppressed these using the justification directly from Microsoft: “It is safe to suppress a message from this rule if the specific functionality provided by the concrete type is required.” - I got a metric ton of “CA1305: Specify IFormatProvider” warnings because I’m an ugly American (in recovery). This leads me to the topic of “Culture-Insensitive String Operations” which is rather funny when taken out of context.
- I got one “CA1815: Override equals and operator equals on value types” warning. This one was awesome because it helped me learn about why
struct
types can be costly. To escape the wrath of my warning, I just changed my struct into astatic class
—this may not be the proper solution to the problem. - Because
Songhay
is targeting .NET 2.0, I removed all of thevar
keywords in the Project. Thevar
keyword came out in .NET 3.0—and I’m still nervous about compatibility with Mono (which is totally irrational). KeepingSonghay
at .NET 2.0 is a defensive move against being economically forced into a situation where I have to work in a shop stuck in .NET 2.0—it’s a cold, cold world, baby…
Yes, Songhay
is targeting .NET 2.0. I have another core-dependency project, SonghayCore
(named after Microsoft’s System.Core
) that will move ahead with the latest RTM of the .NET Framework. I’ve just ran Code Analysis on SonghayCore
: 147 warnings—strewth!
The fresh, clean Songhay
Project should be up on CodePlex.com in a few days—likely nestled in my Silverlight BiggestBox. I have to give a presentation on this ‘box’ this month so having a more solid core can’t hurt.