puma icon indicating copy to clipboard operation
puma copied to clipboard

Metafuncion tag not working properly

Open ryserCar opened this issue 9 years ago • 0 comments

I have a meta function calling another meta function and that's not working. If i don't use the meta tag for the second function, it does work.

/**
 * @meta
 */
function alertSetIntervalVulnerability() {
    var newFunctionPuma = puma.pumaFindByType(pumaProgram, "ExpressionStatement");
    for (var index = 0; index < newFunctionPuma.length; index++) {
        findSetIntervalVulnerability(newFunctionPuma[index]);
    }
    return null;
}
/**
 * @meta
 */
function findSetIntervalVulnerability(setIntervalAst) {
    var expression = setIntervalAst.expression;
    if (expression.type === 'CallExpression') {
        var nombre = expression.callee.name;
        if (nombre === 'setInterval') {
            var parametro = expression.arguments[0];
            if (parametro.type === 'Literal') {
                console.log('La función setInterval que ha definido puede ser un potencial problema de seguridad');
            }
        }
    }
}

ryserCar avatar Sep 14 '16 00:09 ryserCar