Function get_pipeline_connection_ids
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_pipeline_connection_ids(
self, source_db: str, source_schema: str, source_table: str
) -> str:
"""
Given a table name, schema and db, returns the corresponding Fivetran Connection ID
- 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
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _dbt_schema_table_in_connector
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _dbt_schema_table_in_connector(self, connector_schemas, dbt_schema, dbt_table):
for schema_details in connector_schemas.values():
if schema_details.get("name_in_destination", "").lower() == dbt_schema:
for table_details in schema_details.get("tables", {}).values():
if table_details.get("name_in_destination", "").lower() == dbt_table:
- 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
Avoid deeply nested control flow statements. Open
for schema_id, schema_data in connector_data.get("schemas", {}).items():
if (
self._dbt_schema_table_in_connector(
{schema_id: schema_data},
source_schema.lower(),
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _get_fivetran_connector_name_for_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_fivetran_connector_name_for_id(self, connector_id):
"""
Create a name for Fivetran tasks based on a Connector ID
"""
for dest_data in self.fivetran_data.values():
- 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"