Function __init__
has 18 arguments (exceeds 6 allowed). Consider refactoring. Wontfix
def __init__(
Function resources
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Wontfix
def resources(self): # type: ignore
"""
Return dict containing resources requests and limits.
In the Airflow 1, it was expected to be a real dictionary with
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Unnecessary else
after return
Open
if IS_FIRST_AIRFLOW_VERSION:
- Read upRead up
- Exclude checks
Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.
Too many arguments (18/5) Wontfix
def __init__(
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Too many local variables (19/15) Open
def __init__(
- Read upRead up
- Exclude checks
Used when a function or method has too many local variables.
Too many instance attributes (17/7) Open
class KubernetesExecutionParameters:
- 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.
Unnecessary else
after return
Open
if IS_FIRST_AIRFLOW_VERSION:
- Read upRead up
- Exclude checks
Used in order to highlight an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.
Unused argument 'kwargs' Wontfix
self,
- Read upRead up
- Exclude checks
Used when a function or method argument is not used.
Import outside toplevel (kubernetes.client) Open
from kubernetes.client import models as k8s
- Read upRead up
- Exclude checks
Used when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.
Import outside toplevel (kubernetes.client) Open
from kubernetes.client import models as k8s
- Read upRead up
- Exclude checks
Used when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.