iterative/dvc

View on GitHub

Showing 105 of 242 total issues

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

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

    def upload(self, from_infos, to_infos, names=None, no_progress_bar=False):
        if not hasattr(self, "_upload"):
            raise RemoteActionNotImplemented("upload", self.scheme)
        names = self._verify_path_args(to_infos, from_infos, names)
        fails = 0
Severity: Minor
Found in dvc/remote/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 save has a Cognitive Complexity of 14 (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 reproduce has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

        def _walk(
            self,
            tree,
            topdown=True,
            ignore_file_handler=None,
    Severity: Minor
    Found in dvc/scm/git/tree.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/stage.py - About 1 hr to fix

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

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

        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 gc has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

          def status(
          Severity: Major
          Found in dvc/repo/status.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 _reproduce_stages has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

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

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

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

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

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

                    def _reproduce(
                    Severity: Major
                    Found in dvc/repo/reproduce.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 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

                        Severity
                        Category
                        Status
                        Source
                        Language