Search in sources :

Example 1 with BugList

use of com.cflint.BugList in project CFLint by cflint.

the class PackageCaseChecker method expression.

@Override
public void expression(final CFExpression expression, final Context context, final BugList bugs) {
    if (expression instanceof CFFunctionExpression) {
        final CFFunctionExpression funcExpr = (CFFunctionExpression) expression;
        if (isCreateObject(funcExpr)) {
            final String componentPath = funcExpr.getArgs().get(1).Decompile(0).replace("'", "");
            final String componentName = componentPath.replaceAll("^.+[.]", "");
            checkComponentRegister(context, componentPath, componentName);
        }
    } else if (expression instanceof CFNewExpression) {
        final CFNewExpression newExpr = (CFNewExpression) expression;
        final String componentPath = newExpr.getComponentPath().Decompile(0);
        final List<CFExpression> exprs = newExpr.getComponentPath().decomposeExpression();
        final String componentName = exprs.isEmpty() ? "" : exprs.get(exprs.size() - 1).toString();
        checkComponentRegister(context, componentPath, componentName);
    }
}
Also used : CFNewExpression(cfml.parsing.cfscript.CFNewExpression) CFFunctionExpression(cfml.parsing.cfscript.CFFunctionExpression) ArrayList(java.util.ArrayList) List(java.util.List) BugList(com.cflint.BugList)

Aggregations

CFFunctionExpression (cfml.parsing.cfscript.CFFunctionExpression)1 CFNewExpression (cfml.parsing.cfscript.CFNewExpression)1 BugList (com.cflint.BugList)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1