mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Python: remove comments and start design document
This commit is contained in:
24
python/ql/lib/design.md
Normal file
24
python/ql/lib/design.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# The Python libraries
|
||||
|
||||
The Python libraries are a collection of libraries for analysing Python code.
|
||||
Everythng can be imported by importing `python.qll`.
|
||||
|
||||
## The analysis layers
|
||||
|
||||
The analysis is built up in layers. the stack looks like this:
|
||||
|
||||
- AST (coms from the extractor)
|
||||
- Control flow graph (CFG) (built by the extractor)
|
||||
- SSA
|
||||
- Call graph
|
||||
- Data flow
|
||||
|
||||
## Avoiding non-monotonic recursion
|
||||
|
||||
Given the many interactivg layers, it is imprtant to decie which predicates are allowed to be mutually recursive in order to avoid non-monotonic recursion when negation is used to express the predicates.
|
||||
As an example, we have defined local source as those whcih do not receive local flow. This means that the local flow relation is not allowed to be recursive with anything depending on local sources.
|
||||
|
||||
Some particular reatrictions to keep in mind:
|
||||
|
||||
- Typetracking needs to use a local flow step not including summaries
|
||||
- Typetracking needs to use a call graph not including summaries
|
||||
@@ -67,8 +67,6 @@ private class SummarizedCallableMap extends SummarizedCallable {
|
||||
}
|
||||
}
|
||||
|
||||
// Typetracking needs to use a local flow step not including summaries
|
||||
// Typetracking needs to use a call graph not including summaries
|
||||
private class SummarizedCallableJsonLoads extends SummarizedCallable {
|
||||
SummarizedCallableJsonLoads() { this = "json.loads" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user