github / github/codeql

LGTM.com - false positive - py/missing-equals

Ouverte
#8,804 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
acknowledged false-positive not security
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

**Description of the false positive**

Talk is cheap, show you the code.

```python3
class AbstractClass(abc.ABC):
def __init__(self):
self.a = None

class SuperClass(AbstractClass):
def __init__(self):
super().__init__()
self.b = None # <-- Hey, 'b' is here!

def __eq__(self, other):
return type(self) == type(other) and self.a == other.a and self.b == other.b

class SubClass(SuperClass):
def __init__(self):
super().__init__()
self.b = 'b' # <-- LGTM: The class 'SubClass' does not override '__eq__', but adds the new attribute 'b'.
```

**URL to the alert on the project page on LGTM.com**

https://lgtm.com/projects/g/Rongronggg9/RSS-to-Telegram-Bot/snapshot/006cdf55960512e609e7021e4b6785c2d456e3a5/files/src/parsing/medium.py#x1c4917a8f7d52c7f:1

https://lgtm.com/projects/g/Rongronggg9/RSS-to-Telegram-Bot/snapshot/006cdf55960512e609e7021e4b6785c2d456e3a5/files/src/parsing/medium.py#xda2ab04a8ecf9132:1

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.