Using SoftBench Static Analyzer

Simplifying Query Results

Filtering C++ Query Results

In many cases, the query results of interest are a subset of the default query results that SoftBench Static Analyzer provides. The "View: Filter Results…" command provides a way to generate this subset of query results. These filters are available in C++ SoftBench only.

For example, if you are investigating the interface of a class, you are interested only in public member functions of that class. At this point you would not be interested in viewing the private and protected member functions.

To filter the private and protected member functions:

1.Choose "View: Filter Results…", which displays the "Query Filters" dialog box.

2.Turn off the "Protected Class Members" and "Private Class Members" toggle buttons. Be sure that "Public Class Members" is set.

3.Select OK.

All query results are immediately updated so that private and protected members are not displayed. SoftBench Static Analyzer retains filtered results, but does not display them.

Using Scoping

When you select a program identifier from the Query Results Area, SoftBench Static Analyzer automatically puts it into the "Symbol ()" input box and sets the "Scoping" toggle button. After you select a query and get results, the "Scoping Used" field indicates that the identifier's location (filename, column, and line number) within the source file was used to display results only on that exact identifier in the program. The label also indicates what type of scoping was used. For example, if you select an identifier count defined in function A, only references to count in function A are displayed. Variables named count in other functions, or in the global scope, are not displayed.

If the location information should not be used, then deselect the

"Scoping" toggle button. SoftBench Static Analyzer then uses only the name in the "Symbol ()" input box and returns the results for all identifiers with that name.

Scoping is also used with queries made from Static Graphs. Scoping

268

Chapter 9

Page 268
Image 268
HP UX SoftBench Software manual Filtering C++ Query Results, Using Scoping, 268