Difference between revisions of "False Positives"
(→What are False Positives) |
(→Filtering Rules) |
||
Line 16: | Line 16: | ||
This section describes different ways to handle rule sets. |
This section describes different ways to handle rule sets. |
||
− | = |
+ | =Modifying Rules= |
+ | Since Rules are what detect or filter out issues, the most common way to handle particular programming styles is to modify the rule set applied to scan a project's code. |
||
+ | |||
+ | Let's |
||
+ | |||
=Code Tags= |
=Code Tags= |
||
=Workbench Status= |
=Workbench Status= |
Revision as of 15:59, 25 August 2015
Contents
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.
Modifying Rules
Since Rules are what detect or filter out issues, the most common way to handle particular programming styles is to modify the rule set applied to scan a project's code.
Let's