iterative/dvc

View on GitHub

Showing 101 of 233 total issues

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

    def walk(self, directory, topdown=True):
        # NOTE: original os.walk() implementation [1] with default options was
        # used as a template.
        #
        # [1] https://github.com/python/cpython/blob/master/Lib/os.py
Severity: Minor
Found in dvc/remote/ssh/connection.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 push has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

      Consider simplifying this complex logical expression.
      Open

              if url:
                  parsed = urlparse(url)
                  user_ssh_config = self._load_user_ssh_config(parsed.hostname)
      
                  host = user_ssh_config.get("hostname", parsed.hostname)
      Severity: Major
      Found in dvc/remote/ssh/__init__.py - About 1 hr to fix

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

            def batch_exists(self, path_infos, callback):
                def _exists(chunk_and_channel):
                    chunk, channel = chunk_and_channel
                    ret = []
                    for path in chunk:
        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 _reproduce_stages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def _reproduce_stages(
            G,
            stages,
            node,
            downstream=False,
        Severity: Minor
        Found in dvc/repo/reproduce.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 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 _walk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _walk(self, tree, topdown=True):
                dirs, nondirs = [], []
                for i in _iter_tree(tree):
                    if i.mode == GIT_MODE_DIR:
                        dirs.append(i.name)
        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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, repo, config):
                super(RemoteLOCAL, self).__init__(repo, config)
                self.protected = config.get(Config.SECTION_CACHE_PROTECTED, False)
        
                shared = config.get(Config.SECTION_CACHE_SHARED)
        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 _collect_used_dir_cache has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _collect_used_dir_cache(self, remote=None, force=False, jobs=None):
                """Get a list of `info`s retaled to the given directory.
        
                - Pull the directory entry from the remote cache if it was changed.
        
        
        Severity: Minor
        Found in dvc/output/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 _reproduce_stages has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          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

            Function _get has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _get(stage, p, info, cache, metric, persist=False, tags=None):
            Severity: Major
            Found in dvc/output/__init__.py - About 50 mins to fix

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

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

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

                    def __init__(
                Severity: Major
                Found in dvc/progress.py - About 50 mins to fix

                  Function reproduce has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def reproduce(
                  Severity: Minor
                  Found in dvc/repo/reproduce.py - About 45 mins to fix

                    Function _collect_metrics has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def _collect_metrics(repo, path, recursive, typ, xpath, branch):
                    Severity: Minor
                    Found in dvc/repo/metrics/show.py - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language