iterative/dvc

View on GitHub

Showing 112 of 260 total issues

Function remove_unused_links has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def remove_unused_links(self, used):
        """Removes all saved links except the ones that are used.

        Args:
            used (list): list of used links that should not be removed.
Severity: Minor
Found in dvc/state.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 brancher has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def brancher(  # noqa: E302
Severity: Major
Found in dvc/repo/brancher.py - About 50 mins to fix

    Function show has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def show(
    Severity: Major
    Found in dvc/repo/metrics/show.py - About 50 mins to fix

      Function _reproduce_stages has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function _cloud_status has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Function _get has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _get(stage, p, info, cache, metric, persist=False, tags=None):
          Severity: Major
          Found in dvc/output/__init__.py - About 50 mins to fix

            Function list_cache_paths has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def list_cache_paths(self):
                    if not self.exists(self.path_info):
                        return []
            
                    files = []
            Severity: Minor
            Found in dvc/remote/hdfs.py - About 45 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 deeply nested control flow statements.
            Open

                                if not data:
                                    break
            
            
            Severity: Major
            Found in dvc/utils/__init__.py - About 45 mins to fix

              Function _collect_metrics has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def _collect_metrics(repo, path, recursive, typ, xpath, branch):
              Severity: Minor
              Found in dvc/repo/metrics/show.py - About 45 mins to fix

                Function reproduce has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def reproduce(
                Severity: Minor
                Found in dvc/repo/reproduce.py - About 45 mins to fix

                  Function _create_stages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _create_stages(repo, targets, fname, pbar=None):
                      stages = []
                  
                      for out in targets:
                          stage = Stage.create(repo, outs=[out], add=True, fname=fname)
                  Severity: Minor
                  Found in dvc/repo/add.py - About 45 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 open has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def open(path, repo=None, rev=None, remote=None, mode="r", encoding=None):
                  Severity: Minor
                  Found in dvc/api.py - About 45 mins to fix

                    Function _copy_multipart has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _copy_multipart(
                    Severity: Minor
                    Found in dvc/remote/s3.py - About 45 mins to fix

                      Function from_parts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def from_parts(
                      Severity: Minor
                      Found in dvc/path_info.py - About 45 mins to fix

                        Function _show_dependencies_tree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _show_dependencies_tree(self, target, commands, outs):
                                from treelib import Tree
                        
                                nodes, edges, is_tree = self.__build_graph(target, commands, outs)
                                if not nodes:
                        Severity: Minor
                        Found in dvc/command/pipeline.py - About 45 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 draw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def draw(vertexes, edges):
                            """Build a DAG and draw it in ASCII.
                        
                            Args:
                                vertexes (list): list of graph vertexes.
                        Severity: Minor
                        Found in dvc/dagascii.py - About 45 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 deeply nested control flow statements.
                        Open

                                            if binary:
                                                chunk = data
                                            else:
                                                chunk = dos2unix(data)
                        
                        
                        Severity: Major
                        Found in dvc/utils/__init__.py - About 45 mins to fix

                          Function convert_to_unicode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def convert_to_unicode(data):
                                  if isinstance(data, builtin_str):
                                      return str(data)
                                  if isinstance(data, dict):
                                      return dict(map(convert_to_unicode, data.items()))
                          Severity: Minor
                          Found in dvc/utils/compat.py - About 45 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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def update(self, cache, suffix=""):
                                  for scheme, src in cache._items.items():
                                      dst = self._items[scheme]
                                      for checksum, names in src.items():
                                          if suffix:
                          Severity: Minor
                          Found in dvc/cache.py - About 45 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 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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