File base.py
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
import csv
import fnmatch
from pathlib import Path
import questionary
Function render_property_files
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def render_property_files(
self,
context,
options,
templates_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 get_relations
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_relations(self, filtered_schemas):
rel_name_selectors = [relation for relation in self.get_config_value("select_relations")]
rel_excludes = [relation for relation in self.get_config_value("exclude_relations")]
- 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_schemas
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_schemas(self):
# get schema names selectors
schema_name_selectors = [schema for schema in self.get_config_value("schemas")]
schema_wildcard_selectors = []
- 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_metadata_columns
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_metadata_columns(self, relation, cols):
"""
Get metadata col
"""
metadata = self.get_metadata()
- 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 modify_property_file
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_property_file(
Function get_metadata
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_metadata(self):
"""
If metadata path is configured, returns a dictionary with column keys
and their corresponding values.
If metadata is already set, do not load again and return the existing value.
- 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 render_property_files
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_property_files(
Function new_object_exists_in_current_yml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def new_object_exists_in_current_yml(
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 render_property_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_property_file(self, template, context, model_yml, templates_folder):
Function new_object_exists_in_current_yml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def new_object_exists_in_current_yml(
self,
current_yml,
template,
context,
- 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"