use of com.cflint.config.CFLintConfig in project CFLint by cflint.
the class TestCFModuleTagChecker method setUp.
@Before
public void setUp() throws Exception {
final CFLintConfig conf = new CFLintConfig();
final PluginInfoRule pluginRuleX = new PluginInfoRule();
pluginRuleX.setName("CFXTagChecker");
pluginRuleX.addParameter("tagName", "cfmodule");
conf.getRules().add(pluginRuleX);
final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_CFMODULE_TAG");
pluginMessageX.setSeverity("WARNING");
pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
pluginRuleX.getMessages().add(pluginMessageX);
final CFXTagChecker checker = new CFXTagChecker();
checker.setParameter("tagName", "cfmodule");
cfBugs = new CFLint(conf, checker);
}
use of com.cflint.config.CFLintConfig in project CFLint by cflint.
the class TestCFAbortChecker method setUp.
@Before
public void setUp() throws Exception {
final CFLintConfig conf = new CFLintConfig();
final PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("CFXTagChecker");
pluginRule.addParameter("tagName", "cfabort");
conf.getRules().add(pluginRule);
final PluginMessage pluginMessage = new PluginMessage("AVOID_USING_CFABORT_TAG");
pluginMessage.setSeverity("INFO");
pluginMessage.setMessageText("Avoid Leaving <${tagName}> tags in committed code.");
pluginRule.getMessages().add(pluginMessage);
cfBugs = new CFLint(conf);
}
use of com.cflint.config.CFLintConfig in project CFLint by cflint.
the class TestCFBugs method setUp.
@Before
public void setUp() throws IOException {
CFLintConfig conf = new CFLintConfig();
PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("VarScoper");
conf.getRules().add(pluginRule);
PluginMessage pluginMessage = new PluginMessage("MISSING_VAR");
pluginMessage.setSeverity("ERROR");
pluginMessage.setMessageText("Variable ${variable} is not declared with a var statement.");
pluginRule.getMessages().add(pluginMessage);
pluginRule = new PluginInfoRule();
pluginRule.setName("GlobalVarChecker");
conf.getRules().add(pluginRule);
pluginMessage = new PluginMessage("GLOBAL_VAR");
pluginMessage.setSeverity("WARNING");
pluginMessage.setMessageText("Identifier ${variable} is global, referencing in a CFC or function should be avoided.");
pluginRule.getMessages().add(pluginMessage);
pluginRule = new PluginInfoRule();
pluginRule.setName("NestedCFOutput");
conf.getRules().add(pluginRule);
pluginMessage = new PluginMessage("NESTED_CFOUTPUT");
pluginMessage.setSeverity("ERROR");
pluginMessage.setMessageText("Nested CFOutput, outer CFOutput has @query.");
pluginRule.getMessages().add(pluginMessage);
pluginRule = new PluginInfoRule();
pluginRule.setName("TypedQueryNew");
conf.getRules().add(pluginRule);
pluginMessage = new PluginMessage("QUERYNEW_DATATYPE");
pluginMessage.setSeverity("WARNING");
pluginMessage.setMessageText("QueryNew statement should specify datatypes.");
pluginRule.getMessages().add(pluginMessage);
cfBugs = new CFLint(conf);
cfBugs.setLogError(true);
}
use of com.cflint.config.CFLintConfig in project CFLint by cflint.
the class TestCFBugsTagless method setUp.
@Before
public void setUp() throws IOException {
CFLintConfig conf = new CFLintConfig();
PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("VarScoper");
conf.getRules().add(pluginRule);
PluginMessage pluginMessage = new PluginMessage("MISSING_VAR");
pluginMessage.setSeverity("ERROR");
pluginMessage.setMessageText("Variable ${variable} is not declared with a var statement.");
pluginRule.getMessages().add(pluginMessage);
cfBugs = new CFLint(conf);
}
use of com.cflint.config.CFLintConfig in project CFLint by cflint.
the class TestCFBugs_VarScoper_Names method setUp.
@Before
public void setUp() {
CFLintConfig conf = new CFLintConfig();
PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("VarScoper");
conf.getRules().add(pluginRule);
PluginMessage pluginMessage = new PluginMessage("MISSING_VAR");
pluginMessage.setSeverity("ERROR");
pluginMessage.setMessageText("Variable ${variable} is not declared with a var statement.");
pluginRule.getMessages().add(pluginMessage);
cfBugs = new CFLint(conf, new VarScoper());
}
Aggregations