All identifier queries produce identifier lists data as their result.
Clicking on an identifier in the list will lead you to a page
like the following.
As you see, for each identifier CScout will display:
If the identifier is read-only (i.e. it appears in at least one
read-only file)
The C namespace(s) it appears in (the same identifier can be a member
of multiple namespaces)
Whether the identifier is visible at file or project scope
Whether the identifier is a typedef
(typedef's belong to the ``ordinary identifier'' namespace,
but are obviously important, so CScout will tag them as such).
Whether the identifier crosses a file boundary, i.e. it appears in
more than one file
Whether the identifier is unused i.e. it appears in exactly one location
The identifier's number of occurences in all the workspace's files
The projects the identifier appears in
The function names the identifier forms; the link
"function page" will provide you more details regarding the function
An option to substitute the identifier's name with a different name
The substitution will globally replace the identifier (or the
identifier part) in all namespaces, files, and scopes required for
the program to retain its original meaning.
No checks for name collisions are made, so ensure that the name you
specify is unique for the appropriate scope.
Performing the substitution operation will not change the identifier's
name in the current invocation of CScout.
However, once you have finished your browsing and replacing session,
you have an option to terminate CScout and write back all
the subtitutions you made to the respective source files.
Finally, the identifier's page will list the writable and all files
the specific identifier appears in.
Clicking on the ``marked source'' hyperlink will display the respective
file's source code with only the given identifier marked as a hyperlink.
By pressing your browser's tab
key you can then see where the given identifier is used.
In our example the cp.c source code
with the copy_file identifier marked
would appear as follows:
case S_IFBLK:
case S_IFCHR:
if (Rflag) {
if (copy_special(curr->fts_statp, !dne))
badcp = rval = 1;
} else {
if (copy_file(curr, dne))
badcp = rval = 1;
}
break;
case S_IFIFO:
if (Rflag) {
if (copy_fifo(curr->fts_statp, !dne))
badcp = rval = 1;
} else {
if (copy_file(curr, dne))
badcp = rval = 1;
}
break;
default:
if (copy_file(curr, dne))
badcp = rval = 1;
break;
}
Identifier Metrics
The identifier metrics page displays a summary of metrics related to
identifier use.
In our example, the metrics are as follows:
You can use these metrics to compare characteristics of different
projects, adherance to coding standards, or to identify identifier
classes with abnormally short or long names.
The ratio between the distinct number of identifiers
and the total number of identifiers is the number of times each
identifier is used.
Notice the difference in our case between the read-only identifiers
(which are mostly declarations) and the writable identifiers (which
are actually used).
All identifiers
The all identifiers page will list all the identifiers in your project in
alphabetical sequence.
In large projects this page will be huge.
Read-only identifiers
The ``read-only identifiers'' page will only list the read-only identifiers
of your project in alphabetical sequence.
These typically become part of the project through included header files.
Writable identifiers
The ``writable identifiers'' page will only list the writable identifiers
of your project in alphabetical sequence.
These are typically the identifiers your project has defined.
In large projects this page will be huge.
File-spanning writable identifiers
The ``file-spanning writable identifiers'' page will only list your
project's identifiers that span a file boundary.
Refactoring operations and coding standards typically pay higher attention
to such identifiers, since they tend occupy the project's global namespace.
In our example, the following page is generated:
The unused project-scoped writable identifiers are useful to know,
since they can pinpoint functions or variables that can be eliminated
from a workspace.
Unused file-scoped writable identifiers
The unused file-scoped writable identifiers can also
pinpoint functions or variables that can be eliminated from a file.
In our example the following list is generated:
Notice how distinct identifiers appear as separate entries.
Unused writable macros
Finally, the unused writable macros page will list macros that are not used
within a workspace.
In our case the list contains an identifier that was probably used in an
earlier version.