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 |
CodeSonar provides a set of powerful and flexible search languages that allow searches to be as simple or as complex as required.
CodeSonar provides a family of powerful and flexible search languages: one search language for each domain. Each of these languages allows users to specify precise constraints on one or more properties in a specific search domain, and provides basic logical operators for combining multiple conditions. Searches can thus be as simple or as complex as required.
The languages are based on a common grammar, with each search domain having its own set of field-name values and sometimes other extensions as well. The exception is the code search language, which has a slightly more constrained grammar than the others.
The grammar shared by the warning, file, code, and procedure search languages is shown below. Separate sections for the individual search languages describe their extensions to the grammar (usually involving domain-specific field-name values), along with examples and usage notes.
The standard grammar for the CodeSonar Warning, File, Procedure, Metric, Analysis, Project, Warning Category, and User search languages is shown below. Literal strings are displayed in pink text.
(The Code search language has a more restricted grammar that is documented in its own section.)
Every search is a T.
T 1 : quoted-string | field-condition | ( T ) | unary T | T binary T | T T | word word 2 : (not whitespace)* quoted-string 3 : " ( word | whitespace | escape-code)* " field-condition : field-name operator condition ilike-condition 4: string-field =~~ word | string-field =~~ quoted-string imatch-condition 5 : string-field =~ word | string-field =~ quoted-string string-field : any field-name whose condition type is "word | quoted string" metric-tag : the tag of any file-granularity metric class (built-in or user-defined) on the hub field-name 6 : depends on search domain operator 7 : = | : | != condition : word | quoted-string | num-range | int-range | date-range | boolean int-range : int?..int | int..int? | int num-range : num?..num | num..num? | num date-range : date?..date | date..date? | date unary 8 : - binary 9 : & | | whitespace : space | tab | line-feed | carriage-return | form-feed | vertical-tab escape_code 10 : \\ | \' | \" | \f | \n | \r | \t | \v int : an integer num : a number date : word | quoted-string must be consistent with a date format string in the hub Date Parse Formats or Relative Date Formats list. boolean 11 : true | false false : 0 | false | f | no true : 1 | true | t | yes | word
The standard precedence rules apply.
Within T:
Within binary:
& > |
| 1 |
In queries of the form T T, the sub-terms T are implicitly combined with
& (AND):
Term1 Term2
is equivalent to
Term1 & Term2
|
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 |
A word is a whitespace-free string of characters that is
not subject to another interpretation. In particular:
|
||||||||||||||||
| 3 |
quoted-strings must be delimited
with double quotes (""): single quotes
('') cannot
be substituted. For example, 'Unused
Variable' will be treated as two words: 'Unused and Variable'.
|
||||||||||||||||
| 4 |
In ilike-condition, an
underscore ( _ ) in the pattern stands for any single character
and a percent sign ( % ) matches any sequence of zero or more
characters. (=~~ is
equivalent to the PostgreSQL ILIKE operator).
|
||||||||||||||||
| 5 |
The pattern is a POSIX regular expression. (=~ is equivalent to the
PostgreSQL ~* operator).
|
||||||||||||||||
| 6 |
See field-name sets for
individual search languages: warning, file, code, procedure, metric, analysis, project.
|
||||||||||||||||
| 7 |
Operators are interpreted as follows.
|
||||||||||||||||
| 8 |
Unary operators are interpreted as follows. As a convenience,
the search language also accepts !.
|
||||||||||||||||
| 9 |
Binary operators are interpreted as follows. As a convenience,
the search language also accepts several alternatives for each.
These operators are case sensitive.
|
||||||||||||||||
| 10 |
Escape codes are interpreted as follows.
|
||||||||||||||||
| 11 |
The following values (case-insensitive) are treated as FALSE:
0, false, f, no. All other values are
treated as TRUE.
|
To report problems with this documentation, please visit https://support.codesecure.com/.