mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Move missing/multiple calls to init/del queries to folder
This commit is contained in:
26
python/ql/src/Classes/CallsToInitDel/MissingCallToInit.py
Normal file
26
python/ql/src/Classes/CallsToInitDel/MissingCallToInit.py
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
class Vehicle(object):
|
||||
|
||||
def __init__(self):
|
||||
self.mobile = True
|
||||
|
||||
class Car(Vehicle):
|
||||
|
||||
def __init__(self):
|
||||
Vehicle.__init__(self)
|
||||
self.car_init()
|
||||
|
||||
#Car.__init__ is missed out.
|
||||
class SportsCar(Car, Vehicle):
|
||||
|
||||
def __init__(self):
|
||||
Vehicle.__init__(self)
|
||||
self.sports_car_init()
|
||||
|
||||
#Fix SportsCar by calling Car.__init__
|
||||
class FixedSportsCar(Car, Vehicle):
|
||||
|
||||
def __init__(self):
|
||||
Car.__init__(self)
|
||||
self.sports_car_init()
|
||||
|
||||
Reference in New Issue
Block a user