Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Dead code detedtion/elimination
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Jan 16 2011 :  2:51:24 PM  Show Profile  Reply with Quote
As far as I look into VAX functionality, it has all it needs to make a solid 'dead code detection and elimination'. Is there any way to make it with current version? Any automation?

Thakns...

Luke1410
Senior Member

32 Posts

Posted - Jan 17 2011 :  05:21:10 AM  Show Profile  Reply with Quote
Normally such stuff is the responsibility of a static code analysis tool --- u might wanna give one of them a try (just to name one: PC Lint from Gimpel).
Go to Top of Page

Nobodo
Tomato Guru

126 Posts

Posted - Jan 17 2011 :  11:12:17 AM  Show Profile  Reply with Quote
It is in some competing tools like Resharper and MZ-Tools, so if you don't have a tool that does dead code analysis you might want to put a recommendation in the suggestions forum here.

Using Resharper as an example... you can select colors to display dead code in, and the analysis is done in real-time as you use the IDE. I have Resharper display dead code grayed-out and with a sickly yellow background to make it obvious. It displays not only entire methods and properties that are dead code but also extremely useful items like local vars, method parameters that are not used, etc. For example, if you add a new local var to a method, it instantly displays as dead code until you add a reference to it.

Actually, there was a recommendation and discussion of this back in 2006 and again a couple of times over the next couple of years to add dead code analysis to VAX. Do a "Match exact phrase" search for:
case=2335

Edited by - Nobodo on Jan 17 2011 11:58:59 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Jan 19 2011 :  11:47:16 AM  Show Profile  Reply with Quote
As Nobodo says, this is something we are considering adding to VA at some point in time:

case=2335

For now if you have a function or variable that you suspect is unused a combination of turning on:

VA Options -> Advanced -> Refactoring -> Automatically highlight references to symbol under cursor

for local variables, and Find References for function calls should help you work out if something is currently being used or not.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000