github / github/codeql

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

オープン
#14,899 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
acknowledged Python question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。