iterative/dvc

View on GitHub

Showing 368 of 444 total issues

Function push has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def push(
    repo,
    git_remote: str,
    exp_names: Union[Iterable[str], str],
    all_commits=False,
Severity: Minor
Found in dvc/repo/experiments/push.py - About 3 hrs 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 pull has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def pull(
    repo,
    git_remote: str,
    exp_names: Union[Iterable[str], str],
    all_commits=False,
Severity: Minor
Found in dvc/repo/experiments/pull.py - About 3 hrs 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 _clone_default_branch has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def _clone_default_branch(url, rev, for_write=False):
    """Get or create a clean clone of the url.

    The cloned is reactualized with git pull unless rev is a known sha.
    """
Severity: Minor
Found in dvc/external_repo.py - About 3 hrs 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

File dvcfile.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import contextlib
import logging
import os
from typing import TYPE_CHECKING, Any, Callable, Tuple, TypeVar, Union

Severity: Minor
Found in dvc/dvcfile.py - About 3 hrs to fix

    Index has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Index:
        def __init__(
            self,
            repo: "Repo",  # pylint: disable=redefined-outer-name
            fs: "FileSystem" = None,
    Severity: Minor
    Found in dvc/repo/index.py - About 3 hrs to fix

      Function _output_paths has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      def _output_paths(repo, targets):
          from dvc.fs import LocalFileSystem
          from dvc_data.stage import stage as ostage
      
          on_working_fs = isinstance(repo.fs, LocalFileSystem)
      Severity: Minor
      Found in dvc/repo/diff.py - About 3 hrs 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 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              from pathlib import Path
      
              from dvc.render.match import match_renderers
              from dvc_render import render_html
      Severity: Minor
      Found in dvc/commands/plots.py - About 3 hrs 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 info has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def info(self, path, **kwargs):
              fs, fs_path, dvc_fs, dvc_path = self._get_fs_pair(path)
      
              repo = dvc_fs.repo if dvc_fs else self.repo
              dvcignore = repo.dvcignore
      Severity: Minor
      Found in dvc/fs/dvc.py - About 3 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def push(
          self,
          targets=None,
          jobs=None,
          remote=None,
      Severity: Minor
      Found in dvc/repo/push.py - About 2 hrs 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 _calculate_column_widths has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _calculate_column_widths(
              self, console: "Console", options: "ConsoleOptions"
          ) -> List[int]:
              """Calculate the widths of each column, including padding, not
              including borders.
      Severity: Minor
      Found in dvc/utils/table.py - About 2 hrs 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 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def show_experiments(
          all_experiments,
          keep=None,
          drop=None,
          pager=True,
      Severity: Minor
      Found in dvc/commands/experiments/show.py - About 2 hrs 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 __pretty_exc__ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def __pretty_exc__(self, **kwargs: Any) -> None:
              from ruamel.yaml.error import MarkedYAMLError
      
              exc = self.exc.__cause__
      
      
      Severity: Minor
      Found in dvc/utils/strictyaml.py - About 2 hrs 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_params has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      def _merge_params(s_list):
          d = defaultdict(list)
          default_file = ParamsDependency.DEFAULT_PARAMS_FILE
      
          # figure out completely tracked params file, and ignore specific keys
      Severity: Minor
      Found in dvc/dependency/__init__.py - About 2 hrs 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_diff has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def _show_diff(diff, hide_missing=False):
              """
              Given a diff structure, generate a string of paths separated
              by new lines and grouped together by their state.
      
      
      Severity: Minor
      Found in dvc/commands/diff.py - About 2 hrs 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 _exec_attached has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def _exec_attached(self, repo: "Repo", jobs: Optional[int] = 1):
              import signal
              from concurrent.futures import (
                  CancelledError,
                  ProcessPoolExecutor,
      Severity: Minor
      Found in dvc/repo/experiments/executor/manager/base.py - About 2 hrs 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 resolve_name has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def resolve_name(
          scm: "Git",
          exp_names: Union[Iterable[str], str],
          git_remote: Optional[str] = None,
      ) -> Dict[str, Optional[ExpRefInfo]]:
      Severity: Minor
      Found in dvc/repo/experiments/utils.py - About 2 hrs 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 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def show(
          repo: "Repo",
          all_branches=False,
          all_tags=False,
          revs: Union[List[str], str, None] = None,
      Severity: Minor
      Found in dvc/repo/experiments/show.py - About 2 hrs 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 apply has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def apply(repo, rev, force=True, **kwargs):
          from scmrepo.exceptions import MergeConflictError
      
          from dvc.repo.checkout import checkout as dvc_checkout
          from dvc.scm import GitMergeError, RevError, resolve_rev
      Severity: Minor
      Found in dvc/repo/experiments/apply.py - About 2 hrs 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 _sort_column has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def _sort_column(sort_by, metric_names, param_names):
          path, _, sort_name = sort_by.rpartition(":")
          matches = set()
      
          if path:
      Severity: Minor
      Found in dvc/commands/experiments/show.py - About 2 hrs 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

      TmpDir has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class TmpDir(pathlib.Path):
          scheme = "local"
      
          @property
          def fs_path(self):
      Severity: Minor
      Found in dvc/testing/tmp_dir.py - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language