Filtering Embedded String Errors via Line PatternsString Line Filters provide a way to filter strings from the embedded strings errors reports based on patterns that are detected in the line of code that the string is found. Specifically, these filter rules tell Globalyzer that if an embedded string is detected in a line of code that contains one of the selected regular expressions, then ignore it; it doesn't need to be externalized so it shouldn't be listed as an error in the Results Table or summary reports. For example, suppose you have several strings defined that are used only in conditionally compiled debug code: String szName = "Name"; // Debug Since these are all common words, it would be difficult to eliminate them from the embedded string report using String Content Filters. However, since each line of code also contains the comment Debug, we can add that shared pattern to the String Line Filters list. Now, when Globalyzer scans for string literals, it will find a matching pattern in the String Line Filters list for these four lines, and thus filter the four string literals from the embedded string report. The following shows the default string line filters for VB. The Inherited column lists the name of the Rule Set that defined the string line 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 line filter, uncheck the box. To create a new filter, select the New String Line Filter link at the top of the page. This displays the Create String Line Filter form, shown below. The page contains five fields used to describe a rule: Name, Pattern, Description, 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 line filter information, click the Create button. The Edit String Line Filters list redisplays, showing your changes. If a string line filter is local to the Rule Set, it can be modified and/or deleted. Click on its name hyperlink from the Edit String Line Filters list. This displays the Edit String Line Filter page, shown below. All fields are modifiable. Press Update to save any changes. Press Delete to delete the string line filter. After updating or deleting, the Edit String Line Filters list redisplays, showing your changes. If a string line filter is 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 Line Filters list. This displays the Override String Line 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 line filter. After creating, the Edit String Line Filters list redisplays, showing your local filter. To return to the Customize Rule Set page, select the Back to Summary link. |