Add code analysis
Brought to you by:
anthonysteele
Please add some code analysis options. I'm sure the
follwoing options would be very appreciated by all users;
- obsolete functions / procedure (not used anywhere in
the source)
- obsolete variables
- obsolete units
Perhaps other items are also possible, but this is what
comes to mind now.
It could be that this would require a branch-off of the
current app. as the scope could be somewhat different.
Logged In: YES
user_id=66544
There is a delphi unused units tool here:
http://opedit.home.att.net/oeunusedunits.htm
It works complete differently to this formatter. It does a
build with all debug info options on, and uses the compiler
output files. But it works well with a minimum of fuss.
Logged In: YES
user_id=66544
For obsolete units, there is a nice utility called OPX
(http://opedit.home.att.net/opxperts.htm) which I have used
witn success. Removing these unused units can in some cases
make your program compile much faster. OPX works nothing
like the code formatter - it actually does an automated
build with detailed debug output flags turned on, then
analyses the sybol files.
There's also one called Icarus - http://www.peganza.com/
which I think will also tell you when a unit declaration can
be moved down to the implementation section.
I can't see the code formatter doing this kind of thing - it
just doesn't have the necessary information.
I have recently done something like obsolete variables, for
the case of procedure params not used in the procedure body.
Delphi does not do this. Delphi does report unused local
vars, so ther'es no point putting that into JCF. It may be
worth looking into vars and constants that are
declared in the implementation section of a unit and not
referenced after.