Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5bffb2

Browse files
tausbnRasmusWL
authored andcommitted
Python: Add aioch model
1 parent 875fa0b commit b5bffb2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

python/ql/lib/semmle/python/frameworks/Aioch.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ private import python
99
private import semmle.python.Concepts
1010
private import semmle.python.ApiGraphs
1111
private import semmle.python.frameworks.ClickhouseDriver
12+
private import semmle.python.frameworks.data.ModelsAsData
1213

1314
/**
1415
* INTERNAL: Do not use.
@@ -24,6 +25,8 @@ module Aioch {
2425
/** Gets a reference to the `aioch.Client` class or any subclass. */
2526
API::Node subclassRef() {
2627
result = API::moduleImport("aioch").getMember("Client").getASubclass*()
28+
or
29+
result = ModelOutput::getATypeNode("aioch.Client~Subclass").getASubclass*()
2730
}
2831

2932
/** Gets a reference to an instance of `clickhouse_driver.Client` or any subclass. */

python/ql/src/meta/ClassHierarchy/Find.ql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ private import semmle.python.frameworks.Tornado
2929
private import semmle.python.frameworks.Urllib3
3030
private import semmle.python.frameworks.Pydantic
3131
private import semmle.python.frameworks.Peewee
32+
private import semmle.python.frameworks.Aioch
3233
import semmle.python.frameworks.data.internal.ApiGraphModelsExtensions as Extensions
3334

3435
class FlaskViewClasses extends FindSubclassesSpec {
@@ -424,6 +425,12 @@ class PeeweeDatabase extends FindSubclassesSpec {
424425
override API::Node getAlreadyModeledClass() { result = Peewee::Database::subclassRef() }
425426
}
426427

428+
class AiochClient extends FindSubclassesSpec {
429+
AiochClient() { this = "aioch.Client~Subclass" }
430+
431+
override API::Node getAlreadyModeledClass() { result = Aioch::Client::subclassRef() }
432+
}
433+
427434
bindingset[fullyQualified]
428435
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
429436
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |

0 commit comments

Comments
 (0)