Quantcast
Channel: My musings on .Net Technology » .Net
Viewing all articles
Browse latest Browse all 10

Whats new in NDepend 4

$
0
0

For the last few days I have been playing with the shiny new NDepend 4, and enjoying the new code query language that now supports LINQ i.e. writing custom code query is way easier than ever before. The new code query language is  thus rightly christened as CQLinq.

Example: To write a custom query that find all methods (not generated by visual studio) with more than 30 lines can be written as simply as:

notmycode from m in Methods where
m.SourceFileDeclAvailable &&
m.SourceDecls.First().SourceFile.FileName.ToLower().EndsWith(“.designer.cs”) &&
m.NbLinesOfCode > 30
select m

In the below screenshot, I have queried all methods in caliburn micro framework with underscores. Similarly you can use NDepend to verify if the project adheres to MVVM pattern or find types with missing IDisposable implementation. There are a lot more CQLinq examples you can read here.

The NDepend query builder as always supports auto-completion, and compiles the query on the fly prompting you of any errors as you type.

Further, NDepend also contains more than new 200 ready made code metrics and quality rules, with pointers to in-depth articles explaining the reason behind the specific rules. I would highly recommend users/developers to otherwise at least glance through these rules and articles.

Following is the screenshot of the overall code quality of Caliburn Micro.

Last, do read the one page quick summary of the NDepend Metrics. I have also covered other NDepend’s feature here.



Viewing all articles
Browse latest Browse all 10

Trending Articles