Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 List all redundant methods?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
rwomack Posted - Dec 16 2006 : 10:27:44 AM
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.
7   L A T E S T    R E P L I E S    (Newest First)
studoot Posted - Dec 19 2006 : 02:31:05 AM
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.
rwomack Posted - Dec 18 2006 : 11:39:27 AM
That sounds like a good solution. I wouldnt want it to delete them automatically.
feline Posted - Dec 18 2006 : 11:20:50 AM
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"
studoot Posted - Dec 18 2006 : 10:00:25 AM
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...
bugfix Posted - Dec 18 2006 : 09:55:05 AM
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)"
studoot Posted - Dec 18 2006 : 08:30:28 AM
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
bugfix Posted - Dec 16 2006 : 12:29:53 PM
thats a linker task.

-bugfix

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000