github / github/codeql

[LGTM.com - false positive] py/conflicting-attributes for abstract and concrete attribute

Đang mở
#7,451 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
acknowledged false-positive not security Python
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ả

**Description of the false positive**

I have a class that inherits after two classes (abstract and parent with implementation). The conflicting attribute is False-Positive because abstract class just defines abstract property that is inherited after parent class.

Example:
- abstract class
```
from abc import ABC, abstractmethod

class Abstract(ABC):
@property
@abstractmethod
def attribute(self):
"""Abstract atr"""
```
- parent class
```
class Parent:
@property
def attribute(self):
return "some expression"
```
- child class
```
class Child(Parent, Abstract): # <- alert reported
... # some additional code is here
```

[**URL to the alert on the project page on LGTM.com**](https://lgtm.com/projects/g/mdabrowski1990/uds/snapshot/857b583568c0a441827dc326dad749c389faf8a7/files/uds/packet/can_packet.py?sort=name&dir=ASC&mode=heatmap#x80c19aa17f79eb08:1)

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.