Function get_files
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def get_files(self, instance) -> list:
"""Get the affected files of the respective Nodes."""
files = []
value, _ = self._get_nodes_on_off_graph(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 _get_nodes_on_off_graph
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _get_nodes_on_off_graph(self, instance) -> t.Tuple[list, list]:
"""Get the nodes that are on the graph and off the graph.
Get the values of this descriptor and split them into
nodes that are on the graph and off the graph.
- 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_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 _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 _update_node_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _update_node_name(self, entry, instance, graph, key=None):
Function __set__
has a Cognitive Complexity of 6 (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"