0

On high level my problem is -

We have couple of applications which have millions of lines of legacy code (C# and SQL). I need to figure out code areas which are being used most?

It may not be possible to find exact figures (especially in apps when code is being called based on user's action in GUI). However, to get some rough figures few thoughts I have are to find out:

1) Find out List of Classes and Methods

2) Find out number of time they are called from within the code. (by means of direct method calls/delegates etc)

3) Find out all the stored procs/db functions (this would be bit staright forward)

4) Find out all the calls to stored procs

Could you please let me know - if you are aware of any tools to achive this? Or any other idea to fetch above 4 details? Also, apart from these any other way to to do this analysis?

Thanks in advance!

BradleyDotNET
  • 60,462
  • 10
  • 96
  • 117
Ankit
  • 1
  • 1
  • 1. Please refer to the FAQ regarding signatures in questions. 2. Are you using Visual Studio as your IDE? – M.Babcock Feb 01 '12 at 05:56
  • @M.Babcock - Thanks will do that.. i m still new to this forum. Yes I am using Visual Studio. – Ankit Feb 01 '12 at 06:08

2 Answers2

1

I have used Red Gate's ANTS Profiler before:

http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/

It's powerful and very easy to use (comes with a visual studio plugin). 14 days free!

Andy
  • 1,060
  • 7
  • 13
0

One way you could achieve this is using Aspect Oriented Programming (AOP). I have used this previously in Java with the Spring Framework, but haven't used it before on .NET projects.

You could check out something like;

http://blogs.msdn.com/b/morgan/archive/2008/12/18/method-entry-exit-logging.aspx

This will give you an idea of how frequently methods are being called. Your will need simply need to collate the data in the logs into some form giving you an overall idea of usage patterns of the codebase.

Edit: Further information on using this method can be found on other SO posts;

Community
  • 1
  • 1
Mr Moose
  • 5,946
  • 7
  • 34
  • 69