iterative/dvc

View on GitHub

Showing 101 of 233 total issues

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 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

    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

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

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

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

                def _group(self, checksum_infos, show_checksums=False):
                    by_md5 = {}
            
                    for info in checksum_infos:
                        md5 = info[self.PARAM_CHECKSUM]
            Severity: Minor
            Found in dvc/remote/local/__init__.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 _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 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 not stage.locked:
                                          G_active.add_node(dep_node, stage=dep_stage)
                                          G_active.add_edge(node, dep_node)
              
              
              Severity: Major
              Found in dvc/repo/__init__.py - About 45 mins to fix

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

                def modify(repo, path, typ=None, xpath=None, delete=False):
                Severity: Minor
                Found in dvc/repo/metrics/modify.py - About 35 mins to fix

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

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

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

                        def _upload(
                    Severity: Minor
                    Found in dvc/remote/oss.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/azure.py - About 35 mins to fix

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

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

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

                          def imp(self, url, path, out=None, rev=None):
                          Severity: Minor
                          Found in dvc/repo/imp.py - About 35 mins to fix

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

                            def checkout(self, target=None, with_deps=False, force=False, recursive=False):
                            Severity: Minor
                            Found in dvc/repo/checkout.py - About 35 mins to fix

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

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

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

                                    def line(self, x0, y0, x1, y1, char):
                                Severity: Minor
                                Found in dvc/dagascii.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language