View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.rule.stat;
5   
6   import net.sourceforge.pmd.Rule;
7   import net.sourceforge.pmd.lang.rule.properties.DoubleProperty;
8   import net.sourceforge.pmd.lang.rule.properties.IntegerProperty;
9   import net.sourceforge.pmd.stat.DataPoint;
10  
11  /**
12   * This interface tags a Rule as being a Statistical rule, producing various
13   * metrics from data points.
14   * 
15   * @see DataPoint
16   * @see Metric
17   * @see StatisticalRuleHelper
18   */
19  public interface StatisticalRule extends Rule {
20  
21      DoubleProperty SIGMA_DESCRIPTOR = new DoubleProperty("sigma", "Sigma value", 0d, 100d, null, 1.0f);
22      DoubleProperty MINIMUM_DESCRIPTOR = new DoubleProperty("minimum", "Minimum reporting threshold", 0d, 100d, null, 2.0f);
23      IntegerProperty TOP_SCORE_DESCRIPTOR = new IntegerProperty("topscore", "Top score value", 1, 100, null, 3.0f);
24  
25      void addDataPoint(DataPoint point);
26      Object[] getViolationParameters(DataPoint point);
27  }