A way to find unused methods etc. in Visual studio

Dec 22 2011 Published by under Uncategorized

While refactoring projects I’d like to get a list or graph of unused methods.  This is not only for tidying or big-rewrites but also for whenever one updates a method.  Every time this happens I’d like a ping that x less or y more methods are used.

Combine this with profiled unit tests and one could get the time&resource impact of a rewrite very fast.

First step is to create something that find dud methods/properties/classes/etc.

Second step is to make it awesomelly useful.

This idea is probably already created somewhere.  Anyone who knows?

2 responses so far

A source code editor that isn’t document oriented

Jun 27 2011 Published by under Uncategorized

I say the world is in need of a source code editor that isn’t document oriented.

Today we open a file.  This file typically contains a class and its methods.  One can read the object variables and relations to other classes typically at the top of the document.  The methods are sorted in an alphabetical manner.

Why do we still handle the code like this?

When I work with source code I am more interested in the calls that come in and go out of the method I am looking at.  I am also interested in inheritances and interfaces of the class and both the class’ and the method’s usage throughout the project/solution/world.  I am normally not interested in the method that begins with the same letters.

Some years ago I saw a Java editor that worked with relations instead of source code.
I have recently experimented with Debugger canvas from Microsoft which takes a similar view on debugging.  It is labs and it is, probably, a beta and it is immature and does not hold Microsoft standard yet.  But it is a start.

D0es anyone know of any other tool that handles the source code like we handle it, and not only as files in a folder structure?

No responses yet

Highlighted line in visual studio

Mar 24 2010 Published by under Uncategorized

The Visual studio editor still doesn’t give the opportunity to highlight the row where the cursor is.

There is no gratis addin solution I am aware of either.

Please make this happen.

Update:
There are extensions that does this.

No responses yet

Visual studio List visualiser

Mar 22 2010 Published by under Uncategorized

There is a good dataset visualiser in Visual studio.

But if one uses lists one is out of luck. I have tried creating one, but failed either of lack of competence or lack of time.

There might be a way to export a list to a datatable and work from there but strange enough I haven’t tried.

Create a debug visualiser for generic lists in Visual studio.

No responses yet

Shortcut aid duplicate in Visual studio

Mar 03 2010 Published by under Uncategorized

When developing Winforms (and Webforms and Aspnet) in Microsoft Visual Studio there is no aid to stop me from entering overlapping shortcuts.

For example I have a menu with 5 items which have shortcuts alt-F, alt-E, alt-V, alt-T and alt-H.  It is then important that my buttons don’t have the same shortcuts.  There is nothing in Visual Studio signalling a shortcut used in more than one place.

Technically this could be solved through recursing through the controls of a form.  It can be done in the OnLoad event and only in debug mode.  The controls could then be highlighted and maybe reported since it isn’t possible to statically change shortcut while debugging and at least I forget which two controls should be changed to what.
One could take it further to show up already in the designer, that would be the nicest solution.

It is more complex for MDI interfaces.  There is no static linking between a parent and child forms.  One could have a settings file describing the relations.

Ditto tab controls.

Then we have rules like that alt-S should be Save and alt-E should be used for Seek throughout the application.  Without thinking one could use alt-S for Seek in a form somewhere which could fool the user into believing he has saved when he have not.
The technical solution to this could be to have a common settings file.  Controls using one of the regulated short cuts then flag that they are approved for this by a flag.  A developer might accidentally set a short cut but not a flag at the same time.

No responses yet