github / github/codeql

General issue Python:Unable to recognize calling a method through an instance member of a class

Đang mở
#14,899 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
acknowledged Python question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

when evaluate """private API::Node connection()""", the query result should find """self.orm.connection()""".But the query result is none
```
private API::Node dbClient() {
result = API::moduleImport("dbutils").getMember("pooled_db").getMember("PooledDB").getReturn()
}

private API::Node connection() {
result = dbClient().getMember("connection").getReturn()
}
```

python demo here
```
import flask
import pymysql
from flask import request
from dbutils.pooled_db import PooledDB

app = flask.Flask(__name__)

class Database:
def __init__(self):
self.orm = self.dbpool()

def dbpool(self):
pool = PooledDB(
creator=pymysql
)
return pool

def conn(self):
self.orm.connection()

@app.route('/search')
def search():
query = request.args.get('query')
database = Database()
database.conn()
database.orm.connection()
return f"Search query: {query}"

if __name__ == '__main__':
app.run()
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.