Code Query Language

Patrick Smacchia just released an alpha of an interesting application (NDepend) that can be used to analyze manage code binaries. It’s similar to FxCop. One really nice difference is that you can extend the tool using scripts written in CQL (code query language).

 

It would be even better if the query language could be any CLI language (for example IronPython) and the query language LINQ based. Patrick, what do you think? :-)

Published 15 February 06 04:39 by kcwalina
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# kfarmer said on February 16, 2006 2:39 AM:
LINQ-based, you say? ;)

-- kfarmer [MSFT:DLinq]
# Patrick Smacchia said on February 16, 2006 4:12 AM:
The LINQ/CLI language integration idea is appealing. After all, there is QL in CQL.

However, I’m close to releasing a usable tool and I can’t wait for LINQ.  It will be time to integrate CQL and LINK on an Orcas schedule. CQL respect the pattern SELECT TOP xxx FROM xxx WHERE xxx ORDER BY xxx and thus, it should integrate seamlessly.


Let me precise that FxCop rules and CQL queries/constraints are good complements to each other. Very few needs are covered by both tools.

FxCop rules are an extensible set of rigid good practices which should be abided by every professional .NET dev.

CQL constraints are customizable and typically tied with a particular application.
For example, they can allow to specify customized encapsulation constraints such as, I want to ensure that this layer will never use this other layer or I want to ensure that this class will never be instantiated outside this particular namespace.
CQL also address code metrics. For example you can ensure that most of your methods will never have more than 200 IL instructions or 4 parameters. More than 30 metrics are available. Moreover the metric based interactive treemap view provided by VisualNDepend helps developers to have a deeper understanding of the structure of their code.
# werner mairl said on March 17, 2006 3:42 AM:
@Patrick S.

I think, Visual NDepend uses the FXCop core dll (Microsoft.cci.dll) to parse the MSIL Code

With this library, it is very simple to implement a tool like CQL
Unfortunately, you use a dotfuscator to hide the implementation details....


werner (wm@schindler-IT.com)

# Patrick Smacchia said on March 27, 2006 11:02 AM:
No I'm not using  FXCop core dll to parse the MSIL code but the Cecil library which is free :
http://www.mono-project.com/Cecil

Indeed, VisualNDepend.exe is obfuscated since it will be a commercial tool.
However NDepend and its libraries will remain free and open source.

Soon, a free beta full featured will be available.
# Saurabh mehta said on July 7, 2006 6:00 AM:
Does NDepend able to restrict or measure the Loc...?

as it is possible in FxCOP..i dont think so..!
# RG said on September 13, 2006 12:45 PM:
I like FxCop better

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker