Closed
Description
I encounter a problem about codeql. I used the following codeql language to detect codeFlows of a project through codeql-cli and vscode respectively:
/**
* This is an automatically generated file
* @name Hello world
* @kind path-problem
* @problem.severity warning
* @id java/example/hello-world
*/
import java
import semmle.code.java.dataflow.DataFlow
import semmle.code.java.dataflow.FlowSources
// For some languages (Java/C++/Python/Swift) you need to explicitly import the data flow library, such as
// import semmle.code.java.dataflow.DataFlow or import codeql.swift.dataflow.DataFlow
module MyFlowConfiguration implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
source.asExpr() = any(MethodCall m| m.getMethod().hasQualifiedName("com.example.app", "UserRegistration", "getUserInput"))
}
predicate isSink(DataFlow::Node sink) {
exists(sink)
}
}
module Flow = DataFlow::Global<MyFlowConfiguration>;
import Flow::PathGraph
from Flow::PathNode source, Flow::PathNode sink
where Flow::flowPath(source, sink)
select sink.getNode(), source, sink, "<message>"
But I got different results . In the sarif file, I got 120 codeFlows. However, searching in vscode only yields 26 paths. I don't know why this situation happened