Collection Classes Options
This section groups options that affect the way the CodeSMART Code Analyzer
detects and handles collection classes.
To change collection class detection settings:
-
In the CodeSMART main menu, select the Code Analyzer entry from the Reviews popup, or click the same button from the Other Tools toolbar to display
the Code Analyzer dialog-box (quick toolbar
and menu references are available).
-
Click on the detailed configuration link in order to display the Code Analyzer Options dialog and then activate the Collection Classes tab.
-
Check/uncheck the items that affect the analysis.
The Code Analyzer should try to detect if a class is a collection: check
this option to instruct the CodeSMART Code Analyzer to detect collection
classes. This is useful when you don't want to report unused collection class members
as dead.
Because there is no explicit way to determine that a class is a collection,
the criteria based on which the Code Analyzer will make the assumption that
a class represents a collection must be subsequently specified.
-
The class must have an 'enumerator' method (usually named 'NewEnum'):
check this option if your collection classes have a method that
adds "For Each" enumeration support. Such a method must have
a -4 DispID.
-
The class must have an 'accessor' member named: ... check this option
if your collection classes usually have a method allowing access to the collection items.
The default name for this is 'Item' and in most cases it is the default member.
-
The class may have a counter member named: ... check this option if your
collection classes usually have a member that returns the number of items
in the collection. The default identification name for this member is
Count.
-
The class may have an addition method named: ... check this option if your
collection classes usually have a method which can be used to add items to the
collection. The default identification name for this member is Add.
-
The class may have a removal method named: ... check this option if your
collection classes usually have a method to remove an item from the collection.
The default identification name for this member is Remove.
-
The class may have a collection clearing method named: ... check this option if your
collection classes usually have a method that removes all items from the collection.
The default identification name for this member is Clear.
Please note that the first two options are marked as 'must have' while the rest are marked as 'may have'.
Do not mark any of the collection class members as dead regardless if they
are used or not: if this option is checked the Code Analyzer never
reports any member from an identified collection class (according to the above criteria) as dead.
-
Click OK to make the changes permanent.
See also
Back To Top
|