コード例 #1
0
  @Before
  public void setUp() {
    final ConfigRuntime conf = new ConfigRuntime();
    final PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("FunctionHintChecker");
    conf.getRules().add(pluginRule);
    final PluginMessage pluginMessage = new PluginMessage("FUNCTION_HINT_MISSING");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("Function ${variable} is missing a hint.");
    pluginRule.getMessages().add(pluginMessage);

    cfBugs = new CFLint(conf, new FunctionHintChecker());
  }
コード例 #2
0
 @Before
 public void setUp() {
   final ConfigRuntime conf = new ConfigRuntime();
   final PluginInfoRule pluginRule = new PluginInfoRule();
   pluginRule.setName("LiteralChecker");
   conf.getRules().add(pluginRule);
   final PluginMessage pluginMessage = new PluginMessage("GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN");
   pluginMessage.setSeverity("WARNING");
   LiteralChecker checker = new LiteralChecker();
   checker.setParameter("maximum", "3");
   checker.setParameter("maxWarnings", "2");
   checker.setParameter("scope", "global");
   cfBugs = new CFLint(conf, checker);
 }