use of net.sourceforge.pmd.lang.apex.ast.ASTNewObjectExpression in project pmd by pmd.
the class ApexOpenRedirectRule method visit.
@Override
public Object visit(ASTUserClass node, Object data) {
if (Helper.isTestMethodOrClass(node) || Helper.isSystemLevelClass(node)) {
// stops all the rules
return data;
}
List<ASTAssignmentExpression> assignmentExprs = node.findDescendantsOfType(ASTAssignmentExpression.class);
for (ASTAssignmentExpression assignment : assignmentExprs) {
findSafeLiterals(assignment);
}
List<ASTVariableDeclaration> variableDecls = node.findDescendantsOfType(ASTVariableDeclaration.class);
for (ASTVariableDeclaration varDecl : variableDecls) {
findSafeLiterals(varDecl);
}
List<ASTField> fieldDecl = node.findDescendantsOfType(ASTField.class);
for (ASTField fDecl : fieldDecl) {
findSafeLiterals(fDecl);
}
List<ASTNewObjectExpression> newObjects = node.findDescendantsOfType(ASTNewObjectExpression.class);
for (ASTNewObjectExpression newObj : newObjects) {
checkNewObjects(newObj, data);
}
listOfStringLiteralVariables.clear();
return data;
}
Aggregations