Search in sources :

Example 1 with QueryParamChecker

use of com.cflint.plugins.core.QueryParamChecker 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 QueryParamChecker

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

the class TestCFBugs_QueryParams method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("QueryParamChecker");
    PluginMessage pluginMessage = new PluginMessage("QUERYPARAM_REQ");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("setSql() statement should use .addParam() instead of #'s for security.");
    pluginRule.getMessages().add(pluginMessage);
    pluginMessage = new PluginMessage("CFQUERYPARAM_REQ");
    pluginMessage.setSeverity("WARNING");
    pluginMessage.setMessageText("<${tag} name=\"${variable}\"> should use <cfqueryparam/> for security reasons.");
    pluginRule.getMessages().add(pluginMessage);
    conf.getRules().add(pluginRule);
    cfBugs = new CFLint(conf, new QueryParamChecker());
}
Also used : QueryParamChecker(com.cflint.plugins.core.QueryParamChecker) 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 QueryParamChecker (com.cflint.plugins.core.QueryParamChecker)2 Before (org.junit.Before)2 ArgDefChecker (com.cflint.plugins.core.ArgDefChecker)1