Showing 35 of 40 total issues
Catching too general exception Exception Open
except Exception as e:
- Read upRead up
- Exclude checks
Used when an except catches a too general exception, possibly burying unrelated errors.
Too many instance attributes (8/7) Open
class DataVolumeInitOperator(KubernetesPodOperator):
- 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.
Missing class docstring Open
class NullAuthHandler(AuthHandler):
- Read upRead up
- Exclude checks
Used when a class has no docstring.Even an empty class must have a docstring.
Too many arguments (6/5) Open
def __init__(
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Missing class docstring Open
class VarsAuthHandler(AuthHandler):
- Read upRead up
- Exclude checks
Used when a class has no docstring.Even an empty class must have a docstring.
Specify string format arguments as logging function parameters Open
self.log.debug(
- Read upRead up
- Exclude checks
Used when a logging statement has a call form of logging.<logging method>(format_string % (format_args...))
. Such calls should leave string interpolation to the logging method itself and be written logging.<logging method>(format_string, format_args...)
so that the program may avoid incurring the cost of the interpolation in those cases in which no message will be logged. For more, see http://www.python.org/dev/peps/pep-0282/.
Variable name e
doesn't conform to snake_case naming style Open
except Exception as e:
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Too few public methods (1/2) Open
class GoogleOAuth2AuthHandler(AuthHandler):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
Similar lines in 2 files Open
"""kedro_airflow_k8s module."""
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==kedroairflowk8s.operators.createpipelinestorage:19 ==kedroairflowk8s.operators.deletepipelinestorage:18 templatefields = [`pvcname`]
@applydefaults def _init_( self, pvcname: str, namespace: str,
Missing function or method docstring Open
def obtain_credentials(self) -> Dict[str, str]:
- Read upRead up
- Exclude checks
Used when a function or method has no docstring.Some special methods like init do not require a docstring.
Specify string format arguments as logging function parameters Open
self.log.error("Failed to obtain IAP access token. " + str(e))
- Read upRead up
- Exclude checks
Used when a logging statement has a call form of logging.<logging method>(format_string % (format_args...))
. Such calls should leave string interpolation to the logging method itself and be written logging.<logging method>(format_string, format_args...)
so that the program may avoid incurring the cost of the interpolation in those cases in which no message will be logged. For more, see http://www.python.org/dev/peps/pep-0282/.
Too few public methods (1/2) Open
class VarsAuthHandler(AuthHandler):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
Too many local variables (28/15) Open
def __init__( # pylint: disable=too-many-arguments
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
Missing class docstring Open
class AuthHandler:
- Read upRead up
- Exclude checks
Used when a class has no docstring.Even an empty class must have a docstring.
Either all return statements in a function should return an expression, or none of them should. Open
def obtain_credentials(self) -> Dict[str, str]:
- Read upRead up
- Exclude checks
According to PEP8, if any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable)