Search in sources :

Example 1 with ArgDefChecker

use of com.cflint.plugins.core.ArgDefChecker in project CFLint by cflint.

the class TestCFLint2Files method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("ArgDefChecker");
    conf.getRules().add(pluginRule);
    PluginMessage pluginMessage = new PluginMessage("ARG_DEFAULT_MISSING");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("Argument ${variable} is not required and does not define a default value.");
    pluginRule.getMessages().add(pluginMessage);
    pluginRule = new PluginInfoRule();
    pluginRule.setName("QueryParamChecker");
    conf.getRules().add(pluginRule);
    pluginMessage = new PluginMessage("QUERYPARAM_REQ");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("setSql() statement should use .addParam() instead of #'s for security.");
    pluginRule.getMessages().add(pluginMessage);
    cfBugs = new CFLint(conf, new ArgDefChecker(), new QueryParamChecker());
}
Also used : QueryParamChecker(com.cflint.plugins.core.QueryParamChecker) ArgDefChecker(com.cflint.plugins.core.ArgDefChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Example 2 with ArgDefChecker

use of com.cflint.plugins.core.ArgDefChecker in project CFLint by cflint.

the class TestCFBugs_Comments method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("ArgDefChecker");
    conf.getRules().add(pluginRule);
    final PluginMessage pluginMessage = new PluginMessage("ARG_DEFAULT_MISSING");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("Argument ${variable} is not required and does not define a default value.");
    pluginRule.getMessages().add(pluginMessage);
    cfBugs = new CFLint(conf, new ArgDefChecker());
}
Also used : ArgDefChecker(com.cflint.plugins.core.ArgDefChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Aggregations

CFLintConfig (com.cflint.config.CFLintConfig)2 PluginInfoRule (com.cflint.config.CFLintPluginInfo.PluginInfoRule)2 PluginMessage (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage)2 ArgDefChecker (com.cflint.plugins.core.ArgDefChecker)2 Before (org.junit.Before)2 QueryParamChecker (com.cflint.plugins.core.QueryParamChecker)1