Showing 89 of 94 total issues
Avoid deeply nested control flow statements. Open
for k, v in secret_data.items():
self._replace_dict_key(object_details, k, v)
Function render_templates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_templates(self, relation, columns, destination, options=None, json_cols=None):
Function new_object_exists_in_current_yml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def new_object_exists_in_current_yml(
Function api_call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def api_call(
Function update_connector_table_config
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_connector_table_config(
Function render_property_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_property_file(self, template, context, model_yml, templates_folder):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function generate_or_append_metadata
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_or_append_metadata(self, relation, destination, options, action, existing_rows):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function print_row
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def print_row(
Function _create_or_update_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _create_or_update_source(self, exported_json_data):
"""
Decide whether creating or updating an existing source\
(if it's name corresponds to an existing name in JSON exported configuration)
"""
- 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 dbt_init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dbt_init(self, config_folder=None):
if not config_folder:
config_folder = self.get_config_folder(mandatory=False)
if config_folder:
- 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 _create_or_update_connection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _create_or_update_connection(self, connection_json: dict):
"""
Identify source_id and destination_id by their names
Update or create connection
"""
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
ymls_path = self.get_config_value("yml_path")
dags_path = self.get_config_value("dags_path")
if not (ymls_path and dags_path):
raise MissingArgumentException(["--yml-path", "--dags-path"], self.coves_config)
- 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 _create_or_update_destination
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _create_or_update_destination(self, exported_json_data):
"""
Decide whether creating or updating an existing destination
(if it's name corresponds to an existing name in JSON exported configuration)
"""
- 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 too many return
statements within this function. Open
return exit_code
Function _print_load_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _print_load_results(self):
"""
Inform the user successful loading results
"""
console.print("[green][b]Load successful :heavy_check_mark:[/b][/green]")
- 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 _print_load_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _print_load_results(self):
for obj_type, result_dict in self.load_results.items():
for activity, result in result_dict.items():
if len(result) > 0:
console.print(
- 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 _update_target_connector_schema_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _update_target_connector_schema_config(self, connector, extracted_schemas):
connector_id = connector["id"]
connector_schemas = self.fivetran_api._get_connector_schemas(connector_id)
if connector_schemas:
self.fivetran_api.update_connector_schema_config(connector_id, extracted_schemas)
- 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 get_config_folder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_config_folder(cls, workspace_path=None, mandatory=True):
if not workspace_path:
workspace_path = Path.cwd()
config_folders = [path for path in Path(workspace_path).rglob("**/.dbt_coves/")]
if not config_folders:
- 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"