iterative/dvc

View on GitHub

Showing 112 of 260 total issues

File exceptions.py has 256 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Exceptions raised by the dvc."""
from __future__ import unicode_literals

import traceback

Severity: Minor
Found in dvc/exceptions.py - About 2 hrs to fix

    Function iter_url has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def iter_url(url, chunk_size=io.DEFAULT_BUFFER_SIZE):
        """Iterate over chunks requested from url."""
        import requests
    
        def request(headers=None):
    Severity: Minor
    Found in dvc/utils/http.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 gc has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def gc(
        self,
        all_branches=False,
        cloud=False,
        remote=None,
    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 execute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def execute(self, cmd):
            stdin, stdout, stderr = self._ssh.exec_command(cmd)
            channel = stdout.channel
    
            stdin.close()
    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 _read_metrics has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def _read_metrics(repo, metrics, branch):
        """Read the content of each metric file and format it.
    
        Args:
            metrics (list): List of metric touples
    Severity: Minor
    Found in dvc/repo/metrics/show.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 collect_stages has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def collect_stages(self):
            """
            Walks down the root directory looking for Dvcfiles,
            skipping the directories that are related with
            any SCM (e.g. `.git`), DVC itself (`.dvc`), or directories
    Severity: Minor
    Found in dvc/repo/__init__.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 _show has a Cognitive Complexity of 12 (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 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 show has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def show(
        repo,
        targets=None,
        typ=None,
        xpath=None,
    Severity: Minor
    Found in dvc/repo/metrics/show.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 brancher has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def brancher(  # noqa: E302
        self,
        branches=None,
        all_branches=False,
        tags=None,
    Severity: Minor
    Found in dvc/repo/brancher.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 main has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def main(argv=None):
        """Run dvc CLI command.
    
        Args:
            argv: optional list of arguments to parse. sys.argv is used by default.
    Severity: Minor
    Found in dvc/main.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 save has a Cognitive Complexity of 12 (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/base.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 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Function gc has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function _get_active_graph has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def _get_active_graph(G):
            import networkx as nx
        
            active = G.copy()
            stages = nx.get_node_attributes(G, "stage")
        Severity: Minor
        Found in dvc/repo/reproduce.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 fspath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def fspath(path):
                """Return the path representation of a path-like object.
        
                If str or bytes is passed in, it is returned unchanged. Otherwise the
                os.PathLike interface is used to get the path representation. If the
        Severity: Minor
        Found in dvc/utils/compat.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 add has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def add(repo, targets, recursive=False, no_commit=False, fname=None):
            if recursive and fname:
                raise RecursiveAddingWhileUsingFilename()
        
            if isinstance(targets, string_types):
        Severity: Minor
        Found in dvc/repo/add.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 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Function used_cache has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function _fetch has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Function pull has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def pull(
              Severity: Major
              Found in dvc/repo/pull.py - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language