Function __init__
has 9 arguments (exceeds 7 allowed). Consider refactoring. Open
def __init__(self, base_step=2.0, step_ratio=None, num_steps=15,
Function __init__
has 9 arguments (exceeds 7 allowed). Consider refactoring. Open
def __init__(self, base_step=None, step_ratio=None, num_steps=None, step_nom=None,
Consider using '{central
: 3, forward
: 2, backward
: 2}' instead of a call to 'dict'. Open
order2 * dict(central=3, forward=2, backward=2).get(method, 0))
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Too many arguments (10/5) Open
def __init__(self, base_step=None, step_ratio=None, num_steps=None, step_nom=None,
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Consider using '{multicomplex
: 1.06, complex
: 1.06 + c}' instead of a call to 'dict'. Open
return (dict(multicomplex=1.06, complex=1.06 + c).get(method, 2.5) +
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Class 'BasicMaxStepGenerator' inherits from object, can be safely removed from bases in python3 Open
class BasicMaxStepGenerator(object):
- Read upRead up
- Exclude checks
Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
Class 'MinStepGenerator' inherits from object, can be safely removed from bases in python3 Open
class MinStepGenerator(object):
- Read upRead up
- Exclude checks
Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
Consider using '{central
: 2, central2
: 2, complex
: complex_divisior, multicomplex
: 2, ... }' instead of a call to 'dict'. Open
return dict(central=2,
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Too many instance attributes (15/7) Open
class MinStepGenerator(object):
- Read upRead up
- Exclude checks
Used when class has too many instance attributes, try to reduce this to get a simpler (and so easier to use) class.
Consider using Python 3 style super() without arguments Open
super(MaxStepGenerator,
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Too few public methods (0/2) Open
class BasicMinStepGenerator(BasicMaxStepGenerator):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
Consider using '{multicomplex
: 0, complex
: 0.0}' instead of a call to 'dict'. Open
int(n - 1) * dict(multicomplex=0, complex=0.0).get(method, 1.3) +
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Too few public methods (1/2) Open
class BasicMaxStepGenerator(object):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
Too many arguments (10/5) Open
def __init__(self, base_step=2.0, step_ratio=None, num_steps=15,
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Unable to import 'numpy' Open
import numpy as np
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
Line break after binary operator Open
return (dict(multicomplex=1.06, complex=1.06 + c).get(method, 2.5) +
- Read upRead up
- Exclude checks
Avoid breaks after binary operators.
The preferred place to break around a binary operator is before the
operator, not after it.
W504: (width == 0 +\n height == 0)
W504: (width == 0 and\n height == 0)
W504: var = (1 &\n ~2)
Okay: foo(\n -x)
Okay: foo(x\n [])
Okay: x = '''\n''' + ''
Okay: x = '' + '''\n'''
Okay: foo(x,\n -y)
Okay: foo(x, # comment\n -y)
The following should be W504 but unary_context is tricky with these
Okay: var = (1 /\n -2)
Okay: var = (1 +\n -1 +\n -2)
Line break after binary operator Open
int(n - 1) * dict(multicomplex=0, complex=0.0).get(method, 1.3) +
- Read upRead up
- Exclude checks
Avoid breaks after binary operators.
The preferred place to break around a binary operator is before the
operator, not after it.
W504: (width == 0 +\n height == 0)
W504: (width == 0 and\n height == 0)
W504: var = (1 &\n ~2)
Okay: foo(\n -x)
Okay: foo(x\n [])
Okay: x = '''\n''' + ''
Okay: x = '' + '''\n'''
Okay: foo(x,\n -y)
Okay: foo(x, # comment\n -y)
The following should be W504 but unary_context is tricky with these
Okay: var = (1 /\n -2)
Okay: var = (1 +\n -1 +\n -2)
Formatting a regular string which could be a f-string Open
return """{0!s}({1!s})""".format(class_name, ','.join(kwds))
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.
Formatting a regular string which could be a f-string Open
kwds = ['{0!s}={1!s}'.format(name, str(getattr(self, name))) for name in self.__dict__]
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.