iterative/dvc

View on GitHub

Showing 104 of 225 total issues

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

    def run(self):
        msg = "this will remove all cache except the cache that is used in "
        if not self.args.all_branches and not self.args.all_tags:
            msg += "the current git branch"
        elif self.args.all_branches and not self.args.all_tags:
Severity: Minor
Found in dvc/command/gc.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 upload has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def upload(self, from_infos, to_infos, names=None):
        names = self._verify_path_args(to_infos, from_infos, names)

        for from_info, to_info, name in zip(from_infos, to_infos, names):
            if to_info["scheme"] != self.scheme:
Severity: Minor
Found in dvc/remote/azure.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 modify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def modify(repo, path, typ=None, xpath=None, delete=False):
    supported_types = ["raw", "json", "csv", "tsv", "hcsv", "htsv"]
    outs = repo.find_outs_by_path(path)
    assert len(outs) == 1
    out = outs[0]
Severity: Minor
Found in dvc/repo/metrics/modify.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 _merge_cache_lists has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _merge_cache_lists(clists):
    merged_cache = collections.defaultdict(list)

    for cache_list in clists:
        for scheme, cache in cache_list.items():
Severity: Minor
Found in dvc/repo/gc.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 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in dvc/stage.py - About 1 hr to fix

    Function _reproduce has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _reproduce(
    Severity: Major
    Found in dvc/repo/reproduce.py - About 1 hr to fix

      Function _reproduce_stages has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _reproduce_stages(
      Severity: Major
      Found in dvc/repo/reproduce.py - About 1 hr to fix

        Function _cloud_status has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _cloud_status(
        Severity: Major
        Found in dvc/repo/status.py - About 1 hr to fix

          Function _collect_metrics has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def _collect_metrics(self, path, recursive, typ, xpath, branch):
              outs = [out for stage in self.stages() for out in stage.outs]
          
              if path:
                  try:
          Severity: Minor
          Found in dvc/repo/metrics/show.py - About 55 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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def upload(self, from_infos, to_infos, names=None):
                  names = self._verify_path_args(to_infos, from_infos, names)
          
                  for from_info, to_info, name in zip(from_infos, to_infos, names):
                      if to_info["scheme"] != "local":
          Severity: Minor
          Found in dvc/remote/local.py - About 55 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 checkout has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def checkout(self, target=None, with_deps=False, force=False, recursive=False):
              from dvc.stage import StageFileDoesNotExistError, StageFileBadNameError
          
              if target and not recursive:
                  all_stages = self.active_stages()
          Severity: Minor
          Found in dvc/repo/checkout.py - About 55 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 _walk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def _walk(self, tree, topdown=True):
          
                  dirs, nondirs = [], []
                  for i in tree:
                      if i.mode == GIT_MODE_DIR:
          Severity: Minor
          Found in dvc/scm/git/tree.py - About 55 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 download has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def download(
                  self,
                  from_infos,
                  to_infos,
                  no_progress_bar=False,
          Severity: Minor
          Found in dvc/remote/local.py - About 55 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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def upload(self, from_infos, to_infos, names=None):
                  names = self._verify_path_args(to_infos, from_infos, names)
          
                  s3 = self.s3
          
          
          Severity: Minor
          Found in dvc/remote/s3.py - About 55 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 _collect_dir_cache has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def _collect_dir_cache(
                  self, out, branch=None, remote=None, force=False, jobs=None
              ):
                  info = out.dumpd()
                  ret = [info]
          Severity: Minor
          Found in dvc/repo/__init__.py - About 55 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 download has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def download(
                  self,
                  from_infos,
                  to_infos,
                  no_progress_bar=False,
          Severity: Minor
          Found in dvc/remote/ssh/__init__.py - About 55 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 walk_files has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def walk_files(self, directory):
                  from stat import S_ISLNK, S_ISDIR, S_ISREG
          
                  self._sftp_connect()
          
          
          Severity: Minor
          Found in dvc/remote/ssh/connection.py - About 55 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 remove_unused_links has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def remove_unused_links(self, used):
                  """Removes all saved links except the ones that are used.
          
                  Args:
                      used (list): list of used links that should not be removed.
          Severity: Minor
          Found in dvc/state.py - About 55 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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def upload(self, from_infos, to_infos, names=None):
                  names = self._verify_path_args(to_infos, from_infos, names)
          
                  gs = self.gs
          
          
          Severity: Minor
          Found in dvc/remote/gs.py - About 55 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 download has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def download(
                  self,
                  from_infos,
                  to_infos,
                  no_progress_bar=False,
          Severity: Minor
          Found in dvc/remote/hdfs.py - About 55 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

          Severity
          Category
          Status
          Source
          Language