iterative/dvc

View on GitHub

Showing 517 of 578 total issues

Function _gen has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def _gen(self, struct, prefix=None):
        for name, contents in struct.items():
            path = (prefix or self) / name

            if isinstance(contents, dict):
Severity: Minor
Found in dvc/testing/cloud.py - About 1 hr to fix

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 13 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        if self.args.value is None and not self.args.unset:
            from dvc.config import ConfigError

            if self.args.level:
Severity: Minor
Found in dvc/commands/cache.py - About 1 hr to fix

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_supported_remotes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def _get_supported_remotes():
    supported_remotes = []
    for scheme in registry:
        if scheme in [Schemes.LOCAL, Schemes.MEMORY, "dvc", "git"]:
            continue
Severity: Minor
Found in dvc/info.py - About 1 hr to fix

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 validate_args has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_args(self) -> None:
        from dvc.exceptions import InvalidArgumentError

        args = self.args
        invalid_opt = None
Severity: Minor
Found in dvc/commands/add.py - About 1 hr to fix

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 show_experiments has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def show_experiments(
    td: "TabularData",
    headers: dict[str, Iterable[str]],
    keep=None,
    drop=None,
Severity: Minor
Found in dvc/commands/experiments/show.py - About 1 hr to fix

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 13 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        from dvc.config import ConfigError

        if self.args.name is None and not self.args.unset:
            conf = self.config.read(self.args.level)
Severity: Minor
Found in dvc/commands/remote.py - About 1 hr to fix

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 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(  # noqa: PLR0915, PLR0913
Severity: Major
Found in dvc/repo/__init__.py - About 1 hr to fix

    Function show_diff has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def show_diff(  # noqa: PLR0913
    Severity: Major
    Found in dvc/compare.py - About 1 hr to fix

      Function test_filesystem has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def test_filesystem(
              self,
              M,
              tmp_dir,
              make_tmp_dir,
      Severity: Minor
      Found in dvc/testing/api_tests.py - About 1 hr to fix

        Function save has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def save(
                cls,
                info: "ExecutorInfo",
                targets: Optional[Iterable[str]] = None,
                recursive: bool = False,
        Severity: Minor
        Found in dvc/repo/experiments/executor/base.py - About 1 hr to fix

        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 rename has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def rename(
            repo: "Repo",
            new_name: str,
            exp_name: Union[str, None] = None,
            git_remote: Optional[str] = None,
        Severity: Minor
        Found in dvc/repo/experiments/rename.py - About 1 hr to fix

        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 _changed_deps has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def _changed_deps(
                self, allow_missing: bool = False, upstream: Optional[list] = None
            ) -> bool:
                for dep in self.deps:
                    status = dep.status()
        Severity: Minor
        Found in dvc/stage/__init__.py - About 1 hr to fix

        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 add_outs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def add_outs(self, filter_info=None, allow_missing: bool = False, **kwargs):
                from dvc.output import OutputDoesNotExistError
        
                link_failures = []
                old_versioned_outs = self.get_versioned_outs()
        Severity: Minor
        Found in dvc/stage/__init__.py - About 1 hr to fix

        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_stage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def run_stage(stage, dry=False, force=False, run_env=None, **kwargs):
            if not force:
                if kwargs.get("pull") and not dry:
                    _pull_missing_deps(stage)
        
        
        Severity: Minor
        Found in dvc/stage/run.py - About 1 hr to fix

        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 _log_unversioned has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def _log_unversioned(data: list["DataIndex"]) -> tuple[list["DataIndex"], int]:
            ret: list["DataIndex"] = []
            unversioned: list[str] = []
            for fs_index in data:
                remote = fs_index.storage_map[()].remote
        Severity: Minor
        Found in dvc/repo/fetch.py - About 1 hr to fix

        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 reproduce_celery has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def reproduce_celery(
                self, entries: Optional[Iterable["QueueEntry"]] = None, **kwargs
            ) -> dict[str, str]:
                results: dict[str, str] = {}
                if entries is None:
        Severity: Minor
        Found in dvc/repo/experiments/__init__.py - About 1 hr to fix

        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 used_objs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def used_objs(  # noqa: PLR0913
                self,
                targets=None,
                all_branches=False,
                with_deps=False,
        Severity: Minor
        Found in dvc/repo/__init__.py - About 1 hr to fix

        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_update_diff_index has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def _get_update_diff_index(
            repo: "Repo",
            out: "Output",
            local_index: Union["DataIndex", "DataIndexView"],
            remote_index: Union["DataIndex", "DataIndexView"],
        Severity: Minor
        Found in dvc/repo/worktree.py - About 1 hr to fix

        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 _ast_tree_to_dict has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def _ast_tree_to_dict(tree, only_self_params=False, lineno=False):
            """Parses ast trees to dict.
        
            :param tree: ast.Tree
            :param only_self_params: get only self params from class __init__ function
        Severity: Minor
        Found in dvc/utils/serialize/_py.py - About 1 hr to fix

        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 load_from_vars has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def load_from_vars(
                self,
                fs,
                vars_: list,
                wdir: str,
        Severity: Minor
        Found in dvc/parsing/context.py - About 1 hr to fix

        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

        Severity
        Category
        Status
        Source
        Language