iterative/dvc

View on GitHub

Showing 529 of 589 total issues

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

def collect_files(
    repo: "Repo", onerror: Optional[Callable[[str, Exception], None]] = None
):
    """Collects all of the stages present in the DVC repo.

Severity: Minor
Found in dvc/repo/index.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 _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 _gen has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in dvc/testing/tmp_dir.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 workspace_status has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def workspace_status(self):
        if not self.exists:
            return {str(self): "deleted"}
        if self.hash_info.value is None:
            return {str(self): "new"}
Severity: Minor
Found in dvc/dependency/param.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 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):
        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 __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 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 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 _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 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 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 push has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def push(  # noqa: PLR0913
            self,
            targets=None,
            jobs=None,
            remote=None,
        Severity: Minor
        Found in dvc/repo/push.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 _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

        Severity
        Category
        Status
        Source
        Language