iterative/dvc

View on GitHub

Showing 105 of 242 total issues

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 _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 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 _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 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 dvc_walk has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def dvc_walk(
            Severity: Minor
            Found in dvc/utils/__init__.py - About 35 mins to fix

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

                  def _get_chunks(self, download, remote, status_info, status, jobs):
              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 _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 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 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 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 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 checkout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def checkout(self, target=None, with_deps=False, force=False, recursive=False):
                          from dvc.stage import StageFileDoesNotExistError, StageFileBadNameError
                      
                          all_stages = self.stages()
                      
                      
                      Severity: Minor
                      Found in dvc/repo/checkout.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 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 _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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def show(
                            repo,
                            path=None,
                            typ=None,
                            xpath=None,
                        Severity: Minor
                        Found in dvc/repo/metrics/show.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 from_parts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def from_parts(
                                cls, scheme=None, netloc=None, host=None, user=None, port=None, path=""
                            ):
                                assert scheme and (bool(host) ^ bool(netloc))
                        
                        
                        Severity: Minor
                        Found in dvc/path_info.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