NDepend is the most wonderful analysis tool I have ever found . It can help you by providing metrics of your code or anyone else code, specify code constrains, analyze code, diff between versions of your code. It also has an open source license to anyone interested. I am going to apply the some metrics like the ones Patrick posted here
http://codebetter.com/blogs/patricksmacchia/archive/2009/01/11/lessons-learned-from-the-nunit-code-base.aspx http://codebetter.com/blogs/patricksmacchia/archive/2009/01/19/mono-vs-net-framework-public-api-compatibility.aspx http://codebetter.com/blogs/patricksmacchia/archive/2008/10/01/comparing-silverlight-and-the-net-framework.aspx http://codebetter.com/blogs/patricksmacchia/archive/2008/08/26/nhibernate-2-0-changes-overview.aspx http://codebetter.com/blogs/patricksmacchia/archive/2008/08/13/net-3-5-sp1-changes-overview.aspx
in to Xaf 1.5.4
I am very interested to know how serious DevExpress is taken code quality . From my experience, I mean from digging their source every day I say they are good but lets find exactly how good they are.
In the right view you can see one of the many NDepend views that help you to visualize your analysis, and from just a look we can see that in this query a very small part of the framework is involved (where color is blue)
- Number of Fields
- Number of methods
ok !! same results
- Number of Lines of code >25
For this one I think that maybe someone should start put some more rules to their team
- CyclomaticComplexity >15
aha!!! Here we start to see how much NDepend Rocks!!! (see right picture) .Almost 3 times better than previous metric. Good work on this one.
- Poorly commented
// A method with at least 10 lines should be commented.
WARN IF Count> 0 IN SELECT METHODS WHERE
PercentageComment < 20 AND NbLinesOfCode > 10
- With parameters count>5
You see by just looking the right image you can tell if the metric is applied or not even if the image has small resolution
- With local variables count > 7
- Better encapsulation
- Inheritance tree depth >5
Interesting !!! I didn’t expect to find so many types
- Number of fields > 10
that is a bad one
- Types that use boxing
another bad one
- Better encapsulation
Most powerful eh? what do you think? NDepend features do not stop here!!! they are endless.
lets see how the above statistics vary through time, by getting the diff between 9.1.2 and 9.15 version
Ok nice info but we can do better than that.
We Can find all types that added or changed since 9.1.2 version
And something even more powerful, you can tell with ease if your application that you have build with 9.1.2 with hold a 9.1.5 version migration by using NDepend’s CQL language to ask “if there are methods that used to be public and for which visibility was changed or have been removed”
very powerful tool!!! You should try it.
ps: I should say a very big thnks to NDepend that has offered a free pro license to all contributors of eXpand