REDU1-Identifiers never used

Top  Previous  Next

 

Identifiers never used (REDU1)

 

This is a list of all identifiers that are declared but never used. The Delphi compiler (from Delphi 2) also reports this if warnings ($W+) have been turned on during compilation. Most often, you can remove these identifiers. If you remove any identifier, make sure your code still compiles and works properly. A wise habit is to first comment out these declarations, and remove them entirely when you have validated that the code still compiles and works as intended. Also, note that if a subprogram is not used, does not necessarily indicate that it is not needed at all. If it is part of a general unit, the subprogram could very well be used in other applications.

 

Identifiers (parameters, local variables etc) related to subprograms that are not used, are not reported.

 

Constructors/destructors are not examined by this section. Also parameters to event handlers, or methods that are referenced in form files, are not reported as unused. The reason is to avoid unnecessary warnings.

 

Also unused methods of a class that are implemented through interfaces are not reported. In this case, the class must implement these methods.

 

Example:

 

clip0110

 

In this case, the parameter Sender is not reported as unused, since mnuOpen is an event handler.

 

A subset of this report is its own section. It is the REDU24 report section, which reports only local identifiers.

 

 

See also:

 

Reductions