Identifier Elements

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.

Identifier: copy_file

  • Read-only: No
  • Tag for struct/union/enum: No
  • Member of struct/union: No
  • Label: No
  • Ordinary identifier: Yes
  • Macro: No
  • Undefined macro: No
  • Macro argument: No
  • File scope: No
  • Project scope: Yes
  • Typedef: No
  • Enumeration constant: No
  • Function: Yes
  • Crosses file boundary: Yes
  • Unused: No
  • Matches 5 occurence(s)
  • Appears in project(s):
    • cp
  • The identifier occurs (wholy or in part) in function name(s):
    1. copy_file - function page

  • Substitute with:

Dependent Files (Writable)

DirectoryFile
/vol/src/bin/cp/ cp.cmarked source
/vol/src/bin/cp/ extern.hmarked source
/vol/src/bin/cp/ utils.cmarked source

Dependent Files (All)

DirectoryFile
/vol/src/bin/cp/ cp.cmarked source
/vol/src/bin/cp/ extern.hmarked source
/vol/src/bin/cp/ utils.cmarked source

Main page - Web: Home Manual


CScout 2.0 - 2004/07/31 12:37:12
As you see, for each identifier CScout will display: 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:

Identifier Metrics

Writable Identifiers

Identifier classDistinct # idsTotal # idsAvg lengthMin lengthMax length
All identifiers1439104723.72272117
Tag for struct/union/enum10244.729
Member of struct/union567214.21429110
Label7165.2857129
Ordinary identifier114983423.51175117
Macro18512985.16216210
Undefined macro228.5611
Macro argument3069111
File scope15914935.47799217
Project scope27724426.28881212
Typedef97205.2222228
Enumeration constant00-00
Function17714556.58192317

Read-only Identifiers

Identifier classDistinct # idsTotal # idsAvg lengthMin lengthMax length
All identifiers37511806.36118
Tag for struct/union/enum5145.427
Member of struct/union56677.80357217
Label00-00
Ordinary identifier1646046.04878314
Macro1164097.47414218
Undefined macro171549415
Macro argument33831.4242414
File scope121317.25414
Project scope1524735.95395313
Typedef121317.25414
Enumeration constant00-00
Function1464495.84247310

Main page - Web: Home Manual


CScout

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:

File-spanning Writable Identifiers

Matching Identifiers

PATH_T
arg
copy_fifo
copy_file
copy_link
copy_special
fflag
iflag
netsettime
nflag
p_end
p_path
pflag
setfile
target_end
to
usage
vary
vary_append
vary_apply
vary_destroy
vflag

You can bookmark this page to save the respective query

Main page


CScout 1.6 - 2003/06/04 15:14:51

Unused project-scoped writable identifiers

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:

Unused File-scoped Writable Identifiers

Matching Identifiers

copyright
copyright
copyright
rcsid
rcsid
rcsid
rcsid

You can bookmark this page to save the respective query

Main page


CScout 1.6 - 2003/06/04 15:14:51
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.

Unused Writable Macros

Matching Identifiers

RETAINBITS

You can bookmark this page to save the respective query

Main page


CScout 1.6 - 2003/06/04 15:14:51