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:
Taus Brock-Nannestad
2020-07-07 15:43:52 +02:00
parent 993506d781
commit f07a7bf8cf
602 changed files with 26777 additions and 26790 deletions

View File

@@ -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

View File

@@ -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" }

View File

@@ -2,4 +2,4 @@ import callGraphConfig
from DataFlow::Node sink
where exists(CallGraphConfig cfg | cfg.isSink(sink))
select sink
select sink

View File

@@ -2,4 +2,4 @@ import callGraphConfig
from DataFlow::Node source
where exists(CallGraphConfig cfg | cfg.isSource(source))
select source
select source

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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) {

View File

@@ -2,4 +2,4 @@ import allFlowsConfig
from DataFlow::Node sink
where exists(AllFlowsConfig cfg | cfg.isSink(sink))
select sink
select sink

View File

@@ -2,4 +2,4 @@ import allFlowsConfig
from DataFlow::Node source
where exists(AllFlowsConfig cfg | cfg.isSource(source))
select source
select source

View File

@@ -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

View File

@@ -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

View File

@@ -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()