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.2p0 | CONFIDENTIAL | CodeSecure Inc |
Source code in the CodeSonar source listing and warning report pages is enriched with syntax highlighting and extensive interaction functionality. This section describes these enrichments.
Code coloring and interaction are available for analyzed
tier 1
(C, C++ and tier
2 (Java, C#) code only.
They are not available for:
Code appears in warning reports and in source listings. In both these cases, CodeSonar uses coloring to reflect program syntax, information about warnings, and other important features.
| if (x>0){ return x; } | C/C++ language keywords are displayed in bold text. |
| MACRONAME | Macro names are colored wherever they are used. Click the macro name to expand the macro definition, as described below. |
| /* comments */ | All comment text (including comment delimiters) is greyed out and italicized. |
| # preprocessed away | Any part of the file that was left out of compilation by a preprocessor directive such as #ifdef is greyed out and italicized. |
| int unreachable_func(void){return 1;} | Functions that have been identified as unreachable from the REACHABILITY_ROOTS are greyed out. If no REACHABILITY_ROOTS are specified, all functions are considered to be reachable. |
This information is also available through the GUI highlight legend.
| if (x>0){ return x; } | Java language keywords are displayed in bold text. |
| // comments | All comment text (including comment delimiters) is greyed out and italicized. |
| if (x>0){ return x; } | C# language keywords are displayed in bold text. |
| // comments | All comment text (including comment delimiters) is greyed out and italicized. |
The source code presented in the following page types is highly interactive.
| Element | Interaction | ||||||
|---|---|---|---|---|---|---|---|
| All tokens |
Hover over any token to highlight all occurrences of that token
in the source. This feature covers:
Click the token to display a menu of options. (The menus for identifiers have additional options: see below.)
|
||||||
| Identifier |
Hover over any procedure, variable, macro, or type name in the
listing to view its definition and cross-referencing
information in a information window.
Click the identifier to open a menu of options.
The menu provides the options provided for all tokens, plus additional contents as described in the following table.
|
||||||
| File names | Click any file name to navigate to the corresponding source listing. | ||||||
| Line numbers |
|
||||||
| Macros |
[C/C++ only] To expand a macro definition, click the macro name
and select Expand macro
definition from the menu that opens. Click the [hide]
link in the top right corner of the expansion box to close it,
or click the macro name a second time and deselect Expand macro definition.
|
||||||
| Tainted Values |
[C/C++ only] Tainted
values, and operations and function calls that introduce or
transfer taint, are highlighted using a scheme that supports
discrimination between different kinds of taint. You can
customize the highlighting scheme in the highlight legend: by default, tainted
values are underlined in red.
Tainted value highlighting is available when configuration file parameter TAINT_HIGHLIGHTING is set to Yes (this is the factory setting). |
The information window provides detailed information about individual code elements.
It opens the first time you hover over a suitable token name, as detailed below. Once it is open, its contents will update each time you hover over one of these elements.
The information window is available in the following page types.
| Page Types | Elements That Interact With Information Window |
|---|---|
| Tainted Value Warning Report |
Any function, variable, macro, or type name in the source excerpt. |
| Source
Listing Side By Side Source Listing |
Any function, variable, macro, or type name in the listing. |
| Analysis: Warnings
Tab Warning Cluster Warning Search Results |
Any function, variable, macro, or type name in the Line Content column of the warning table. |
| Explore Callers | Any function name in the displayed call graph. |
| Search Callers | Any function name in the result table. |
Once placed, the information window will remain in a fixed position relative to your browser window: it will not move when you scroll through the page. It will remain in this position until you resize or move it, or navigate away from the page. You can leave the information window as a floating window, or drag it against one side of your browser tab to 'dock' it.
The info tab displays a collection of cross-referencing information about a code element and its role in the analyzed software:
| Link Text | Link Destination |
|---|---|
| graphical (lite) [C/C++ code only] |
Explore Callers |
| tabular [C/C++ code only] |
Search Callers |
(For Java and C# code, this functionality is only available for elements defined in user code. Information about elements defined in the respective language runtimes is not shown.)
Display
in a Source Listing in a
new browser tab.The code tab displays a code
fragment scrolled to the definition of the code element.
(For Java and C# code, this functionality is available for
definitions in user code only. Definitions in the respective language
runtimes are not shown.)
The source code in the code tab has the same interaction and navigation functionality as described above, with two exceptions.
The highlight legend is available in the standard header of Source Listing, Warning Report, and Tainted Value pages.
To view the highlight legend:
The highlight legend will be displayed at the bottom of the browser window.
The legend is divided into three parts.
| General | Describes the syntax coloring applied to the code, along with the background coloring scheme applied to code excerpts in Warning Reports. |
|---|---|
| User | Describes the sequence of colors that will be used for user-requested token highlighting. |
| Taint [C/C++ only] |
The Taint section has a line for each taint kind
present in the code currently displayed on the page, plus a
style selector.
This section is interactive, unlike the General and User sections:
|
To report problems with this documentation, please visit https://support.codesecure.com/.