- SonarQube Community Edition
- Version 9.0 (build 45539)
- The code smell “The number and name of arguments passed to a function should match its parameters” is raised on for a call to an instance method from a class method in Python 3.9. For example, the following code:
class Foo():
i = 0
@classmethod
def bar_class_method(cls):
>cls.bar_instance_method(cls)
def bar_instance_method(self):
print(self.i)
The code above is valid, the indicated call to the instance method from the class method uses the default initialization of instance variables, but SonarQube raises it as a code smell.