Welcome Guest.   Make a donation to an author on the site July 25, 2014, 12:43:14 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Detect unused code (C#)  (Read 5754 times)
Ruffnekk
Honorary Member
**
Posts: 331



Uhm yeah...

View Profile WWW Give some DonationCredits to this forum member
« on: March 08, 2007, 01:29:43 AM »

I am looking for a tool/trick/technique to detect any unused methods/functions in my C# application. It's quite a large application (Argus) and it has over 37 code files, totalling about 25000 lines of code. I want to run a tool or something to see if I have any code that is unused (never called). When I'm coding I'm in another mindstate and tend to forget to delete subs or functions I don't need anymore. I organize my code into regions and comments them, but still it's a tedious job to do this manually... Using "Find all references" has helped me already, but that's not very useful if one unused method calls another unused method and so on... Any ideas about this?
Logged

Regards,
RuffNekk

Programming is an art form that fights back.
PhilKC
Charter Member
***
Posts: 117



View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: March 08, 2007, 04:33:25 AM »

FXCop can do that, I think..
http://www.gotdotnet.com/Team/FxCop/

PhilKC
Logged

It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:
Ruffnekk
Honorary Member
**
Posts: 331



Uhm yeah...

View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: March 08, 2007, 04:37:09 AM »

And to think I already have FXCop installed  embarassed Thanks PhilKC!  tongue
Logged

Regards,
RuffNekk

Programming is an art form that fights back.
mouser
First Author
Administrator
*****
Posts: 33,181



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: March 08, 2007, 05:22:57 AM »

By the way, this is called "code coveragew" analysis in the world of program analysis/optimization/debugging, and is used often to make sure that all of the code is tested thoroughly.
Logged
Ruffnekk
Honorary Member
**
Posts: 331



Uhm yeah...

View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: March 08, 2007, 06:39:45 AM »

Thanks for the info mouser.

I'm now checking the assemblies with FxCop and so far I had over 1000 issues, which I will solve before 1.0 comes out cheesy. Good learning practice and very useful! I just hadn't thought about it before until PhilKC reminded me Wink
Logged

Regards,
RuffNekk

Programming is an art form that fights back.
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.027s | Server load: 0.05 ]