iterative/dvc

View on GitHub

Showing 101 of 233 total issues

Function _read_metric has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _read_metric(fd, typ=None, xpath=None, fname=None, branch=None):
Severity: Minor
Found in dvc/repo/metrics/show.py - About 35 mins to fix

    Function _process has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _process(
    Severity: Minor
    Found in dvc/remote/local/__init__.py - About 35 mins to fix

      Function loads_from has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def loads_from(stage, s_list, use_cache=True, metric=False, persist=False):
      Severity: Minor
      Found in dvc/output/__init__.py - About 35 mins to fix

        Function _download has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _download(
        Severity: Minor
        Found in dvc/remote/local/__init__.py - About 35 mins to fix

          Function _download has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _download(
          Severity: Minor
          Found in dvc/remote/oss.py - About 35 mins to fix

            Function dvc_walk has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def dvc_walk(top, dvcignore, topdown=True, onerror=None, followlinks=False):
            Severity: Minor
            Found in dvc/utils/__init__.py - About 35 mins to fix

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

                  def run(self):
                      indent = 1 if self.args.cloud else 0
                      try:
                          st = self.repo.status(
                              targets=self.args.targets,
              Severity: Minor
              Found in dvc/command/status.py - About 35 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 main has a Cognitive Complexity of 7 (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 35 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 find_outs_by_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def find_outs_by_path(self, path, outs=None, recursive=False):
                      if not outs:
                          # there is no `from_directory=path` argument because some data
                          # files might be generated to an upper level, and so it is
                          # needed to look at all the files (project root_dir)
              Severity: Minor
              Found in dvc/repo/__init__.py - About 35 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 get_checksum has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_checksum(self, path_info):
                      if not self.exists(path_info):
                          return None
              
                      checksum = self.state.get(path_info)
              Severity: Minor
              Found in dvc/remote/base.py - About 35 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 find_root has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def find_root(cls, root=None):
                      if root is None:
                          root = os.getcwd()
                      else:
                          root = os.path.abspath(os.path.realpath(root))
              Severity: Minor
              Found in dvc/repo/__init__.py - About 35 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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def load(self):
                      """Loads state database."""
                      retries = 1
                      while True:
                          assert self.database is None
              Severity: Minor
              Found in dvc/state.py - About 35 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

              Avoid too many return statements within this function.
              Open

                      return ret
              Severity: Major
              Found in dvc/output/base.py - About 30 mins to fix

                Function _run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _run(self, unlock):
                        for target in self.args.targets:
                            try:
                                self.repo.lock_stage(target, unlock=unlock)
                            except DvcException:
                Severity: Minor
                Found in dvc/command/lock.py - About 25 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 _get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def _get(stage, p, info):
                    from dvc.utils.compat import urlparse
                
                    parsed = urlparse(p)
                
                
                Severity: Minor
                Found in dvc/dependency/__init__.py - About 25 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 csv_reader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def csv_reader(unicode_csv_data, dialect=None, **kwargs):
                    """csv.reader doesn't support Unicode input, so need to use some tricks
                    to work around this.
                
                    Source: https://docs.python.org/2/library/csv.html#csv-examples
                Severity: Minor
                Found in dvc/utils/compat.py - About 25 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 brancher has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def brancher(  # noqa: E302
                    self, branches=None, all_branches=False, tags=None, all_tags=False
                ):
                    """Generator that iterates over specified revisions.
                
                
                Severity: Minor
                Found in dvc/repo/brancher.py - About 25 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 git_object_by_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def git_object_by_path(self, path):
                        import git
                
                        path = relpath(os.path.realpath(path), self.git.working_dir)
                        assert path.split(os.sep, 1)[0] != ".."
                Severity: Minor
                Found in dvc/scm/git/tree.py - About 25 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 reflink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def reflink(source, link_name):
                        import platform
                        from dvc.exceptions import DvcException
                
                        source, link_name = fspath(source), fspath(link_name)
                Severity: Minor
                Found in dvc/system.py - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def init(root_dir=os.curdir, no_scm=False, force=False):
                    """
                    Creates an empty repo on the given directory -- basically a
                    `.dvc` directory with subdirectories for configuration and cache.
                
                
                Severity: Minor
                Found in dvc/repo/init.py - About 25 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

                Severity
                Category
                Status
                Source
                Language