Showing 50 of 50 total issues
File options.py
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Base classes for 'zntrack.<field>' fields."""
import dataclasses
import json
import logging
File zntrack_project.py
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The class for the ZnTrackProject."""
from __future__ import annotations
import contextlib
Function run
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def run(
self,
eager=False,
repro: bool = True,
optional: dict = 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
File node.py
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The ZnTrack Node class."""
from __future__ import annotations
import contextlib
File nodify.py
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The @nodify decorator."""
import copy
import dataclasses
import json
Function get_files
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def get_files(self, instance) -> list:
"""Get the affected files of the respective Nodes."""
files = []
value = 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 jupyter_class_to_file
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def jupyter_class_to_file(nb_name, module_name):
"""Extract the class definition form an ipynb file."""
# TODO is it really module_name and not class name?
log_jupyter_warning()
- 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 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 save
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def save(self, instance: "Node"):
"""Save plots options to dvc.yaml, if use_global_plots is True."""
if self.plots_options.get("--template") is not None:
template = pathlib.Path(self.plots_options["--template"]).resolve()
if pathlib.Path.cwd() not in template.parents:
- 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_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 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
File field.py
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The base class for all fields."""
import abc
import contextlib
import enum
Function auto_remove
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def auto_remove(self, remove_empty_dirs=True):
"""Remove all nodes from 'dvc.yaml' that are not in the graph."""
_, dvc_node_names = get_groups(None, None)
graph_node_names = [self.graph.nodes[x]["value"].name for x in self.graph.nodes]
- 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_groups
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_groups(remote, rev) -> (dict, list):
"""Get the group names and the nodes in each group from the remote.
Arguments:
---------
- 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 run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def run(
node: str, name: str = None, meta_only: bool = False, method: str = "run"
) -> None:
"""Execute a ZnTrack Node.
- 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 from_rev
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def from_rev(name, remote=".", rev=None, **kwargs) -> T:
"""Load a ZnTrack Node by its name.
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_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 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(