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


Metric Search Language

The metric search language provides fine-grained control over the component search dimension of metric reports.

For searches within the scope of a focal analysis, the component search covers procedures, file instances, and compilation units. For searches in broader scopes, the component search covers only file instances and compilation units.



Component Search Domain

For searches within the scope of a focal analysis, the component search covers procedures, file instances, and compilation units. The procedures present in results will depend on procedure information availability.

For searches in broader scopes, the component search covers only file instances and compilation units.

Metric-Specific Grammar

The metric search language grammar is based on the standard CodeSonar search grammar, with domain-specific field-name values as described below. Literal strings are displayed in pink text.

field-name : adesc 
           | aid           
           | analysis           
           | directory
           | file
           | language
           | path
           | pdesc 
           | pid
           | procedure
           | project
           | ptree_path 
           | sql

field-condition terms

With the exception of procedure (which is only for procedures) and sql (which is only for files and compilation units), the field-names in the metric search language refer to properties of a source file and are applied to all three component types as shown in the following table.

for component... ...file-related field-names are applied to...
Procedure The Procedure File.
File The representative instance of the file.
Compilation Unit The root instance of the compilation unit.

The following table shows the relationship between the metric-specific field-name values and the properties of procedures and files. It also shows the expected condition types for the resulting field-conditions.

  field-name Contents Condition Type
Applied to all component types - procedures, files, and compilation units - to specify the properties of the designated file for each.
directory Directory word | quoted-string
file File word | quoted-string
language Language word | quoted-string
path File Path
word | quoted-string
Applied to procedures only.
  procedure Procedure word | quoted-string (case-sensitive)
Applied to files and compilation units only.
  adesc Instance Analysis . Analysis Description word | quoted-string
aid Instance Analysis . Analysis ID int-range; can also have the special value last.
analysis Instance Analysis . Analysis word | quoted-string
pdesc Instance Analysis . Analysis Project . Project Description word | quoted-string
pid Instance Analysis . Analysis Project . Project ID int-range
project Instance Analysis . Analysis Project . Name word | quoted-string
ptree_path Instance Analysis . Analysis Project . Project Path word | quoted-string
sql Introduces an SQL expression, as described below. word | quoted-string

word and quoted-string terms

word and quoted-string search terms are treated as follows.

Usage and Examples

The following table shows simple example queries using field-names from the metric search language.

example explanation
main Find procedures whose name contains (case-sensitive) substring main; and files and compilation units that have (case-insensitive) substring main in any field.
adesc:stable Find files and compilation units belonging to analyses whose description contains the (case-insensitive) substring stable.
aid=8 Find files and compilation units from the analysis with this Analysis ID.
analysis="tms analysis 5" Find files and compilation units from the analysis with this name.
directory:module Find files in any directory whose path (case-insensitively) includes substring module, procedures defined in these files, and compilation units whose root instance is one of these files.
file:signal Find files whose basename contains (case-insensitive) substring signal, procedures defined in these files, and compilation units whose root instance is one of these files.
language=C Find files whose language is C (not C++), procedures defined in these files, and compilation units whose root instance is one of these files.
path=/tmp/foo.c Find files with the (case-insensitive) absolute name /tmp/foo.c, procedures defined in these files, and compilation units whose root instance is one of these files.
pdesc="thingy management system" Find files and compilation units belonging to analyses of projects with this description (case-insensitively).
pid=2 Find files and compilation units belonging to analyses of the project with Project ID 2.
procedure:_handler  Find procedures whose name contains (case-sensitive) substring _handler.
project=tms Find files and compilation units belonging to analyses of the project named tms (case-insensitively).
ptree_path:/TreeX/TreeA Find files and compilation units belonging to analyses of:

SQL Terms

The sql field-name is provided to allow extra search customization in searches for files and compilation units, but is not supported. It is only available to users with G_SQL_CONSOLE permission.

See File Search Language: SQL Terms for further details.

 

To report problems with this documentation, please visit https://support.codesecure.com/.