iterative/dvc

View on GitHub

Showing 147 of 288 total issues

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

def main():
    import os
    import re
    import shutil
    import sys
Severity: Minor
Found in fastentrypoints.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 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 _get has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

          def fill(
      Severity: Major
      Found in dvc/repo/plots/template.py - About 50 mins to fix

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

            def _list_objects(
                self, path_info, max_items=None, prefix=None, progress_callback=None
            ):
                """ Read config for list object api, paginate through list objects."""
                kwargs = {
        Severity: Minor
        Found in dvc/remote/s3.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 _gdrive_retry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def _gdrive_retry(func):
            def should_retry(exc):
                from pydrive2.files import ApiRequestError
        
                if not isinstance(exc, ApiRequestError):
        Severity: Minor
        Found in dvc/remote/gdrive.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 download_callback:
                                    download_callback(downloaded)
        
        
        Severity: Major
        Found in dvc/repo/tree.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 _checkout_dir has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

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

                def _list_paths(self, bucket, prefix, progress_callback=None):
                    blob_service = self.blob_service
                    next_marker = None
                    while True:
                        blobs = blob_service.list_blobs(
            Severity: Minor
            Found in dvc/remote/azure.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 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 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

              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 walk has a Cognitive Complexity of 8 (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 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 _checkout has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

                      def run(self):
                          from dvc.repo import Repo
                  
                          info = [
                              f"DVC version: {__version__}",
                  Severity: Minor
                  Found in dvc/command/version.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 _upload_to_bucket has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

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

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

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

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

                        def init(root_dir=os.curdir, no_scm=False, force=False, subdir=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 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

                        Severity
                        Category
                        Status
                        Source
                        Language