Mickey Gousset

My Journey Into Team System
(Live Messenger: mickey_gousset@hotmail.com, Twitter: mickey_gousset)

Static Code Analysis - Part 1 - Setting Up To Run
I've created a small sample application to help with this post. Basically, it’s a class library application called CalculatorExample. I've added one class so far, called MyCalculator. This class has two methods: Add(num1, num2) and Subtract(num1, num2). I actually used the Class Designer to build the class and methods.

I want to run Static Code Analysis against this sample app. In the Solution Explorer, right-click on the project name (CalculatorExample) and select Properties. This opens the properties page for the project. Click the Code Analysis tab on the left-hand side to open the Code Analysis section. To have static code analysis run every time the application is built, you need to check the Enable Code Analysis (defines CODE_ANALYSIS constant) checkbox.

You can also decide which rules you want to use when static code analysis is run. The rules are grouped into different groups, such as Design Rules and Globalization Rules. You can check/uncheck entire groups, or you can drill down into a group and disable or enable individual rules, depending on your process.

Finally, for each rule and/or rule group, you can specify what happens when the rule is broken. You can choose to have Visual Studio throw either a warning or an error. Simple double-click the Status column for a rule or rule group to toggle between error and warning. By default, all the rules are set to throw warnings.

Once you have everything configured, save your changes to the project properties and close them. For my example, I left all the rules checked. The following image shows you the Code Analysis tab for my project properties.

Published Friday, January 19, 2007 8:01 AM by mickey_gousset

Comments

# Static Code Analysis - Part 2 - Run and View Results@ Monday, January 22, 2007 8:33 AM

[NOTE: Still have not resolved the image problem.  Please log into Team System Rocks! to be able to see...

# Static Code Analysis - Part 3 - Suppress Messages@ Wednesday, January 24, 2007 8:24 AM

[NOTE: Please log into Team System Rocks! to be able to see the images. ]

For background, please see...

# Static Code Analysis - Part 4 - Creating A Work Item@ Friday, January 26, 2007 8:05 AM

[NOTE: Please log into Team System Rocks! to see the images.]

For background, please see Part 1, Part...

# The Disco Blog » Blog Archive » The weekly bag– Jan 26@ Friday, January 26, 2007 8:30 PM

PingBack from http://thediscoblog.com/2007/01/27/the-weekly-bag-jan-26/

# re: Static Code Analysis - Part 1 - Setting Up To Run@ Wednesday, July 01, 2009 12:04 PM

<a href="www.tiffanyjewel.co.uk/">Tiffany Jewellery</a> is the best online United Kingdom jewelry stores where you can buy the cheapest Tiffany & Co silver jewelry. Our huge selection of Tiffany

<a href="www.tiffanyjewel.co.uk/">Tiffany </a>

<a href="www.tiffanyjewel.co.uk/jewellery-tiffany-co-bracelets-19.html">Tiffany  Bracelet</a>

provides the best Tiffany & Co jewelry, including Necklaces, Pendants, Bracelets, Earrings, Rings  at the lowest prices,

<a href="www.tiffanyjewel.co.uk/jewellery-tiffany-co-earrings-15.html">Tiffany Earring</a>

<a href="www.tiffanyjewel.co.uk/jewellery-tiffany-co-necklaces-13.html">Tiffany  Necklace</a>

<a href="www.tiffanyjewel.co.uk/jewellery-tiffany-co-rings-16.html">Tiffany Rings</a>

<a href="www.linksstore.co.uk/">links of london</a>

by sunn

Leave a Comment

(required) 
(required) 
(optional)
(required)