Showing 27 of 27 total issues
Function _get_schema
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _get_schema(self):
fields = []
for name, dtype in zip(self._resource_data.columns, self._resource_data.dtypes):
if str(dtype) == "object":
- 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_view_object
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_view_object(name: str, resources: Sequence, title: str = "", description: str = "", attribution: str = "",
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name: str, resources: Sequence, title: str = "", description: str = "", attribution: str = "",
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name: str, resources: Sequence, title: str = "", description: str = "", attribution: str = "",
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name: str, resources: Sequence, title: str = "", description: str = "", attribution: str = "",
Function add_view
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_view(self, name: str = None, resources: Sequence = None, title: str = "", description: str = "", attribution: str = "",
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name: str, resources: Sequence, title: str = "", description: str = "", attribution: str = "",
Function get_package_resource
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_package_resource(resource_name: str, base_path: str, http_headers: dict):
if os.environ.get("DATAVERK_SETTINGS_PATH", None) is not None:
return read_file(Path(os.environ.get("DATAVERK_SETTINGS_PATH")).joinpath(resource_name))
else:
try:
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
name: str,
resources: Sequence,
title: str = "",
- 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 to_sql
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_sql(
Function anonymize_replace
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def anonymize_replace(df: pd.DataFrame, eval_column, anonymize_columns=None, evaluator=lambda x: x < 4,
Function get_resource_object
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_resource_object(
Function read_sql
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_sql(
Function execute_sql
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_sql(
Function anonymize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def anonymize(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function read_kafka
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_kafka(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function add_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_resource(self, resource: Any, resource_name: str = "",