Working with Scan Results
In this section, you will learn about the Scan Results
table.
When Globalyzer scans your code, it generates a table in the Scan
Results view. This table is saved in the local database you set up
during the Globalyzer Client installation.
Basic features of a Scan Results table include:
- show results of each individual type of issue
- show rule set changes
- sort issues
- search for common issues
- show reason for issue's default status
- display and set i18n status
These features are described next.
Show a Specific Issue Type
There are up to four issue types that Globalyzer scans for: Embedded
Strings, Locale-Sensitive Methods, General Patterns,
and Static File References. To show the scan results for
one of these types, select it from the Results dropdown.
Note that until you run a scan for the first time, the table will
be empty for all the result types. Also, to add or remove scan
types, go to the Scan=>Manage Scans..., select a Scan Name and
the Modify button. Next, navigate to the Globalyzer Scanning page for this Scan.
Then, check or uncheck Detection types. When you uncheck a
detection type, it will no longer appear in the Scan
Results dropdown.
Since your scan is configured to only search for Embedded Strings and
General Patterns, you should see only these in your dropdown. As an
exercise in familiarizing yourself with the Manage Scan Dialog further,
you may want to add Static File References detection to your scan so that your dropdown
resembles the screenshot above. You should then undo this change before continuing
with the tutorial.
Refining the HTML Include Tags Configuration
Once you complete a scan, you will often see that the results
either contain false positives (rows in the Scan Results table that are
not valid problems) or in the case of HTML scans, the results are
correct, but you would like the embedded strings to include their
surrounding style tags. To understand when you would want style
tags filtered out versus included by Globalyzer, read the HTML Scanning
section of the Globalyzer User's Guide.
Note that in the current sample code, the results contain
surrounding style-related tags, in particular, <b>
and <font> tags:
If you look at the Issue column, you'll see that many of
the entries have both a <font> tag and a <b>
tag around them in the code. Default HTML
Rule Sets are configured to include most style-related tags since
often these tags are embedded within larger, cohesive blocks of
text to emphasize individual words or phrases. In these cases, you
would want Globalyzer to pick up the entire block -- style tags
included -- and externalize it all to a resource file as a single
block of text.
If you are sure, however, that the cohesive blocks of text within
your code lie entirely between a specific style tag and you don't
want it externalized along with the strings, you would need to
modify the defaults for the Included HTML Tags list in your
Rule Set, unchecking that tag.
In our tutorial, we want <b> tags included with the
text, but <font> not included.
Click on the Project=>View Globalyzer Rule Sets menu
item or the
corresponding toolbar icon to quickly navigate to the Globalyzer
Server. Open your html Rule Set for editing.
-
Select the Configure link next to Included HTML
Tags.
-
Uncheck the font tag as shown in the partial screenshot
below.
-
Click the Done button at the bottom left of the page. This
should take you back to the Customize Rule Set page.
-
If you aren't currently working with the in-client browser then
go back to the Globalyzer Workbench.
-
Click on Project=>Reload Rule Sets within the Menu Bar.
This will cause Globalyzer to get the new rule set data from the server.
-
Click the Single Scan button to
rescan your source code using the HTML Rule Set that you just
customized.
-
You should see these results in the Issue column of your
Scan Results table:
Note: The <font> tags are no longer included
with the strings.
Sorting Issues
Now that you've customized your Rule Set to give you the properly
formatted results, let's look more closely at those results. The Results
dropdown supports the following options: Embedded Strings,
Locale-Sensitive Methods, General Patterns and Static
File References. Selecting any of them will populate the Scan
Results table with the results of that particular type of issue.
In the case of our HTML Scan there are only two entries in
the dropdown: General Patterns and Embedded Strings.
This is because these are the only Detection types checked in the
Globalyzer Scanning page of the Manage Scan Wizard.
We will discuss General Patterns later; for now let's focus
on the Embedded Strings results. One good way to analyze
results is to sort them alphabetically.
-
Click the Scan Results table header labeled Issue.
The Embedded String issues are now sorted alphabetically.
-
If you click on the header again, the table will sort in
the reverse order. Tips:
- To widen a column, hold down the left mouse button over
the column boundary and drag to the left or right.
- To see information that is obscured by narrow column
widths, place the mouse pointer over any column in a row to
display the text in a tool tip.
Searching for Issues
Another way to group items is to use the Find in Results
feature.
- Make sure the Results dropdown has Embedded
Strings selected.
Click the Scan=>Search in Scan Results... Menu bar
item, or right-click in the Scan Results view and select Find in Results...
The Search dialog appears.
- In the Search Column dropdown list,
select Issue. In the Find Text field, enter Gibson.
Select the Find All option then click Search.
All of the rows containing Gibson in the Issues
column are displayed in the Search view. Use the scrollbar as needed to see each
entry. While you can also display the Scan Results to see the found entries highlighted, you
have the same editing capabilities from the Search view; select entries, right-click and
select Globalyzer from the dropdown menu to see the available options.
Tip: You can use regular expressions in the Find
Text field of any Search dialog in Globalyzer.
Detection and Filter Reasons
The Reason column indicates why an issue was detected or
filtered. In the case of detection, the values will be either String
for embedded strings (or a Retention pattern if a filtered string
was retained), Method for locale-sensitive methods, Static
File for static file references, and the associated regular
expression in the case of general patterns. If an issue was
filtered, the Reason column will usually display the
regular expression pattern from the Rule Set's filters, or
No dictionary words, when none of the words in an
embedded string issue are found in the dictionary. Understanding
why an issue is filtered helps in fine-tuning your Rule Set's
filters.
Note: Dictionary verification can be controlled through the
Window=>Preferences Globalyzer section. By default,
Globalyzer will verify all the embedded strings against a
dictionary file. Uncheck the Filter Strings Without
Dictionary Words checkbox to disable this feature.
Display and Set I18n Status
Take a look at your latest Embedded String Scan Results. Active
issues have a priority, either 'C' to indicate string concatenation,
or a number ranging from 1 to 5, with 1 being
the highest. These priorities allow you to focus on the i18n
issues that have the highest probability of being a true issue. For
Embedded Strings, this priority is either a value configured in
the Rule Set, or it is a value determined by Globalyzer. If the
issue matches a string detection pattern, then the configured
priority is assigned to the issue. If the issue doesn't match a
string detection pattern, Globalyzer will determine the priority.
Globalyzer sets the priority by comparing the words in the string
to dictionary words and, depending on the number of words that
match and whether there are non-letters in the string, sets a
priority for the Active issue. For example, in our Java scan,
you'll notice that there are Active issues that have priorities of
1 and 2.
Now click the button in the
Scan Results view and take a look at the dropdown menu:
While All Active is the default view of the Scan Results (is checked), Globalyzer comes preconfigured with other views of the scan data.
For example, to see the issues that Globalyzer filtered, select Filtered in the dropdown. You can also create custom views of your
scan data.
Select Scan Views... from the menu.
A dialog pops up with a number of configuration
options to see results based on status and on regular
expressions. The current default view All Active displays.
Select the other saved views to see how they have been configured.
For example, the Filtered view is a good way to verify that you
haven't filtered a valid i18n issue.
To modify an existing Scan View, select it in the View Name field, make any changes,
and click Apply.
To add a new Scan View, just type a name in the View Name field, alter
the options, and click the button.
Click Apply to run the scan.
To delete an existing view, select
it in the View Name field and then click the button.
You may also want
to change the number of rows displayed on the search page from 100 to
a larger number. To do this, use the Rows per Page dropdown and
click Apply.
The number of displayed rows applies to all views, not just the currently selected one.
By default Globalyzer already has all the scan views that we will need for now, so
click Cancel to close the dialog.
The Status option is another way to group and manage your Globalyzer Scan Results.
To set the status of any issue, select one or more rows in
the table, right-click and choose one of the 4 displayed statuses: Active, Invalid,
Ignore, ToDo.
Once you switch the status, you may need to change the Scan View to
see those issues that now have a different status. For example, if you have set some issues to Ignore while
in the Active view, click and then
Ignore from the dropdown menu to see only the Ignore issues.
Note: As long as your Rule Set and source file are not
modified, Globalyzer will remember the Status options you've set.
However, if the source file changes significantly, or if you
delete your scan results, those status values will be lost. To ensure
that a previously Active status is no longer detected even
when a source file or Rule Set changes, use the Ignore
Comments feature to insert text directly in your source code. The
next time Globalyzer scans, it will skip these commented lines of
code, ignoring any i18n issues.
In the next lesson, you will learn other ways to view a subset of
the list of Active issues listed in the Scan Results
table and how to better analyze, filter and ultimately fix those
issues.
|