<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'FlickrMetadataSynchr', 'Architecture and Design', and 'NDepend'</title><link>http://bloggingabout.net/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=FlickrMetadataSynchr,Architecture+and+Design,NDepend&amp;orTags=0</link><description>Search results matching tags 'FlickrMetadataSynchr', 'Architecture and Design', and 'NDepend'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Analyzing FlickrMetadataSynchr With NDepend</title><link>http://bloggingabout.net/blogs/erwyn/archive/2009/06/18/analyzing-flickrmetadatasynchr-with-ndepend.aspx</link><pubDate>Wed, 17 Jun 2009 22:23:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481817</guid><dc:creator>Erwyn van der Meer</dc:creator><description>&lt;p&gt;A couple of months ago I received a license for &lt;a href="http://www.ndepend.com/"&gt;NDepend&lt;/a&gt; to evaluate its usefulness. I was already convinced that NDepend is a very useful tool. But up to now, I hadn’t put NDepend to good use in a way that I could blog about it.&lt;/p&gt;  &lt;p&gt;Today I decided to bite the bullet and put my own pet project &lt;a href="http://flickrmetadatasynchr.codeplex.com/"&gt;FlickrMetadataSynchr&lt;/a&gt; up for analysis. Its source code is available on &lt;a href="http://flickrmetadatasynchr.codeplex.com/"&gt;CodePlex&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;NDepend analyses managed code for several quality aspects, like cyclomatic complexity, coupling and unused code. In a way it resembles FxCop, but it also does a lot more in terms of reporting. NDepend also is a lot more flexible in letting you query your code base. For this it uses its own SQL variant called Code Query Language (CQL). For example, you could enter this query into the tool&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;SELECT METHODS WHERE NbLinesOfCode &amp;gt; &lt;b&gt;30&lt;/b&gt; AND IsPublic&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;and NDepend will show you all public methods whose number of lines of code exceeds 30.&lt;/p&gt;  &lt;p&gt;Just by using the standard settings, NDepend gives you truckloads of information that point to areas with potential code smell. The report has inline comments that explain why it selects stuff and points out possible false positives for which it is okay to ignore the warning.&lt;/p&gt;  &lt;p&gt;You can find my &lt;a href="http://flickrmetadatasynchr.codeplex.com/Project/Download/AttachmentDownload.ashx?ProjectName=FlickrMetadataSynchr&amp;amp;WorkItemId=10156&amp;amp;FileAttachmentId=3153"&gt;NDepend results here&lt;/a&gt; if you want to see what such a report looks like.&lt;/p&gt;  &lt;p&gt;Starting with those results from top to bottom, I started refactoring my code to improve the quality. For example, splitting up methods to: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Reduce cyclomatic complexity &lt;/li&gt;    &lt;li&gt;Reduce the number of IL instructions in a method &lt;/li&gt;    &lt;li&gt;Reduce the number of local variables in a method&lt;/li&gt;    &lt;li&gt;Increase the comment to code ratio &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This should increase maintainability of the code.&lt;/p&gt;  &lt;p&gt;Go check out &lt;a href="http://www.ndepend.com/"&gt;this tool&lt;/a&gt; if you are interested in improving the quality of your .NET code or if you are tasked with reviewing somebody else’s code.&lt;/p&gt;</description></item></channel></rss>