iterative/dvc

View on GitHub

Showing 413 of 492 total issues

Function run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        from dvc.exceptions import DvcException

        if not self.args.targets:
            self.args.targets = [None]
Severity: Minor
Found in dvc/commands/commit.py - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        if self.args.show_origin:
            if any((self.args.value, self.args.unset)):
                logger.error(
                    "--show-origin can't be used together with any of these "
Severity: Minor
Found in dvc/commands/config.py - About 35 mins 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 debugtools has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def debugtools(args: "Namespace" = None, **kwargs):
    kw = vars(args) if args else {}
    kw.update(kwargs)

    with ExitStack() as stack:
Severity: Minor
Found in dvc/_debug.py - About 35 mins 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 _repo_from_fs_config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _repo_from_fs_config(
        cls, **config
    ) -> Tuple["Repo", Optional["RepoFactory"]]:
        from dvc.external_repo import erepo_factory, external_repo
        from dvc.repo import Repo
Severity: Minor
Found in dvc/fs/dvc.py - About 35 mins 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 metrics_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def metrics_table(
    metrics,
    all_branches: bool = False,
    all_tags: bool = False,
    all_commits: bool = False,
Severity: Minor
Found in dvc/compare.py - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def save(self):
        if not self.exists:
            raise self.DoesNotExistError(self)

        if not self.isfile and not self.isdir:
Severity: Minor
Found in dvc/output.py - About 35 mins 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 diff_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def diff_table(
    diff,
    title: str,
    old: bool = True,
    no_path: bool = False,
Severity: Minor
Found in dvc/compare.py - About 35 mins 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 _ignore_details has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _ignore_details(self, path, is_dir: bool):
        result = []
        for (regex, _), pattern_info in list(
            zip(self.regex_pattern_list, self.pattern_list)
        ):
Severity: Minor
Found in dvc/ignore.py - About 35 mins 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 _merge_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _merge_info(repo, fs_info, dvc_info):
    from . import utils

    ret = {"repo": repo}

Severity: Minor
Found in dvc/fs/dvc.py - About 35 mins 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

Avoid too many return statements within this function.
Open

    return {"unchanged": [root], **d}
Severity: Major
Found in dvc/repo/data.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return True
    Severity: Major
    Found in dvc/stage/cache.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return path or default, name
      Severity: Major
      Found in dvc/utils/__init__.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return 0
        Severity: Major
        Found in dvc/commands/plots.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return ui.open_browser(output_file)
          Severity: Major
          Found in dvc/commands/plots.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return self._set(remote, section, opt)
            Severity: Major
            Found in dvc/commands/config.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return 1
              Severity: Major
              Found in dvc/commands/plots.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return 0
                Severity: Major
                Found in dvc/commands/plots.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return {remote: self._named_obj_ids(obj)}
                  Severity: Major
                  Found in dvc/output.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 0
                    Severity: Major
                    Found in dvc/commands/status.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return added, False if added else modified
                      Severity: Major
                      Found in dvc/output.py - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language