User's Guide

Filtering Embedded String Errors via Statements

String Statement Filters, supported in statement oriented languages only (such as Java, JavaScript, C#, etc), provide another means of filtering certain strings from the embedded strings errors reports. If Globalyzer detects a string literal within the same statement as one of the patterns defined, that string will be excluded from the Embedded String Scan Results.

For example, in the following code snippet, if two is a String Statement Filter:

    
            if (myString.indexOf("title") !=-1) {
                two="these three string " + 
                     "literals " + 
                     "will all be filtered";  
            }
    		

The strings "these three string ", "literals ", and "will all be filtered" will be filtered due to the String Statement Filter with two as the pattern.

The Inherited column lists the name of the Rule Set that defined the string statement filter. A value of 'No' indicates that the filter is local to the Rule Set. Local filters can be modified and/or deleted. Inherited filters can be overridden.

To disable a local string statement filter, uncheck the box.

To create a filter, select the New String Statement Filter link at the top of the page. This displays the Create String Statement Filter form, shown below.

The page contains six fields used to describe a rule: Name, Pattern, Description, Category, Help Page, and Enabled.

Use the Name field to give your filter a brief, meaningful name.

The Pattern field must contain a valid Regular Expression. For more information on Regular Expression syntax, click here.

Use the Description field to explain why this string can be filtered.

Use the Category field to set a category that can be enabled or disabled in bulk for a ruleset.

The Help Page field is where you can provide a URL link for the filter. This link may provide more information on the filter.

The Enabled field determines whether the filter is processed by Globalyzer (checked) or ignored by Globalyzer for now (unchecked).

Once you've provided the string statement filter information, click the Create button. The Edit String Statement Filters list redisplays, showing your changes.

If a string statement filter is local to the Rule Set, it can be modified and/or deleted. Click on its name hyperlink from the Edit String Method Filters list. This displays the Edit String Method Filter page, shown below. All fields are modifiable. Press Update to save any changes. Press Delete to delete the filter. After updating or deleting, the Edit String Method Filters list redisplays, showing your changes.

If a string statement filter inherited, it can be overridden. Maybe you want to disable the inherited filter in your Rule Set. Click on its name hyperlink from the Edit String Method Filters list. This displays the Override String Method Filter page, shown below. All fields are modifiable, but if you change the pattern field, you will end up creating an entirely new filter, rather than overriding the inherited one. Press Create to create the override string statement filter. After creating, the Edit String Statement Filters list redisplays, showing your local filter.

To return to the Customize Rule Set page, select the Back to Summary link.

 Configuring Rule Sets