|
|
|
@ -10,6 +10,7 @@ import com.keyware.sonar.cxx.SubscriptionAstVisitor; |
|
|
|
|
import com.sonar.cxx.sslr.api.AstNode; |
|
|
|
|
import com.sonar.cxx.sslr.api.AstNodeType; |
|
|
|
|
import com.sonar.cxx.sslr.api.Grammar; |
|
|
|
|
import org.checkerframework.checker.units.qual.C; |
|
|
|
|
import org.sonar.check.Priority; |
|
|
|
|
import org.sonar.check.Rule; |
|
|
|
|
import org.sonar.cxx.parser.CxxGrammarImpl; |
|
|
|
@ -73,6 +74,7 @@ public class CmdDataVerifyChecker extends SquidCheck<Grammar> { |
|
|
|
|
if("if".equals(astNode.getToken().getValue())){ |
|
|
|
|
//获取其中的参数
|
|
|
|
|
List<AstNode> astNodeList = astNode.getDescendants(CxxGrammarImpl.expressionList); |
|
|
|
|
astNodeList.addAll(astNode.getDescendants(CxxGrammarImpl.condition)); |
|
|
|
|
for (AstNode expr:astNodeList) { |
|
|
|
|
lists.add(expr.getToken().getValue()); |
|
|
|
|
} |
|
|
|
|