iterative/dvc

View on GitHub

Showing 101 of 233 total issues

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

    def stages(self, from_directory=None, check_dag=True):
        """
        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 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 _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 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 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 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 _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 __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 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 _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 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

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

                  def _process(
                      self,
                      checksum_infos,
                      remote,
                      jobs=None,
              Severity: Minor
              Found in dvc/remote/local/__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 run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def run(self):
                      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 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 open_max_sftp_channels has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def open_max_sftp_channels(self):
                      # If there are more than 1 it means we've already opened max amount
                      if len(self._sftp_channels) <= 1:
                          while True:
                              try:
              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 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 _collect_metrics has a Cognitive Complexity of 10 (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 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