Search in sources :

Example 6 with CFFunctionParameter

use of cfml.parsing.cfscript.script.CFFunctionParameter 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);
            }
        }
    }
}
Also used : CFFuncDeclStatement(cfml.parsing.cfscript.script.CFFuncDeclStatement) CFFunctionParameter(cfml.parsing.cfscript.script.CFFunctionParameter)

Aggregations

CFFuncDeclStatement (cfml.parsing.cfscript.script.CFFuncDeclStatement)6 CFFunctionParameter (cfml.parsing.cfscript.script.CFFunctionParameter)6 CFExpression (cfml.parsing.cfscript.CFExpression)1 CFIdentifier (cfml.parsing.cfscript.CFIdentifier)1 CFLiteral (cfml.parsing.cfscript.CFLiteral)1 CFStringExpression (cfml.parsing.cfscript.CFStringExpression)1 CFCase (cfml.parsing.cfscript.script.CFCase)1 CFCatchStatement (cfml.parsing.cfscript.script.CFCatchStatement)1 CFCompDeclStatement (cfml.parsing.cfscript.script.CFCompDeclStatement)1 CFCompoundStatement (cfml.parsing.cfscript.script.CFCompoundStatement)1 CFExpressionStatement (cfml.parsing.cfscript.script.CFExpressionStatement)1 CFForInStatement (cfml.parsing.cfscript.script.CFForInStatement)1 CFForStatement (cfml.parsing.cfscript.script.CFForStatement)1 CFIfStatement (cfml.parsing.cfscript.script.CFIfStatement)1 CFIncludeStatement (cfml.parsing.cfscript.script.CFIncludeStatement)1 CFPropertyStatement (cfml.parsing.cfscript.script.CFPropertyStatement)1 CFReturnStatement (cfml.parsing.cfscript.script.CFReturnStatement)1 CFScriptStatement (cfml.parsing.cfscript.script.CFScriptStatement)1 CFSwitchStatement (cfml.parsing.cfscript.script.CFSwitchStatement)1 CFTryCatchStatement (cfml.parsing.cfscript.script.CFTryCatchStatement)1