|
|
Filtering Embedded String Errors via MethodsThe String Method Filters category provides another means of filtering certain strings from the embedded strings errors reports. Instead of filtering them based upon patterns they contain, this category filters strings from the report based on methods, functions or constructors into which they are passed.
Your code is likely contains many method or functions
that are passed string arguments. When you are sure that any string passed
into function For example, the Java method: javax.servlet.http.HTTPServletRequest.getParameter(String s) is in the list above, because although it takes a string argument, this string would never appear as text visible to an end user. To deselect a method filter, uncheck the box and click the Save button at the bottom of the page. To edit an existing method filter, click on its Filter Pattern hyperlink. To add a customized method filter, click the Add New button at the bottom of the page. The result from either of these two operations is that the Add/Edit String Method Filter page displays.
The Add/Edit page that displays contains three fields that are used to describe a rule: Name, Pattern, and Description. In the case of an existing Method Filter, you'll only be able to modify the Name and Description fields. Use the Name field to give your pattern a brief, meaningful name. Use the Description field to (1) enter a more indepth explanation of the pattern, (2) understand the reason for its inclusion in the scan, and/or (3) describe a process to correct the problem. The method-name rules added to this category are technically regular expressions, but Globalyzer uses internal algorithms along with the expression to determine whether strings are being passed into these methods. For this reason there are rules that must be followed when adding to the list.
Let's say you have a class
called
The pattern that you would enter in Add/Edit String Method Filter page would be:
The image above shows the complete entry for the new setKey Method Filter. Once you've added or modified a String Method Filter, click the OK button. The Method/Function Filters List redisplays, showing your changes.
In this example, the new method filter appears in the list with its checkbox selected. Click the Save button for the changes to take effect, and then the Back to Summary link to return to the Configure I18N Rule Set page.
Note: The default list of String Method Filters created for each new rule set is not a comprehensive listing of all methods within that programming langauge that take strings that aren't likely to be displayed to the end user. We have included only the more frequently used methods that we have run across in client projects and testing. These defaults - as with all Rule Set defaults - will be updated as we notice new methods that should be added. If you run across a method in the standard API for your programming language that you think should come as a default, please email the information to support@lingoport.com. Not Supported: Globalyzer does not support this category of filtering for VB, VBScript or Perl. Static HTML does not have functions, methods or constructors so you won't see this category in your HTML projects either.
|