-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
hello everyone! I want to use CodeQL to implement the following functions:
Given a package name, class name, and method name, I want to use this method as the Sink point (the Sink point is the method itself, not a parameter of the method), find all the source points of this method (the source is also a method, but I don't know the package name, class name, and method name of the method), and the corresponding path (the path is composed of methods). My current solution is to use the following template:
/**
* This is an automatically generated file
* @name Hello world
* @kind problem
* @problem.severity warning
* @id java/example/hello-world
*/
import java
from MethodCall mc
where mc.getCallee().hasQualifiedName("{package}", "{className}", "{methodName}")
select mc, "targetMethod"
I use Python to replace {package}, {className}, {Method} with my method, and then execute this ql file using Python to obtain the corresponding result. Finally, I replace {package}, {className}, {Method} with the result and execute this. ql file again until the result is empty.
But this method consumes a bit more time (on average, each project takes about 6 hours), and I need to analyze nearly 300 projects like this. Is there any way to reduce time consumption
Or can I use multithreading? However, due to the existence of locks , it seems that CodeQL does not support multithreading.