airbnb/caravel

View on GitHub
superset/db_engine_specs/gsheets.py

Summary

Maintainability
C
7 hrs
Test Coverage

File gsheets.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
Severity: Minor
Found in superset/db_engine_specs/gsheets.py - About 3 hrs to fix

    Function validate_parameters has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_parameters(
            cls,
            properties: GSheetsPropertiesType,
        ) -> list[SupersetError]:
            errors: list[SupersetError] = []
    Severity: Minor
    Found in superset/db_engine_specs/gsheets.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

    Function df_to_sql has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def df_to_sql(  # pylint: disable=too-many-locals
            cls,
            database: Database,
            table: Table,
            df: pd.DataFrame,
    Severity: Minor
    Found in superset/db_engine_specs/gsheets.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

    Function df_to_sql has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def df_to_sql(  # pylint: disable=too-many-locals
    Severity: Minor
    Found in superset/db_engine_specs/gsheets.py - About 35 mins to fix

      Function get_url_for_impersonation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_url_for_impersonation(
              cls,
              url: URL,
              impersonate_user: bool,
              username: str | None,
      Severity: Minor
      Found in superset/db_engine_specs/gsheets.py - About 25 mins 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

      There are no issues that match your filters.

      Category
      Status