github / github/codeql

False Negative - Python `abc.ABC` makes method's `getACall` unavailable

Đang mở
#18,725 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
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ả

If we have this Python code:
```python
class MyClass():
def method(self):
print("xxx")
def wrapper(self):
self.method()

mc = MyClass()
mc.method()
```
and this query:
```codeql
import python

from PythonFunctionValue method
select method.getACall()
```
It's OK that `self.method()` and `mc.method()` will be marked as positive.

However, those will be false negative as long as the class `MyClass` inherits `abc.ABC`. It looks like:
```python
from abc import ABC

class MyClass(ABC):
def method(self):
print("xxx")
def wrapper(self):
self.method()

mc = MyClass()
mc.method()
```

Why does the `abc.ABC` make the result wrong?

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.