File nodify.py
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The @nodify decorator."""
import copy
import dataclasses
import json
Function check_type
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def check_type(
obj, types, allow_iterable=False, allow_none=False, allow_dict=False
) -> bool:
"""Check if the obj is of the given types.
- 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 nodify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def nodify(
*,
params: dict = None,
outs: UnionDictListOfStrPath = None,
outs_no_cache: UnionDictListOfStrPath = None,
- 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 write_dvc_command
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def write_dvc_command(self, node_name: str) -> list:
"""Collect dvc commands.
Parameters
----------
- 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 wrapper
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def wrapper(
Function nodify
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def nodify(
Function prepare_dvc_script
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_dvc_script(
Function check_type
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_type(
Function __post_init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __post_init__(self):
"""Dataclass post_init."""
for datacls_field in dataclasses.fields(self):
# type checking
option_value = getattr(self, datacls_field.name)
- 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 True