Geeks With Blogs

News profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers

Donate Bitcoins

Check out Elapser from T3rse!
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD

I was contacted by NDepend and asked if I wanted a free version of their professional license in exchange for writing a post about it. I agreed and have been running it for a few weeks. My first impression was, “wow, that’s a lot of information” about my code base. I have the  opportunity to be a part of a rebuild of a project and creating a new code base. One of the main requirements is to create maintainable code (the old one if very impressive, but was created adhoc and by someone learning programming at the same time, so it is hard to change and maintain). We’ve decided to use StyleCop and Static Code Analysis to help with some of that, but this tool increases the visibility of possible problems immensely.

I can write LINQ against my code? Very cool.

The Visual Studio integration is very good. Here are a few screen shots. There are many more at www.ndepend.com.

Here is the quick summary at the bottom right. It updates automatically based on the settings.

vs_bottomRight

Here is the Global Summary:

vs_summary

Here’s what you see after building the report:

reportOutput

Drilling into the report, I can see what the dependencies are, what rules I’ve violated (there is a VisualNDepend that is more interactive, allowing you to hover over assemblies, create a baseline and see if you’re improving, visualize which assemblies and methods have more code, etc), metrics (such as properties, interfaces, arguments on methods, etc), see lines of IL code and where optimization might be necessary, and on and on.

The rules are created using LINQ queries and there are many built in rules that could be useful. I’m using ReSharper and StyleCop already to help with naming and catching some of this, and they conflict at times. So it would take some work to decide which rule set to enforce.

report_rules

Here’s an example of the built in error finding methods with too many parameters ( I currently have 12):

// <Name>Methods with too many parameters - critical</Name>
warnif count > 0 from m in JustMyCode.Methods where
m.NbParameters > 8
orderby m.NbParameters descending
select new { m, m.NbParameters }

I haven’t had the time to learn everything about NDpend and there is much more than I have time to write about. If you’re working with a team or a legacy project or any project, and need to get some more insights into your code base, I highly recommend this tool to you. Check out their website for more information. It isn’t overly expensive and they have a large amount of testimonials to look at. I look forward to using this tool on my current project and see how it grows and how NDepend helps me keep on top of keeping it maintainable.

Thank you NDepend for the software!

Posted on Wednesday, March 6, 2013 12:55 PM Tools | Back to top


Comments on this post: A Look at NDepend

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net | Join free