Showing 50 of 50 total issues
Function get_stage_add_argument
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_stage_add_argument(self, instance) -> t.List[tuple]:
"""Get the dvc command for this field."""
cmd = [
(f"--{self.dvc_option}", pathlib.Path(file).as_posix())
for file in self.get_files(instance)
- 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 timeit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def timeit(field: str):
"""Decorator to time a function.
Attributes
----------
- 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_optional_dvc_cmd
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_optional_dvc_cmd(
self, instance: "Node", git_only_repo: bool
) -> typing.List[list]:
"""Get the dvc command for this field."""
nodes = getattr(instance, self.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
Function save
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def save(
self, parameter: bool = True, results: bool = True, meta_only: bool = False
) -> None:
"""Save the node's output to disk."""
if meta_only:
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __set__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __set__(self, instance, value):
"""Disable the _graph_ in the value 'Node'."""
if value is None:
return super().__set__(instance, 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 __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
*args,
template=None,
x=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 _update_node_name
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _update_node_name(self, entry, instance, graph, key=None):
"""Update the node name if it is used as 'zn.nodes'.
Attributes
----------
- 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_dvc_cmd
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_dvc_cmd(
Function run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(
Function prepare_dvc_script
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_dvc_script(
Function from_rev
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_rev(
Consider simplifying this complex logical expression. Open
if (
re.match(r"\S", line)
and not line.startswith("#")
and not line.startswith("class")
and not line.startswith("def")
Function _update_node_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _update_node_name(self, entry, instance, graph, key=None):
Function check_type
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_type(
Function get_optional_dvc_cmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_optional_dvc_cmd(
self, instance: "Node", git_only_repo: bool
) -> typing.List[typing.List[str]]:
"""Add 'dvc plots modify' to this option."""
if not self.use_global_plots:
- 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 module_handler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def module_handler(obj) -> str:
"""Get the module for the Node.
There are three cases that have to be handled here:
1. Run from __main__ should not have __main__ as module but
- 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 group
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def group(self, *names: typing.List[str]):
"""Group nodes together.
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 _get_all_connections_and_instances
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_all_connections_and_instances(value) -> list["Node"]:
"""Get Nodes from Connections and CombinedConnections."""
connections = []
stack = [value]
while stack:
- 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 __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"