github / github/codeql

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

Open
#7,451 2 comments 0 reactions 0 assignees View on GitHub
acknowledged false-positive not security Python
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.