iterative/dvc

View on GitHub

Showing 149 of 260 total issues

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

    def run(self):
        recursive = not self.args.single_item
        saved_dir = os.path.realpath(os.curdir)
        if self.args.cwd:
            os.chdir(self.args.cwd)
Severity: Minor
Found in dvc/command/repro.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 _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 __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

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

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

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

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

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

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

                def upload(self, from_infos, to_infos, names=None, no_progress_bar=False):
                    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/__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 _checkout_dir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _checkout_dir(
                    self, path_info, checksum, force, progress_callback=None
                ):
                    # Create dir separately so that dir is created
                    # even if there are no files in it
            Severity: Minor
            Found in dvc/remote/base.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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def run(
                self,
                cmd=None,
                deps=None,
                outs=None,
            Severity: Minor
            Found in dvc/repo/run.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 _show has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _show(self, target, commands, outs, locked):
                    import networkx
                    from dvc.stage import Stage
            
                    stage = Stage.load(self.repo, target)
            Severity: Minor
            Found in dvc/command/pipeline.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

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

                def link(self, cache_info, path_info):
                    cache = cache_info.path
                    path = path_info.path
            
                    assert os.path.isfile(cache)
            Severity: Minor
            Found in dvc/remote/local/__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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def run(self):
                    if not self.args.targets:
                        self.args.targets = self.default_targets
            
                    for target in self.args.targets:
            Severity: Minor
            Found in dvc/command/pipeline.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/__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 _collect_metrics has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def _collect_metrics(repo, path, recursive, typ, xpath, branch):
                """Gather all the metric outputs.
            
                Args:
                    path (str): Path to a metric file or a directory.
            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 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 show has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def show(
            Severity: Major
            Found in dvc/repo/metrics/show.py - About 50 mins to fix
              Severity
              Category
              Status
              Source
              Language