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
 Feature Requests
 List all redundant methods?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rwomack
Junior Member

United Kingdom
15 Posts

Posted - Dec 16 2006 :  10:27:44 AM  Show Profile  Reply with Quote
It would be good if VA could list all C++ methods and functions that are not referenced in the project, so they could then be deleted from the source code to reduce the size.

Thanks,

Roger

bugfix
Tomato Guru

Germany
324 Posts

Posted - Dec 16 2006 :  12:29:53 PM  Show Profile  Reply with Quote
thats a linker task.

-bugfix

http://www.mf-sd.de
Go to Top of Page

studoot
Senior Member

35 Posts

Posted - Dec 18 2006 :  08:30:28 AM  Show Profile  Reply with Quote
I would find something like this useful as well (I was only on the forum today to post a suggestion like that!). Also, the linker only removes unused functions if you have the correct option enabled...

Additionally, if you can remove unused functions out of source files, that will cut maintenance load (code review, understanding that the function isn't used etc).

Maybe a slight modification of rwomack's idea - All symbols declared in a certain scope (e.g. file or function, selected depending on where the cursor/mouse is?) that are unused in that scope?

Stuart Dootson
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Dec 18 2006 :  09:55:05 AM  Show Profile  Reply with Quote
dead code removal aint that easy:) what happens w/ virtual functions? functions/classes in a lib/dll project? lib/dll projects e.g. might be shared w/ other solutions. there are a lot of problems doing it at source level.
just my 2 cents:)

you might want to check: http://www.gimpel.com
from features:
"find unused macros, typedef's, classes, members, declarations, etc. across the entire project (see weak definials)"

http://www.mf-sd.de

Edited by - bugfix on Dec 18 2006 10:01:18 AM
Go to Top of Page

studoot
Senior Member

35 Posts

Posted - Dec 18 2006 :  10:00:25 AM  Show Profile  Reply with Quote
The issues involved with code removal aren't really any different to those encountered (say) by renaming a function. That effectively *deletes* the old function and creates a new one and hopes to find all references to the deleted function and replace them with references to the new one...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Dec 18 2006 :  11:20:50 AM  Show Profile  Reply with Quote
Scanning for unused variables or functions is in our list of things to consider

case=2335

The current suggestion is to present the user with a list of items that VA thinks are never used, and then let the user which, if any, of these should be removed. Certainly any form of automated removal process would be very unwise.

Ultimately there is nothing stopping you running Find References on something now, and if it is never used you can delete it by hand.

We cannot stop the programmer from doing something stupid, dangerous or unwise, partly because VA is not so brilliant that it can reliably tell the difference between "good" and "bad"

zen is the art of being at one with the two'ness
Go to Top of Page

rwomack
Junior Member

United Kingdom
15 Posts

Posted - Dec 18 2006 :  11:39:27 AM  Show Profile  Reply with Quote
That sounds like a good solution. I wouldnt want it to delete them automatically.

Thanks,

Roger
Go to Top of Page

studoot
Senior Member

35 Posts

Posted - Dec 19 2006 :  02:31:05 AM  Show Profile  Reply with Quote
feline - that sounds like exactly the solution I was looking for . As you say, there's nowt to stop you using Find References (guess what - that's what I do currently when I think a function's unused). I'm just getting into the whole Refactoring menu thing and since I've started using it, I've found Find References invaluable.
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