use of cfml.parsing.cfscript.script.CFFuncDeclStatement in project CFLint by cflint.
the class ArgTypeChecker method expression.
@Override
public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
if (expression instanceof CFFuncDeclStatement) {
final CFFuncDeclStatement function = (CFFuncDeclStatement) expression;
for (final CFFunctionParameter argument : function.getFormals()) {
final String name = argument.getName();
final String variableType = argument.getType();
if (variableType == null) {
context.addMessage("ARG_TYPE_MISSING", name);
} else if ("any".equals(variableType)) {
context.addMessage("ARG_TYPE_ANY", name);
}
}
}
}
use of cfml.parsing.cfscript.script.CFFuncDeclStatement in project CFLint by cflint.
the class FunctionHintChecker method expression.
/**
* Parse a CF function deceleration to see if it's missing a hint.
*/
@Override
public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
if (expression instanceof CFFuncDeclStatement) {
final CFFuncDeclStatement funcDeclStatement = (CFFuncDeclStatement) expression;
final CFExpression hintAttribute = CFTool.convertMap(funcDeclStatement.getAttributes()).get("hint");
if (hintAttribute == null) {
checkHint(FUNCTION_HINT_MISSING, context.getFunctionName(), expression, context);
}
}
}
Aggregations