Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Searching in Klocwork Static Code Analysis

Searching in Klocwork Static Code Analysis

This article explains how to search for detected issues in Klocwork Static Code Analysis. It also provides a list of supported search keywords.

First, you need to access the issue list:

  1. Log into Static Code Analysis, if you haven't already done so.
    You see a list of projects for which you have permissions on the current Klocwork Server host and port.
  2. For any project in the list, click the New or Open issues link.

The issue list appears, showing the current search query:

Your view affects your search results

The current view affects search results. Use the *default* view to include issues of all severities, categories and modules.

The Searches list

The Searches list is pre-populated with useful searches. Klocwork Static Code Analysis keeps a history of your text-search activity, so you can save your complex search queries. Any text you type in the text field is saved in the search history, but the name is grayed out in the list until you save it permanently. Unsuccessful queries and queries longer than 255 symbols are not saved.

You can click the icon to the left to instantly generate a report based on your search.

Use keywords or full-text searches

Use keywords, full-text search, or a combination. Full-text searches are applied to entity names, file paths, issue comments, issue codes, issue messages, owner names and bug IDs from a bug tracking system integrated with Klocwork Static Code Analysis. Searching, whether by keyword or full text, is not case sensitive.

Tips:

  • Do not insert a space after the colon that follows the keyword.
  • Multiple values for a keyword should be separated by commas, whereas multiple keywords should be separated by spaces. For example:
    code:cmp.obj,cmp.str file:cruise,outsinks owner:jlee
    If you type:
    file:foo.c moo.c noo.c
    the search engine will look for files that match "foo.c" and then do a full-text search for "moo.c" and "noo.c" in entity names, file paths, issue comments, issue codes and owner names.

Here's a list of the keywords you can use for:

  • searching issues
  • creating or updating views
  • the 'query' parameter for the search, create_view and update_view actions of the Klocwork Web API

If you enter an unrecognized keyword when searching for issues or creating a view, you'll see a warning.

Keyword Format Example
build (not supported for views) build:<build_name or build_number>
Note: You can only search by one build at a time. Other acceptable syntax:
  • build:'123' - searches for build which contains substring '123'
  • build:+123 - searches for build with name 123
  • build:+'123string' - searches for build with name equal to '123string'
Tip: You can use the build:any keyword, along with specifying state:Fixed to find issues fixed in a previous build. For example, to find a 'FNH.MUST' issue fixed in a previous build, search for build:any state:Fixed FNH.MUST.
build:build_2 or build:beta
bugId bugId:<ID_number>
Note: To use this keyword, you must integrate Static Code Analysis with your bug tracker. For more information, see Integrating bug tracking with Static Code Analysis.
bugId:15
category category:<issue_category>,<issue_category>... category:"buffer overflow"
cited cited:'<time1>'-'<time2>'
Note: Acceptable time formats are 'yyyy-mm-dd hh:mm:ss' or 'yyyy-mm-dd'. Other acceptable syntax:
  • cited:<date> - searches for status changes for the day you specify
  • cited:'<date>'-'now' - searches for status changes from the date you specify right up to the current date
  • cited:today - searches for all status changes made in the last 24 hours
  • cited:week - searches for all the status changes made in the last 7 days
  • Both the cited and citedby keywords are applicable only to issues. You must enable grouping:off to use them.
cited:'2011-10-24 07:45:30'-'2011-11-24 21:30:00' cited:2011-11-24 cited:'2011-11-24'-'now' cited:today cited:week
citedby citedby:<user_name> citedby:jsmith
code code:<issue_code>,<issue_code>... code:NPD.GEN.MUST, npd.const.call
comment comment:<"issue comment">
Note: Use quotes for expressions that contain spaces or punctuation.
comment:"check with bob on this issue"
diff (not supported for views) diff<build_1>,<build_2> diff:build_abc,build_def
entity entity:<entity_name>,<entity_name>... entity:get_file_type
file file:<filename>,<filename>... file:htmlparser
grouping (not supported for views) grouping:<'on' or 'off'> grouping:off
id id:<ID_number>,<ID_number>... id:33,59,149-160
line line:<line_number>,<line_number>... line:1-50,233
message message:<message_string> message:my_var
module module:<module_name> module:my_module
owner owner:<name or group>
Note: Searches user accounts, group accounts and the .sow file.
owner:smith,lee,devteam
recommended recommended:<'on' or 'off'>

recommended:<'true' or 'false'>

Note: The 'recommended' keyword is used to filter by SmartRank issues. 'On/True' returns SmartRank issues. 'Off/False" shows issues not meeting the SmartRank threshold. Omitting this keyword returns both. For more information, see Using SmartRank to prioritize issues.
recommended:on
reference reference:<ref_string>,<ref_string> reference:20,cast.ptr
severity severity:<severity_name or severity_number> severity:critical,4,error, 2-4
state (not supported for views) state:<state_name>,<"state name">... state:existing,fixed
status status:<status_name>,<"statusname"> status:ignore,"fix in next release"
taxonomy taxonomy:<taxonomy_name>,<"taxonomy name"> taxonomy:"MISRA C","MISRA C++"

Items you want to exclude (-)

Preceding your search criteria (either keyword or text) with a minus sign indicates that you want to exclude issues by your specified criteria, for example:

-code:abr -ANTLRParser

This query excludes from the results all issues that have the code 'ABR' and "ANTLRParser" in the entity name, path, comment, code or owner.

Klocwork does not support using the minus sign with either the comment keyword or the state keyword.

Note: You can precede a keyword with a minus sign, but not a plus-sign. Example: -code:abr is permitted, but +code:abr is not. This allows you to exclude items that are an exact match. Example:-code:+NPD.UTIL

Phrase search ("")

Use double quotes to indicate a phrase or expression that contains spaces or punctuation. For example:

comment:"needs more research"

Exact match (+)

Use the plus-sign to indicate an exact match is required for your full-text search. Example:

file:+htmlparser

Note: You can precede a keyword with a minus sign, but not a plus-sign. Example: -code:abr is permitted, but +code:abr is not.

Clearing your search results

To clear your search results, clear the text field and click Search.

The OR operator

The default search behavior is to consider all keywords or text and list those issues that match all criteria. Use OR or "|" to override this behavior. This keyword is only supported for Klocwork Code Review. For example:

PR2777 OR PR2778

The above query will return items related to PR2777 and PR2778.

If you don't see the results that you're expecting to see

Check the selected view. Try switching to the default view.