iterative/dvc

View on GitHub

Showing 112 of 260 total issues

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

            def run(self):
                recursive = not self.args.single_item
                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 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 _cloud_status has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

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

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

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

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

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

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

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

                  Function _collect_metrics has a Cognitive Complexity of 9 (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 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 link has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def link(self, cache_info, path_info):
                          cache = cache_info.path
                          path = path_info.path
                  
                          assert os.path.isfile(cache)
                  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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def upload(self, from_infos, to_infos, names=None, no_progress_bar=False):
                          names = self._verify_path_args(to_infos, from_infos, names)
                  
                          for from_info, to_info, name in zip(from_infos, to_infos, names):
                              if to_info.scheme != "local":
                  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 _collect_dir_cache has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _collect_dir_cache(
                          self, out, branch=None, remote=None, force=False, jobs=None
                      ):
                          """Get a list of `info`s retaled to the given directory.
                  
                  
                  Severity: Minor
                  Found in dvc/repo/__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 download has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def download(
                          self,
                          from_infos,
                          to_infos,
                          no_progress_bar=False,
                  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 download has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def download(
                          self,
                          from_infos,
                          to_infos,
                          no_progress_bar=False,
                  Severity: Minor
                  Found in dvc/remote/hdfs.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

                  Severity
                  Category
                  Status
                  Source
                  Language