mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Autoformat everything using qlformat.
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import callGraphConfig
|
||||
|
||||
from
|
||||
DataFlow::Node source,
|
||||
DataFlow::Node sink
|
||||
where
|
||||
exists(CallGraphConfig cfg | cfg.hasFlow(source, sink))
|
||||
select
|
||||
source, sink
|
||||
from DataFlow::Node source, DataFlow::Node sink
|
||||
where exists(CallGraphConfig cfg | cfg.hasFlow(source, sink))
|
||||
select source, sink
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import experimental.dataflow.DataFlow
|
||||
|
||||
/**
|
||||
* A configuration to find the call graph edges.
|
||||
* A configuration to find the call graph edges.
|
||||
*/
|
||||
class CallGraphConfig extends DataFlow::Configuration {
|
||||
CallGraphConfig() { this = "CallGraphConfig" }
|
||||
|
||||
@@ -2,4 +2,4 @@ import callGraphConfig
|
||||
|
||||
from DataFlow::Node sink
|
||||
where exists(CallGraphConfig cfg | cfg.isSink(sink))
|
||||
select sink
|
||||
select sink
|
||||
|
||||
@@ -2,4 +2,4 @@ import callGraphConfig
|
||||
|
||||
from DataFlow::Node source
|
||||
where exists(CallGraphConfig cfg | cfg.isSource(source))
|
||||
select source
|
||||
select source
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import allFlowsConfig
|
||||
|
||||
from
|
||||
DataFlow::Node source,
|
||||
DataFlow::Node sink
|
||||
from DataFlow::Node source, DataFlow::Node sink
|
||||
where
|
||||
source != sink and
|
||||
source != sink and
|
||||
exists(AllFlowsConfig cfg | cfg.hasFlow(source, sink))
|
||||
select
|
||||
source, sink
|
||||
select source, sink
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import allFlowsConfig
|
||||
|
||||
from
|
||||
DataFlow::PathNode fromNode,
|
||||
DataFlow::PathNode toNode
|
||||
where
|
||||
toNode = fromNode.getASuccessor()
|
||||
select
|
||||
fromNode, toNode
|
||||
from DataFlow::PathNode fromNode, DataFlow::PathNode toNode
|
||||
where toNode = fromNode.getASuccessor()
|
||||
select fromNode, toNode
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import experimental.dataflow.DataFlow
|
||||
|
||||
from
|
||||
DataFlow::Node fromNode,
|
||||
DataFlow::Node toNode
|
||||
where
|
||||
DataFlow::localFlow(fromNode, toNode)
|
||||
select
|
||||
fromNode, toNode
|
||||
from DataFlow::Node fromNode, DataFlow::Node toNode
|
||||
where DataFlow::localFlow(fromNode, toNode)
|
||||
select fromNode, toNode
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import experimental.dataflow.DataFlow
|
||||
|
||||
from
|
||||
DataFlow::Node fromNode,
|
||||
DataFlow::Node toNode
|
||||
where
|
||||
DataFlow::localFlowStep(fromNode, toNode)
|
||||
select
|
||||
fromNode, toNode
|
||||
from DataFlow::Node fromNode, DataFlow::Node toNode
|
||||
where DataFlow::localFlowStep(fromNode, toNode)
|
||||
select fromNode, toNode
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import maximalFlowsConfig
|
||||
|
||||
from
|
||||
DataFlow::Node source,
|
||||
DataFlow::Node sink
|
||||
from DataFlow::Node source, DataFlow::Node sink
|
||||
where
|
||||
source != sink and
|
||||
source != sink and
|
||||
exists(MaximalFlowsConfig cfg | cfg.hasFlow(source, sink))
|
||||
select
|
||||
source, sink
|
||||
select source, sink
|
||||
|
||||
@@ -11,9 +11,7 @@ class MaximalFlowsConfig extends DataFlow::Configuration {
|
||||
node instanceof DataFlow::ParameterNode
|
||||
or
|
||||
node instanceof DataFlow::EssaNode and
|
||||
not exists(DataFlow::EssaNode pred |
|
||||
DataFlow::localFlowStep(pred, node)
|
||||
)
|
||||
not exists(DataFlow::EssaNode pred | DataFlow::localFlowStep(pred, node))
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node node) {
|
||||
|
||||
@@ -2,4 +2,4 @@ import allFlowsConfig
|
||||
|
||||
from DataFlow::Node sink
|
||||
where exists(AllFlowsConfig cfg | cfg.isSink(sink))
|
||||
select sink
|
||||
select sink
|
||||
|
||||
@@ -2,4 +2,4 @@ import allFlowsConfig
|
||||
|
||||
from DataFlow::Node source
|
||||
where exists(AllFlowsConfig cfg | cfg.isSource(source))
|
||||
select source
|
||||
select source
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import experimental.dataflow.testConfig
|
||||
|
||||
from
|
||||
DataFlow::Node source,
|
||||
DataFlow::Node sink
|
||||
where
|
||||
exists(TestConfiguration cfg | cfg.hasFlow(source, sink))
|
||||
select
|
||||
source, sink
|
||||
from DataFlow::Node source, DataFlow::Node sink
|
||||
where exists(TestConfiguration cfg | cfg.hasFlow(source, sink))
|
||||
select source, sink
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
|
||||
import experimental.dataflow.testConfig
|
||||
|
||||
from
|
||||
DataFlow::Node source,
|
||||
DataFlow::Node sink
|
||||
where
|
||||
exists(TestConfiguration cfg | cfg.hasFlow(source, sink))
|
||||
select
|
||||
source, sink
|
||||
from DataFlow::Node source, DataFlow::Node sink
|
||||
where exists(TestConfiguration cfg | cfg.hasFlow(source, sink))
|
||||
select source, sink
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
* SINK(s)
|
||||
* ```
|
||||
* `SOURCE` will be a source and the second occurance of `s` will be a sink.
|
||||
*
|
||||
*
|
||||
* In order to test literals, alternative sources are defined for each type:
|
||||
*
|
||||
*
|
||||
* for | use
|
||||
* ----------
|
||||
* string | `"source"`
|
||||
@@ -25,7 +25,7 @@ import experimental.dataflow.DataFlow
|
||||
class TestConfiguration extends DataFlow::Configuration {
|
||||
TestConfiguration() { this = "TestConfiguration" }
|
||||
|
||||
override predicate isSource(DataFlow::Node node) {
|
||||
override predicate isSource(DataFlow::Node node) {
|
||||
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "SOURCE"
|
||||
or
|
||||
node.(DataFlow::CfgNode).getNode().getNode().(StrConst).getS() = "source"
|
||||
@@ -36,7 +36,7 @@ class TestConfiguration extends DataFlow::Configuration {
|
||||
// No support for complex numbers
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node node) {
|
||||
override predicate isSink(DataFlow::Node node) {
|
||||
exists(CallNode call |
|
||||
call.getFunction().(NameNode).getId() in ["SINK", "SINK_F"] and
|
||||
node.(DataFlow::CfgNode).getNode() = call.getAnArg()
|
||||
|
||||
Reference in New Issue
Block a user