JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
The name cross-referencing infrastructure in CodeSonar provides extensive functionality for code navigation and searching. Applications include code search, the source code information window, and a cross-reference API.
The CodeSonar cross-referencing infrastructure tracks all tokens in analyzed source code, with the following exceptions.
// Java // - 'myarr' and 'arrLen' are tracked // - 'length' is not int[] myarr = null; int arrLen = 0; // ... arrLen = myarr.length;
In the remainder of this section we first introduce some terminology, then describe the cross-referencing information computed by CodeSonar and the various mechanisms provided for accessing that information.
We use the following terminology.
The properties of an occurrence tuple are as follows.
| Name ( Code Search Language field-name, if any) |
Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Token Name | The token that is occurring. | ||||||||||||
| Kind ( kind) |
Each named entity has a kind, which categorizes it. The range of kinds associated with C and C++ programs includes type, namespace, function, variable, and so on. | ||||||||||||
| Usage ( usage) |
Each occurrence of a named entity represents some usage of that entity: for example, reading from it, writing to it, using it as an argument to sizeof(), and so on. | ||||||||||||
| File |
The source file containing
the token occurrence. The GUI and code search
language provide direct access to several File properties:
|
||||||||||||
| Line ( occ_line) |
The location in File of the token occurrence. | ||||||||||||
| Definition File |
The source file containing
the token's definition. There may be multiple corresponding
definitions, in which case there will be a separate tuple for
each definition. The GUI and code search
language provide direct access to several Definition File
properties:
|
||||||||||||
| Definition
Line ( def_line) |
The location in Definition File of the token's definition. | ||||||||||||
| Code | The contents of Line in File. |
The CodeSonar web GUI provides name cross-reference information in several contexts.
For space reasons, the CodeSonar analysis stores cross-referencing information for a project in the project analysis directory ( pfilesname.prj_files/), removing any previously-stored cross-referencing information before storing the new information. No cross-referencing information is stored on the hub.
When an analysis A is local-managed, its build directory and analysis directory are the same directory. If there is a subsequent analysis B with the same build/analysis directory, the previous files will be overwritten and the hub will only be able to interact with cross-referencing information for analysis B unless the analysis is branched or deleted, or project analysis directory for A is restored from backup.
When an analysis A is remote-managed, its analysis directory is
always unique and cannot be affected by future analyses. When such an
analysis transitions to daemon mode, the hub will be able to interact
with the cross-referencing information for analysis A even if there
have been subsequent analyses of the same project.
If you want to take advantage of this behavior, specify the -remote or -remote-archive option in your build/analysis
command.
For detailed description of the availability issues, see Procedures: Availability - the situation for cross-references is analogous.
| API: Name Cross-References |
|---|
| C and C++ Kind-Usage Pairs |
| Code Search Language |