|
|
@ -7,7 +7,7 @@ |
|
|
|
package com.keyware.sonar.java.rules.checkers; |
|
|
|
package com.keyware.sonar.java.rules.checkers; |
|
|
|
|
|
|
|
|
|
|
|
import org.sonar.check.Rule; |
|
|
|
import org.sonar.check.Rule; |
|
|
|
import org.sonar.java.ast.visitors.SubscriptionVisitor; |
|
|
|
import org.sonar.plugins.java.api.IssuableSubscriptionVisitor; |
|
|
|
import org.sonar.plugins.java.api.tree.*; |
|
|
|
import org.sonar.plugins.java.api.tree.*; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
@ -21,7 +21,7 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
@Rule(key = "UploadFileVerify") |
|
|
|
@Rule(key = "UploadFileVerify") |
|
|
|
public class UploadFileVerifyChecker extends SubscriptionVisitor { |
|
|
|
public class UploadFileVerifyChecker extends IssuableSubscriptionVisitor { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<Tree.Kind> nodesToVisit() { |
|
|
|
public List<Tree.Kind> nodesToVisit() { |
|
|
|
/** |
|
|
|
/** |
|
|
@ -79,7 +79,7 @@ public class UploadFileVerifyChecker extends SubscriptionVisitor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 內部文件名称类型获取类
|
|
|
|
// 內部文件名称类型获取类
|
|
|
|
private class InteriorInvoIf extends SubscriptionVisitor{ |
|
|
|
private class InteriorInvoIf extends IssuableSubscriptionVisitor{ |
|
|
|
// 文件全名字
|
|
|
|
// 文件全名字
|
|
|
|
public String fileName = ""; |
|
|
|
public String fileName = ""; |
|
|
|
// 文件后缀名
|
|
|
|
// 文件后缀名
|
|
|
@ -143,7 +143,7 @@ public class UploadFileVerifyChecker extends SubscriptionVisitor { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class NodeIf extends SubscriptionVisitor{ |
|
|
|
public class NodeIf extends IssuableSubscriptionVisitor{ |
|
|
|
|
|
|
|
|
|
|
|
private String name; |
|
|
|
private String name; |
|
|
|
public boolean boo = true; |
|
|
|
public boolean boo = true; |
|
|
|