[MonoDevelop] Code analysis soc project

Mike Krüger mkrueger at novell.com
Tue Mar 23 12:04:29 EDT 2010


Hi

> Has it been committed to trunk yet? Also a small introduction to the
> API would be very handy as well :)
> 

You need to uncomment the CSharpParser.cs file & add a reference to a
modified gmcs.dll. I've send you the current modifications per mail.

It's like nrefactory with following changes:

* It's now possible to navigate to the parent, siblings and children
without knowing the type of the node.
* It's possible to get the exact start & end location in the source file
for every node.
* The tokens are now part of the tree with their exact locations.

And the AST is in the 'MonoDevelop.CSharp.Dom' namespace inside the c#
backend binding. Currently it has some limitations:

* Positions of build in types (int/string etc.) is not correct
* Namespace declarations are not inserted in the AST
* The position of the '/' is not correct
* Templates + constraints are not inserted in the AST
* LINQ expressions are not translated (lambdas are)

I want to work on the templates + LINQ expressions tomorrow. It may be
that there are some bugs with some expressions/statements. I tried to
write a test for all c# expressions, but I may have missed a case.

If you try to use this I would like to get your feedback about it. In
the current state it's easy to change.

Regards
Mike

> >> 1) Extending the Code metrics addin: The addin i posted on the mailing
> >> list does quite a few things, but a lot is still left to implement,
> >> such as cohesion, coupling and association between classes. Maybe I
> >> can add a few more metrics such as
> >> http://yunus.hacettepe.edu.tr/~sencer/oom.html
> >> But the killer feature would be CQL, which allows one to query the
> >> code base for types, methods and namespaces that satisfy criteria as
> >> specified in a very SQL type language. NDepend implements CQL and I
> >> will be trying to replicate that.
> >>
> >
> > This seems to be a good project :)
> 
> Thanks!
> 
> > Regards
> > Mike
> >
> >
> Cheers!
> Nikhil Sarda




More information about the Monodevelop-list mailing list