|
|
@ -12,18 +12,13 @@ import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Rule(key = "SessionExpirationDateChecker") |
|
|
|
@Rule(key = "DynamicCodeChecker") |
|
|
|
|
|
|
|
|
|
|
|
//检测代码中包含动态代码执行操作时,工具进行提示
|
|
|
|
//检测代码中包含动态代码执行操作时,工具进行提示
|
|
|
|
public class DynamicCodeChecker extends SubscriptionVisitor { |
|
|
|
public class DynamicCodeChecker extends SubscriptionVisitor { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<Tree.Kind> nodesToVisit() { |
|
|
|
public List<Tree.Kind> nodesToVisit() { |
|
|
|
/** |
|
|
|
|
|
|
|
* Tree.Kind.METHOD:方法节点 |
|
|
|
|
|
|
|
* Tree.Kind.BLOCK:方法的代码块节点 |
|
|
|
|
|
|
|
* Tree.Kind.METHOD_INVOCATION: 方法的调用节点 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
return Collections.singletonList( |
|
|
|
return Collections.singletonList( |
|
|
|
Tree.Kind.METHOD_INVOCATION |
|
|
|
Tree.Kind.METHOD_INVOCATION |
|
|
|
); |
|
|
|
); |
|
|
|