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 |
| Warning Classes | There are a number of new warning classes in this release, including several classes that address concurrency issues such as data races. |
|---|---|
| Name Cross-References | A new cross-referencing infrastructure tracks tokens in analyzed source code. |
| Metrics | The CodeSonar analysis now computes and reports software metrics. |
| Expanded Search Functionality | Users can now search for warnings, files, code, procedures, or metrics. |
| Multi-Process Hub | The CodeSonar hub now uses separate processes to serve concurrent requests, rather than a single process. |
| Native 64-Bit Support | All 64-bit packages now contain native 64-bit executables. |
| Improved VC++ Compatibility | Improved compatibility with recent versions of VC++. |
| GUI Changes | There are a number of GUI changes, including layout improvements along with changes arising from increased functionality in search, metrics, and cross-referencing. |
| Plug-in API | Substantial changes, including access to new metric-related functionality. |
| General-Purpose API | Substantial changes, including access to new name cross-reference functionality. |
| AST Changes | This release has improved C++11 compatibility; there are substantial changes to the C/C++ AST definitions. |
For full, current requirements, see CodeSonar System Requirements.
The Installation manual section provides instructions for installing CodeSonar.
The Windows installer
This release uses CWE v 1.12.
The majority of new warning classes in this release are in support of the JPL Institutional Coding Standard for the C Programming Language, some of the new classes are specifically concerned with concurrency issues, and some are both.
The following table lists the new warning classes in this release and indicates for each class whether it supports JPL and/or concurrency-related checking.
| Class Name | Mnemonic | Change |
|---|---|---|
| Function Pointer | LANG.STRUCT.FUNCPTR.CALL | Mnemonic was previously LANG.STRUCT.FUNCPOINT. |
| Potential Unbounded Loop | LANG.STRUCT.ULOOP | The check has been modified: a loop is now considered unbounded if its bound is not statically determinable (previously, the bound only had to be constant). |
| Unchecked Parameter Dereference | LANG.STRUCT.UPD | The check has been modified: the parameter can now be checked at any point before the dereference (previously, the check had to be inside the function). |
A new cross-referencing infrastructure tracks tokens in analyzed source code, providing extensive functionality for code navigation and searching. In particular:
The CodeSonar analysis now computes and reports software metrics.
This version of CodeSonar includes greatly expanded search functionality. In particular, users can now search over five different domains, where previously the only search domain was warnings (and, in restricted circumstances, files). The following table summarizes the five domains.
| domain | search results are... | ...each linked to |
|---|---|---|
| Warnings | Warnings | A Warning Report. |
| Files | Source file instances | A Source Listing. |
| Code | Occurrences of non-keyword tokens | The corresponding line in a Source Listing. |
| Procedures | Procedures | The procedure definition in a Source Listing. |
| Metrics | Code components for which metric values will be reported, plus the corresponding metric values. | The relevant code component. For file-granularity metrics, this is the file's Source Listing. For procedure-granularity metrics, it is the procedure definition (within a Source Listing). |
With this expansion in functionality:
The behavior of the file search language has changed slightly: plain text terms are now only compared against file basename (previously they compared against a broader set of file properties).
The CodeSonar hub now uses separate processes to serve concurrent requests, rather than a single process.
All 64-bit packages now contain native 64-bit executables.
Compatibility with recent versions of VC++ has been improved.
There are a number of GUI changes in this version of CodeSonar.
In addition to the changes to individual page types outlined below, there are some changes to the standard GUI header that arise from the newly extended search capabilities.
| Code Search Results | Presents the results of a search in the code domain (new functionality). |
| Metric Report | Presents the results of a search in the metric domain (new functionality). |
| Metric Report Creation | Allows the user to specify which metrics should appear in a metric report. |
| Procedure Search Results | Presents the results of a search in the procedure domain (new functionality). |
| Scheme Console | When enabled for a particular analysis, provides access to an interactive Scheme interpreter running within the analysis process. |
| Undefined Functions Report | A hub-wide report lists the undefined functions encountered by the most recent analyses on the hub. An analysis-level report is available for each analysis that encounters one or more undefined functions. |
| Admin Settings |
|
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Advanced Search |
The page is now tabbed, with a separate tab for each search
domain.
|
||||||||||
| Analysis |
The page is now tabbed, and information about the analysis is
no longer displayed by default.
|
||||||||||
| Analysis Files | The information is now presented as a tab of the Analysis page (with the same URL as previously) | ||||||||||
| Charts and Chart Tables |
Metric values can now be charted, along with warning counts and file counts as previously. | ||||||||||
| Home | The table of projects has additional columns corresponding to analysis-granularity metrics that have been computed. | ||||||||||
| Saved Searches | (Previously called "Deleted Saved Searches".) The page is now tabbed, with a separate tab for each search domain. |
||||||||||
| Source Listing | Information about the file and analysis is no longer displayed by default. Instead, it can be expanded or collapsed as required. The information window has a new info tab, providing enhanced cross-referencing information. | ||||||||||
| Warning Report |
The upper part of the page has been substantially reorganized.
|
||||||||||
| Warning Search Results | Previously called "Search Results": there are now multiple search domains, each with its own result page type. |
The Server Utilization page type no longer exists.
There have been substantial additions to the CodeSonar Plug-In API, along with some modifications to existing functions and types.
| New Functions | New functions provide access to the new metric functionality in this release. There are also some new kinds of program visitor and some new ways to report warnings. |
|---|---|
| Modified Functions | Some parameters have changed to more specific types. Visitors now all take an additional context parameter. |
| Modified Types | Function pointers used for visitors now all take an additional context parameter. Some typedefs and struct fields have changed to more specific types. |
| C function | Scheme Function | Notes |
|---|---|---|
| csonar_add_program_drop_finish_visitor() | codesonar:add-program-drop-finish-visitor | Add a program visitor to be invoked at the end of the drop phase (as opposed to program drop visitors, which are invoked at the beginning of the drop phase). |
| csonar_add_cache_cleanup_visitor() | codesonar:add-cache-cleanup-visitor | Invoked periodically as the analysis progresses. |
| csonar_warningclass_lookup() | - | Get the warning class with the specified ID. |
| csonar_warningclass_id() | - | Get the ID for the specified warning class. |
| csonar_report_file_warning() | codesonar:report-file-warning | Issue a warning associated with a particular source file instance, as opposed to a specific source location or set of locations. |
| csonar_report_analysis_warning() | codesonar:report-analysis-warning | Issue a warning with no association to a file or procedure. |
| codesonar:report-metric | Report a metric value to the hub. | |
| csonar_metric_get_granularity() | codesonar:metric-granularity | Get the granularity of a metric class. |
| csonar_metric_name() | codesonar:metric-name | Get the short name of a metric class. |
| csonar_metric_description() | codesonar:metric-description | Get the description of a metric class |
| codesonar:metric-get-value | Get the value of a metric | |
| codesonar:metric-create-class | Create a new metric class | |
| csonar_metric_get_class() | codesonar:metric-get-class | Get the metric class object with the specified name and granularity. |
| csonar_get_metric_from_cs_metric() | - | Get the metric class corresponding to a specified CodeSurfer metric. |
| csonar_get_cs_metric_from_metric() | - | Get the CodeSurfer metric corresponding to a specified metric class. |
| codesonar:metric-get-all-classes | Iterate over the metric classes of a specified granularity. | |
| codesonar-metric-retract | Retract a metric value. |
| type | Notes | |
|---|---|---|
| C | ||
| enum cs_cfg_path_node_flags | New elements cscpnf_contributes, cscpnf_new_path. | |
| enum cs_xform_query_result | New element csxqr_redundant_suspect. | |
| struct cs_access_path_struct | variant_union.offset_in_bits field type now cs_size_t (previously cs_integer) | |
| struct cs_step_visitor_dispatch_t | open, copy, close and transition members now all take an additional context parameter ctx. | |
| struct cs_warning_id | pid field type now
csint64 (previously cs_integer). wid field type now csunit64 (previously unsigned long). |
|
| struct cs_xform_expr | a and b field type now both csint32 (previously cs_integer) | |
| Context parameter ctx added to function pointer type. | ||
| Scheme | ||
| LOCATIONS_NODE_FLAG | renamed from LOCATIONS_FLAG | |
| PATH_NODE_FLAG | renamed from PATH_FLAG, new elements "contributes", "new-path" | |
| REPORT_FLAG | renamed from POINT_FLAG | |
| XFORM_QUERY_RESULT | new element "redundant-suspect" | |
There have been substantial additions to the General-Purpose API, along with some modifications to existing functions and types.
| New Functions |
|
|---|---|
| Modified Functions | A number of functions have modified type signatures: parameters or return values have changed to more specific types. |
| Deleted Functions | 8 functions have been deleted in this release. |
| Modified Types | A number of typedefs and struct fields have changed to more specific types. |
| C function | Scheme Function | Notes |
|---|---|---|
| Name Cross-References | ||
| xref-kinds | Operations on kinds. | |
| xref-roles | Operations on roles (usages). | |
|
Operations on kind-role (kind-usage) pairs. | |
| xref-def-for-each | Iterate over the definitions associated with the specified occurrence. | |
| xref-occ-for-each | Iterate over the occurrences with the specified properties. | |
| xref-intra-def-for-each | Iterate over the occurrences in a specified code region. | |
| xref-namehash | Hash functions. | |
| cs_xref_query_execute() | xref-query | Execute a query over all token occurrences. |
| Metrics | ||
|
metric-create | Create a new metric class. |
| cs_metric_create_derived() | metric-create-derived | Create derived metrics. |
| cs_metric_description() | metric-description | Get the description for a metric class. |
| cs_metric_equal() | - | Compare two cs_metrics. |
| cs_metric_from_refstring() | metric-from-refstring | Look up a metric class via a string that contains both the name and granularity. |
|
metric-get-value | Retrieve the value of a metric. |
| cs_metric_get() | metric-get | Get the metric class object with the specified name and granularity. |
| cs_metric_get_granularity() | metric-granularity | Get the granularity for a metric class. |
| cs_metric_granularity_from_string() | string->metric-granularity | Convert a string representation into a metric granularity. |
| cs_metric_granularity_name() | metric-granularity->string | Get the string representation of a metric granularity. |
| cs_metric_hash() | - | Hash function for cs_metric. |
|
metric-get-all | Iterate over the metric classes of a specified granularity. |
| cs_metric_name() | metric-name | Get the short name for a metric class. |
| cs_metric_register_file_closure() | - | Set the function which should be used to determine whether to compute metrics for a given file instance. |
| ABS_LOC | ||
| cs_abs_loc_func_attrs() | abs-loc-func-attrs | Get the attributes associated with a function ABS_LOC |
| cs_abs_loc_var_attrs() | abs-loc-var-attrs | Get the attributes associated with a non-function ABS_LOC. |
| PDG | ||
| cs_edge_label_compare() | - | Compare two edge labels |
| cs_pdg_friendly_name64() | - | Like cs_pdg_friendly_name(), but provides a cs_const_str64 (always 64-bit) rather than a cs_string (width is system-dependent). |
| cs_pdg_callers_count() | pdg-callers-count | Get the number of call sites to a PDG. |
| cs_pdg_has_incomplete_summary() | pdg-has-incomplete-summary? | Check if summary edge information may be incomplete for a PDG. |
| cs_pdg_scc_id() | pdg-scc-id | Get the a list of the strongly connected components to which a PDG belongs |
| PDG_VERTEX | ||
| cs_pdg_vertex_hash_seed() | - | Hash function for PDG_VERTEX. |
| SDG | ||
| cs_s_unload_sdg() | s-unload-sdg | Close the currently loaded SDG. |
| cs_sdg_is_read_only() | sdg-read-only? | Check: is the current project read-only? |
| Source Files | ||
| cs_file_color_map_iter_scan_first() | - | Open a cs_color_map_iter iterator that skips the first part of a file instance. |
| cs_file_compiler_model() | file-compiler-model | Get the name of the compiler model used to build a compilation unit. |
| cs_file_effective_native_flags() | file-effective-native-flags | Get the effective flags used to build a compilation unit. |
| cs_file_frontend_command_line() | file-frontend-command-line | Get the front end command line used to build a compilation unit. |
| cs_file_get_include_name64() | - | Get the absolute path name for a source file instance. |
| cs_file_native_command_line() | file-native-command-line | Get the native command line used to build a compilation unit. |
| cs_file_path_hash64() | file-path-hash64 | 64-bit hash for file path. |
| cs_file_webid() | file-webid | Get the Web ID of a compilation unit |
| cs_sf_line_pdgs() | file-sf-line-pdgs | Get a list of the PDGs whose definition is at the specified source file and line number. |
| cs_sfid_sf() | sfid->sf | Get the source file corresponding to a specified file instance. |
| cs_sf_arbitrary_sfid() | sf->arbitrary-sfid | Get an (arbitrary) instance of a specified source file |
| sf-for-each-sfid | Iterate over the instances of a source file | |
|
Basic operations on new "source file" data type. | |
| cs_uid_is_shared_unit() | uid-is-shared-unit? | Check: can a compilation unit be shared by multiple projects and analyses? |
| cs_uid_is_valid() | uid-is-valid? | Validity test for a compilation unit ID. |
| cs_uid_to_integer() | - | Convert compilation unit ID to a csuint32. |
| cs_uid_unitline_to_sf_line() | uid-unitline->sf-line | Translate a line number in a preprocessed compilation unit to the unpreprocessed source file and line number it came from. |
| Function | Changed | New Type | Previously |
|---|---|---|---|
| cs_abs_loc_compare() | return value | int | cs_integer |
| cs_abs_loc_get_param() | num parameter | cs_size_t | cs_integer |
| cs_abs_loc_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_abs_loc_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_ast_compare() | return value | int | cs_integer |
| cs_ast_create() | num_fields parameter | cs_size_t | cs_integer |
| cs_ast_dump( ) | attribute_depth parameter | cs_size_t | cs_integer |
| cs_ast_fast_compare() | return value | int | cs_integer |
| cs_basic_block_cfg_edge_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_basic_block_compare() | return value | int | cs_integer |
| cs_basic_block_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_basic_block_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_cfg_edge_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_cfg_edge_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_exit() | code parameter | int | cs_integer |
| cs_f_pred() | threshold parameter | cs_size_t | cs_integer |
| cs_f_succ() | threshold parameter | cs_size_t | cs_integer |
| cs_file_count_lines() | blank_count, comment_count, code count, mixed_count parameters | cs_size_t* | cs_integer* |
| cs_file_error_count() | num_errors parameter | cs_size_t* | cs_integer* |
| cs_file_warning_count() | num_warnings parameter | cs_size_t* | cs_integer* |
| cs_get_interest_sets() | result_cardinality parameter | cs_size_t* | cs_integer* |
| cs_int_pair_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_int_pair_set_delete() | int1 and int2 parameters | csuint32 | cs_unsigned integer |
| cs_int_pair_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_int_pair_set_member() | int1 and int2 parameters | csuint32 | cs_unsigned integer |
| cs_int_pair_set_put() | int1 and int2 parameters | csuint32 | cs_unsigned integer |
| cs_ips_to_pdgvs_map_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_ips_to_pdgvs_map_lookup() | integer1 and integer2 parameters | csuint32 | cs_unsigned integer) |
| cs_labeled_pdg_edge_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_labeled_pdg_edge_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_list_to_abs_loc_set() | cardinality parameter | cs_size_t | cs_integer |
| cs_list_to_pdg_vertex_set() | cardinality parameter | cs_size_t | cs_integer |
| cs_major_version() | return value | int | cs_integer |
| cs_minor_version() | return value | int | cs_integer |
| cs_patch_version() | return value | int | cs_integer |
| cs_pdg_compare() | return value | int | cs_integer |
| cs_pdg_exceptional_exits() | result_cardinality parameter | cs_size_t* | cs_integer* |
| cs_pdg_formal_in() | fi_rank parameter | cs_size_t | cs_integer |
| cs_pdg_procedure_id() | return value | csint64 | cs_integer |
| cs_pdg_retrieve_basic_block() | id parameter | csint64 | cs_integer |
| cs_pdg_retrieve_vertex() | id parameter | csint64 | cs_integer |
| cs_pdg_set_formals_in() | cardinality parameter | cs_size_t | cs_integer |
| cs_pdg_vertex_compare() | return value | int | cs_integer |
| cs_pdg_vertex_condition_number() | return value | csuint64 | cs_integer |
| cs_pdg_vertex_exceptional_returns() | result_cardinality parameter | cs_size_t* | cs_integer* |
| cs_pdg_vertex_id() | return value | csint64 | cs_integer |
| cs_pdg_vertex_rank() | out parameter | cs_size_t* | cs_integer* |
| cs_pdg_vertex_set_actual_outs() | num_vertices parameter | cs_size_t | cs_integer |
| cs_pdg_vertex_set_actual_ins() | num_vertices parameter | cs_size_t | cs_integer |
| cs_pdg_vertex_set_cardinality() | return value | cs_size_t | cs_integer |
| cs_pdg_vertex_set_get_outstanding_references() | return value | cs_size_t | cs_integer |
| cs_pdg_vertex_set_intersect_size() | out_set parameter | cs_size_t* | cs_integer* |
| cs_pdg_vertex_set_multi_union() | list_cardinality parameter | cs_size_t | cs_integer |
| cs_s_predecessors() | threshold parameter | cs_size_t | cs_integer |
| cs_s_successors() | threshold parameter | cs_size_t | cs_integer |
| cs_s_read_sdg() | new parameter read_only | ||
| cs_s_var_predecessors() | threshold parameter | cs_size_t | cs_integer |
| cs_s_var_successors() | threshold parameter | cs_size_t | cs_integer |
| cs_sdg_compilation_units() | result_cardinality parameter | cs_size_t* | cs_integer* |
| cs_sdg_error_count() | out_i parameter | cs_size_t* | cs_integer* |
| cs_sdg_sccs() | result_cardinality parameter | cs_size_t* | cs_integer* |
| cs_set_interest_sets() | cardinality parameter | cs_size_t | cs_integer |
| cs_sfid_compare() | return value | int | cs_integer |
| cs_uid_compare() | return value | int | cs_integer |
| C function | Scheme Function | Notes |
|---|---|---|
| cs_uid_to_cs_integer() | - | Replaced by cs_uid_to_integer(). |
| cs_file_content_hash() | - | - |
| cs_file_get_modification_time() | file-get-modification-time | - |
| cs_file_path_hash_double() | - | Replaced by cs_file_path_hash64(). |
| cs_tokdef_kind_name() cs_file_tokdef_iter_first() cs_file_tokdef_iter_next() cs_file_tokdef_iter_close() |
file-tokdef-for-each | Replaced by richer operations in the new Name Cross-References API. |
| Type | Change |
|---|---|
| enum cs_syntax_kind | New enum values added: cs_syntax_kind_string, cs_syntax_kind_include_directive. |
| typedef cs_ast | Type now csint32 (previously long). |
| typedef cs_ast_family | Type now csint32 (previously long). |
| struct cs_uid_pdgvslist | npdgs field type now cs_size_t (previously cs_integer). |
| struct cs_pdglist_pair | n_sublist_elements field type now cs_size_t (previously int). |
| struct cs_sdg_uids_iter | data field type now
cs_size_t[2] (previously
cs_integer[2]). state field type now int (previously cs_integer). |
| typedef cs_column | Type now csuint16 (previously unsigned short). |
| typedef cs_line | Type now csuint32 (previously unsigned long). |
| typedef cs_uid | Type now csuint32 (previously cs_integer). |
| typedef cs_unitline | Type now csuint32 (previously cs_integer). |
There are substantial changes to the C/C++ AST definitions in this release.
The following unnormalized AST classes have been added.
| attributes | |
|---|---|
| dot expressions | |
| function calls | |
| generic shift | |
| generic shift-assign | |
| pragmas | |
| scope | |
| sizeof | |
| templates | |
| type adjustment and casting | |
| type traits |
|
| misc |
The following classes have undergone field changes. Changes can include adding a field, removing a field, or changing a field from child to attribute or from attribute to child. See the class documentation for field details.
The immediate superclass for the following classes has changed.
| Classes | Immediate Superclass is Now | (was previously) |
|---|---|---|
|
cc:type-traits-builtin-operation | cc:microsoft-builtin-operation |
| cc:is-union | cc:builtin-operation | cc:microsoft-builtin-operation |
| cc:sizeof | cc:expr | |
| cc:executable-scope | cc:scope | |
| cc:non-executable-scope | cc:scope |
The following unnormalized AST classes have been removed. An asterisk "*" next to an entry in the "Used Instead" column denotes an AST class introduced in this release (see new normalized classes, new unnormalized classes).
| Classes Removed | Used Instead | |
|---|---|---|
| unary - |
|
cc:generic-negate |
| ++ |
|
cc:generic-pre-incr |
|
cc:generic-post-incr | |
| -- |
|
cc:generic-pre-decr |
|
cc:generic-post-decr | |
| + |
|
cc:generic-add |
| - |
|
cc:generic-subtract |
| * |
|
cc:generic-multiply |
| / |
|
cc:generic-divide |
| == |
|
cc:generic-eq |
| != |
|
cc:generic-ne |
| > |
|
cc:generic-gt |
| < |
|
cc:generic-lt |
| >= |
|
cc:generic-ge |
| <= |
|
cc:generic-le |
| << |
|
cc:generic-shiftl * |
| >> |
|
cc:generic-shiftr * |
| <? |
|
cc:generic-gnu-min |
| >? |
|
cc:generic-gnu-max |
| = |
|
cc:generic-assign |
| += |
|
cc:generic-add-assign |
| -= |
|
cc:generic-subtract-assign |
| *= |
|
cc:generic-multiply-assign |
| /= |
|
cc:generic-divide-assign |
| <<= |
|
cc:generic-shiftl-assign * |
| >>= |
|
cc:generic-shiftr-assign * |
| dot expressions |
|
cc:dot-field * |
|
cc:dot-static * | |
|
cc:pm-points-to-field * | |
|
||
| casts |
|
cc:cast (or subclasses) |
| function calls |
|
cc:function-call |
|
||
|
||
|
||
| misc |
|
Initializations are now under the variable. |
|
No direct replacement. | |
|
cc:real-part | |
|
cc:imag-part | |
|
cc:subscript | |
|
cc:expr-routine * | |
|
cc:switch-case * | |
|
cc:address-op |
The following normalized AST classes have been added.
The following classes have undergone field changes. Changes can include adding a field, removing a field, or changing a field from child to attribute or from attribute to child. See the class documentation for field details.
| 6675 | Leak report location |
| 6684 | 'rank' WARNING_FILTER mostly useless |
| 6916 | Redundant text in warning endbox |
| 6994 | Fixed buffer overrun on global remains in later increments |
| 7080 | More helpful create account failure error |
| 7137 | WriteFile always initializes lpNumberOfBytesWritten |
| 7154 | Change multiple warnings emails every user on the hub |
| 7172 | FUNCTION_MAP doesn't work for malloc, free |
| 7217 | Correction shows even for licenses with no line limit |
| 7236 | Plug-in crash from use of cs_ast_ordinal_name() |
| 7250 | Right-click on column header should bring up menu |
| 7461 | Hub exception: Incorrect padding |
| 7587 | Add option to detect leak of allocated memory after use in loop |
| 7692 | _M_check_len() |