Difference between revisions of "False Positives"

From Lingoport Wiki
Jump to: navigation, search
(What are False Positives)
(What are False Positives)
Line 12: Line 12:
 
Using the default Java rule sets, this code will raise i18n issues. If the <code>dateString</code> variable is user facing, this code is indeed an issue to be fixed (for more information, check your rule set help pages).
 
Using the default Java rule sets, this code will raise i18n issues. If the <code>dateString</code> variable is user facing, this code is indeed an issue to be fixed (for more information, check your rule set help pages).
   
However, if the <code>dateString</code> variable is used for internal purposes, or a log file for support, it should not be modified and is a false positive.
+
However, if the <code>dateString</code> variable is used for internal purposes, such as a in a support log file, it should not be modified and is a false positive.
   
 
This section describes different ways to handle rule sets.
 
This section describes different ways to handle rule sets.

Revision as of 15:58, 25 August 2015

What are False Positives

Globalyzer scans the source code to detect candidate issues based on rules. Given some code, a rule may detect a candidate issue. In one context, that candidate issue may need to be corrected when in another context, the same issue may not need any work and is a false positive.

Let's look at a couple of lines of Java code which creates a date string based on a hard coded date format using SimpleDateFormat:

SimpleDateFormat formatter =new SimpleDateFormat("MM/dd/yy");
String dateString = formatter.format(new Date()); 

Using the default Java rule sets, this code will raise i18n issues. If the dateString variable is user facing, this code is indeed an issue to be fixed (for more information, check your rule set help pages).

However, if the dateString variable is used for internal purposes, such as a in a support log file, it should not be modified and is a false positive.

This section describes different ways to handle rule sets.

Filtering Rules

Code Tags

Workbench Status

Dashboard

Feedback to Lingoport