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
  • Crosses file boundary: Yes
  • Unused: No
  • Matches 5 occurence(s)
  • Appears in project(s):
    • cp
  • Substitute with:

Dependent Files (Writable)

Dependent Files (All)

Main page


CScout 1.6 - 2003/06/04 15:14:51
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 identifiers1709226132
Tag for struct/union/enum213324
Member of struct/union5685310
Label00-00
Ordinary identifier1307825112
Macro274210422
Undefined macro28221232
Macro argument514215
File scope11327510
Project scope271727212
Typedef13666

Read-only Identifiers

Identifier classDistinct # idsTotal # idsAvg lengthMin lengthMax length
All identifiers208341328133
Tag for struct/union/enum301217211
Member of struct/union2964108121
Label00-00
Ordinary identifier58311447220
Macro97419069333
Undefined macro9836012327
Macro argument1703901111
File scope1034938318
Project scope4616077320
Typedef984868318

Main page


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

Contents Previous Next (Generic identifier queries)


Last change: Tuesday, June 17, 2003 1:55 pm
(C) Copyright 2000-2003 Diomidis Spinellis. May be freely viewed using web browsers and similar programs. All other rights reserved.