use of com.cflint.plugins.core.FunctionXChecker in project CFLint by cflint.
the class TestWriteDumpChecker method setUp.
@Before
public void setUp() throws Exception {
final CFLintConfig conf = new CFLintConfig();
final PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("WriteDumpChecker");
pluginRule.setClassName("FunctionXChecker");
pluginRule.addParameter("functionName", "writedump");
conf.getRules().add(pluginRule);
final PluginMessage pluginMessage = new PluginMessage("AVOID_USING_WRITEDUMP");
pluginMessage.setSeverity("INFO");
pluginMessage.setMessageText("Avoid using the ${functionName} function in production code.");
pluginRule.getMessages().add(pluginMessage);
FunctionXChecker checker = new FunctionXChecker();
checker.setParameter("functionName", "writedump");
cfBugs = new CFLint(conf, checker);
}
use of com.cflint.plugins.core.FunctionXChecker in project CFLint by cflint.
the class TestStructNewChecker method setUp.
@Before
public void setUp() throws Exception {
final CFLintConfig conf = new CFLintConfig();
final PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("StructNewChecker");
pluginRule.setClassName("FunctionXChecker");
pluginRule.addParameter("functionName", "structnew");
conf.getRules().add(pluginRule);
final PluginMessage pluginMessage = new PluginMessage("AVOID_USING_STRUCTNEW");
pluginMessage.setSeverity("INFO");
pluginMessage.setMessageText("Avoid using the ${functionName} function. Use implict structure construction instead (= {}).");
pluginRule.getMessages().add(pluginMessage);
FunctionXChecker checker = new FunctionXChecker();
checker.setParameter("functionName", "structnew");
cfBugs = new CFLint(conf, checker);
}
use of com.cflint.plugins.core.FunctionXChecker in project CFLint by cflint.
the class TestDebugChecker method setUp.
@Before
public void setUp() throws Exception {
final CFLintConfig conf = new CFLintConfig();
final PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("DebugChecker");
pluginRule.setClassName("FunctionXChecker");
pluginRule.addParameter("functionName", "IsDebugMode");
conf.getRules().add(pluginRule);
final PluginMessage pluginMessage = new PluginMessage("AVOID_USING_ISDEBUGMODE");
pluginMessage.setSeverity("WARN");
pluginMessage.setMessageText("Avoid using the ${functionName} function in production code.");
pluginRule.getMessages().add(pluginMessage);
FunctionXChecker checker = new FunctionXChecker();
checker.setParameter("functionName", "IsDebugMode");
cfBugs = new CFLint(conf, checker);
}
Aggregations