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 |
The CodeSonar analysis search language allows you to specify search conditions based on various analysis properties, and provides basic logical operators for combining multiple conditions. It can be used both to specify and to refine searches.
The analysis search language grammar is based on the standard CodeSonar search grammar, with several extensions:
Literal strings are displayed in pink text.
T : quoted-string | metric-condition | property-condition | ilike-condition | imatch-condition | state-condition | field-condition | ( T ) | unary T | T binary T | T T | word | none metric-condition : metric-tag ext-operator num | metric-tag operator num-range metric-tag : the tag of any analysis-granularity metric class (built-in or user-defined) on the hub property-condition : property-key operator word | property-key operator quoted-string property-key : the key of any user-assigned analysis property associated with at least one analysis on the hub state-condition : state ext-operator analysis-state | state operator analysis-state-range (see note below) ext-operator : < | <= | >= | > field-name : adesc | address | aid | analysis | dryrun | filecount | finished | install | machine | mostrecent | prjfiles | protected | pdesc | pid | project | ptree_path | started | sql | user | warningcount analysis-state-range : analysis-state?..analysis-state | analysis-state..analysis-state? | analysis-state analysis-state : "Unexpected State" | "Initialized" | "Building" | "Building over; " | "Stalled" | "Stalled" | "Linking" | "Removing Obsolete Translation Units" | "Parsing Translation Units" | "Getting Models" | "Comparing Compilations" | "Resolving Names" | "Indexing Source Files" | "Updating Old Variables" | "Computing Call Graph" | "Updating Variable Maps" | "Building Procedures" | "Updating Variables" | "Updating Variable Maps" | "Building Undefined Procedures" | "Updating Program Points" | "Compacting Program Points" | "Demangling Names" | "Updating Callers" | "Finalizing Linkage" | "Dropping Compilations" | "Indexing Cross References" | "Acquiring License Key" | "Pruning Summaries" | "Garbage Collecting" | "Enumerating Languages" | "Adjusting Call Graph" | "Building Procedure List" | "Removing Old Source Files" | "Computing Reachable Procedures" | "Analyzing Translation Units Serially" | "Topologically Sorting Procedures" | "Analyzing Translation Units" | "Analyzing Pointers" | "Computing Visualization Data" | "Analyzing" | "Refining Warnings" | "Finished" | "Finished"
The following table shows the relationship between the analysis-specific field-name values and the properties of an analysis, along with the expected type of the condition part of a field-condition.
Although state and metric-tag, and property-key are not field-name values, we include them in this table for completeness.
| field-name | Contents | Condition Type |
|---|---|---|
| adesc | Analysis Description | word | quoted-string, or special value none (*). |
| aid | Analysis ID | int-range, or special value last. |
| address | Analysis
Launch Daemon . Address Search terms are compared directly against the Address string (as displayed in the Analysis Details section of the Analysis page and available in the tables in the Analysis Search Results, Project, Project Search Results, and Home pages) - the search does not take address aliasing into account. |
word | quoted-string, or special value none (*). |
| analysis | Analysis | word | quoted-string, or special value none (*). |
| dryrun | Dry Run? | boolean |
| filecount | File Count | int-range |
| finished | Finished | date-range |
| install | Analysis Launch Daemon . Installation | word | quoted-string, or special value none (*). |
| machine | Analysis
Launch Daemon . Machine Search terms are compared directly against the Machine string (as displayed in the Analysis Details section of the Analysis page and available in the tables in the Analysis Search Results, Project, Project Search Results, and Home pages) - the search does not take name aliasing into account. |
word | quoted-string, or special value none (*). |
| metric-tag | The value of the analysis-granularity metric whose tag is metric-tag. | see metric-condition |
| mostrecent | Most Recent? | boolean |
| pdesc | Analysis Project . Project Description | word | quoted-string, or special value none (*). |
| pid | Analysis Project . Project ID | int-range |
| prjfiles | Analysis Directory . prj_files Location | word | quoted-string, or special value none (*). |
| property-key |
The value of the
user-assigned analysis property whose key is property-key. Searching for none behaves as follows.
|
word | quoted-string, or special value none (*). |
| protected | Protected? | boolean |
| project | Analysis Project . Name | word | quoted-string, or special value none (*). |
| ptree_path | Analysis Project . Project Path | word | quoted-string, or special value none (*). |
| started | Started | date-range |
| state | Analysis State (see state-condition terms, below) | see state-condition |
| user | Analysis Launch Daemon . System User | word | quoted-string, or special value none (*). |
| warningcount | Warning Count | int-range |
| sql | Introduces an SQL expression (see SQL Terms, below). | word | quoted-string |
All analysis-state values are matched exactly (but case-insensitively). One consequence is that state:X and state=X are always synonymous.
Quote marks can be omitted if the value contains no whitespace or punctuation.
All analysis-state-range sets and ext-operator results are computed with respect to the ordering shown for analysis-state. There are several cases in which different states have the same analysis-state value: state-condition terms that include any of these values are interpreted so as to minimize the matched set of states.
| state:X | All analyses whose Analysis State is X. |
| state=X | All analyses whose Analysis State is X. |
| state!=X | All analyses whose Analysis State is not X. |
| state<X | All analyses whose Analysis State has not yet reached X. |
| state<=X state<=..X |
All analyses whose Analysis State is X or earlier. |
| state>=X state>=X.. |
All analyses whose Analysis State is X or later. |
| state>X | All analyses whose Analysis State has passed X. |
| state=X..Y | All analyses whose Analysis State is between X and Y, inclusive. |
Plain text search terms—word, quoted-string, and none—are compared against a subset of the fields, with substring search:
| Example | Explanation |
|---|---|
| aid:6.. | Find analyses whose Analysis ID is 6 or higher. |
| address="::1" | Find analyses whose associated Address string is ::1 (IPv6). |
| address=127.0.0.1 | Find analyses whose associated Address string is 127.0.0.1 (IPv4). |
| adesc="Version 1.0 of the thingy management system" | Find analyses with exactly this description (case insensitively). |
| adesc=~analysis.*second | Find analysis whose description contains the substring 'analysis' and subsequently substring 'second' (case-insensitive). |
| adesc=~~this%important | Find analysis whose description starts with the substring 'this' and ends with 'important' (case-insensitive). |
| adesc:none |
Find analyses for which either of the following is true
of the analysis description.
Note that the second of these is because none is a special value. |
| analysis="tms analysis 5" | Find analyses with this name (case insensitive). |
| dryrun=true | Find analyses that were dry runs. |
| filecount:1..10 | Find analyses where the number of files analyzed was between one and ten (inclusive). |
| finished:10/2013 |
Find analyses that finished
in/on 10/2013.
The interpretation of 10/2013 depends on your Date Parse Formats setting. By default, 10/2013 is interpreted as October 2013. If you want a different interpretation, change the settings in the Content tab of the Settings page. |
| install="C:\\Program Files\\CodeSecure\\" | Find analyses performed using the CodeSonar installation located at c:\Program Files\CodeSecure (case-insensitive) on some machine. Note that backslashes must be escaped. |
| machine=alexmachine | Find analyses carried out on a machine named alexmachine. |
| mostrecent=true | Find analyses that are the most recent ones carried out on their respective projects. |
| myProperty:"urgent" | Find analyses that have user-assigned property with key myProperty and value containing (case-insensitive) substring urgent. |
| myProperty:none |
If no analysis on the hub has a user-assigned property with key
myProperty, the result set is
empty. Otherwise, find analyses for which any of the following are true.
|
| pdesc="thingy management system" | Find analyses of projects with exactly this description (case-insensitive). |
| pid=2 | Find analyses of the project with Project ID 2. |
| prjfiles:/u/csonaranalyses/ | Find analyses for which /u/csonaranalyses/ (case-insensitive) occurs in the absolute path to the analysis directory. |
| project=tms | Find analyses of the project named tms (case-insensitive). |
| protected=true | Find analyses that are currently protected from auto-deletion. |
| ptree_path:/TreeX/TreeA |
Find analyses of:
|
| started:"last 2 weeks" | Find analyses that started between two weeks ago and now. Two weeks ago is defined to be 2*7*24*60*60 seconds ago. |
| state>"Building" | Find analyses that have progressed beyond the Building state. |
| user=lindsay | Find analyses performed by username lindsay. |
| warningcount:..50 | Find analyses that issued fifty warnings or fewer . |
The sql field-name is provided to allow extra search customization, but is not supported. It is only available to users with G_SQL_CONSOLE permission.
For a search that includes a field-condition of the form
CodeSonar will obtain search results by executing an SQL statement of the form
SELECT <your specified columns>
FROM <CodeSonar-determined relation>
WHERE <other-terms1 OP1> cond <OP2 other-terms2>
ORDER BY <your specified order>
where
| <your specified columns> | Depends on the set of columns you have chosen to display in the search result table. |
|---|---|
| <CodeSonar-determined relation> | Depends on <your specified columns> and <other-terms1,2> but will be either cs_analysis or a join of cs_analysis and one or more other relations. |
| <other-terms1,2>, <OP1,2> | Depend on the other terms (specified or implicit) in your search, and the operators used to combine them. |
| cond | Is a Boolean expression suitable for evaluation in the WHERE clause of this query. |
| your specified order | Depends on the sort order(s) you have imposed on the search result table. |
To report problems with this documentation, please visit https://support.codesecure.com/.