Saturday, September 29, 2007

.Net Code Metrics

While .Net platform in most spaces have good open source and commercial tools, recently I found that .net lacks good code metrics tools. In my particular case I only want to see basic things (like LOC or inheritance level) of little home investigations done in last month. When I search google for such tools only what I found is commercial NDepend, simple devMetrics and Reflector's plugin.

NDepend is awesome tool, not just code metrics, it has many other features. But it's too expensive ($400 per license) and has no any free edition.

devMetrics seems to be abandoned project with not very friendly site, so I didn't try it.

Reflector is famous .net class viewer. It has good metrics add-in.

reflectormetrics

I use it found that it enough interesting, it looks like free young brother of NDepend. The problem that some of generated indices are unintelligable. What is CodeSize? It's not the number of code lines but what?

And today with port my project to Orcas I finally found what I want.

VSTS 2008 has Code Metrics! Just look:

vs9codemetrics

I consider of use Team Suite now ;)

Tuesday, September 11, 2007

Xml in VS with Resharper

In the early 2000-s XML was one of the technologies, wondered the developer community.

Today, with all of that RoR,JSON n etc. XML has become thing, that many people dislike. But also, it's for now sufficiently mature.

In this world (java/.net) today when it has no attribute/annotation use, xml is choose for configuration in most cases. So NHibernate or Spring use it.

Visual Studio has enough good support for XML (if you not forgot place your *.xsd in Schemas folder) - except one thing. When you want to create new mapping for class you need to manual write whole namespace for it.

And now, with ReSharper you can complete you class name in XML.

Just press Ctrl-Alt-Space. You see:

resharperxml1

And you get:

resharperxml2

 

But assembly name you need to add by hand:

resharperxml3

 

As Ilya Ryzhenkov mentioned in comments, ReSharper has context action for complete module qualification.

 resharperxml4

Click yellow light bulb or press Alt-Enter:

resharperxml5

And you'll give:

resharperxml6

It's almost cool, only what I want is ability to  add only assembly name, not full qualification.