getindata/dbt-airflow-factory

View on GitHub
dbt_airflow_factory/k8s/k8s_parameters.py

Summary

Maintainability
A
0 mins
Test Coverage
A
90%

Function __init__ has 18 arguments (exceeds 6 allowed). Consider refactoring.
Wontfix

    def __init__(
Severity: Major
Found in dbt_airflow_factory/k8s/k8s_parameters.py - About 2 hrs to fix

    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
    Severity: Minor
    Found in dbt_airflow_factory/k8s/k8s_parameters.py - About 1 hr to fix

    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:

    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__(

    Used when a function or method takes too many arguments.

    Too many local variables (19/15)
    Open

        def __init__(

    Used when a function or method has too many local variables.

    Too many instance attributes (17/7)
    Open

    class KubernetesExecutionParameters:

    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:

    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,

    Used when a function or method argument is not used.

    Import outside toplevel (kubernetes.client)
    Open

                from kubernetes.client import models as k8s

    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

    Used when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.

    There are no issues that match your filters.

    Category
    Status