iterative/dvc

View on GitHub

Showing 440 of 516 total issues

File experiments.py has 1152 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import argparse
import logging
from collections import Counter, OrderedDict, defaultdict
from datetime import date, datetime
from fnmatch import fnmatch
Severity: Major
Found in dvc/command/experiments.py - About 2 days to fix

    File output.py has 824 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import logging
    import os
    from collections import defaultdict
    from copy import copy
    from typing import TYPE_CHECKING, Dict, Optional, Set, Type
    Severity: Major
    Found in dvc/output.py - About 1 day to fix

      File __init__.py has 801 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import logging
      import os
      import re
      import signal
      from collections import defaultdict, namedtuple
      Severity: Major
      Found in dvc/repo/experiments/__init__.py - About 1 day to fix

        File dulwich.py has 546 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import fnmatch
        import locale
        import logging
        import os
        import stat
        Severity: Major
        Found in dvc/scm/git/backend/dulwich.py - About 1 day to fix

          File template.py has 541 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import json
          import os
          from typing import Any, Dict, Optional
          
          from funcy import cached_property
          Severity: Major
          Found in dvc/repo/plots/template.py - About 1 day to fix

            File gitpython.py has 504 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import io
            import locale
            import logging
            import os
            from functools import partial
            Severity: Major
            Found in dvc/scm/git/backend/gitpython.py - About 1 day to fix

              File base.py has 496 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import logging
              import os
              import pickle
              from abc import ABC, abstractmethod
              from contextlib import contextmanager
              Severity: Minor
              Found in dvc/repo/experiments/executor/base.py - About 7 hrs to fix

                File pygit2.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import locale
                import logging
                import os
                import stat
                from contextlib import contextmanager
                Severity: Minor
                Found in dvc/scm/git/backend/pygit2.py - About 7 hrs to fix

                  Output has 50 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Output:
                      IS_DEPENDENCY = False
                  
                      PARAM_PATH = "path"
                      PARAM_CACHE = "cache"
                  Severity: Minor
                  Found in dvc/output.py - About 7 hrs to fix

                    Pygit2Backend has 49 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Pygit2Backend(BaseGitBackend):  # pylint:disable=abstract-method
                        def __init__(  # pylint:disable=W0231
                            self, root_dir=os.curdir, search_parent_directories=True
                        ):
                            import pygit2
                    Severity: Minor
                    Found in dvc/scm/git/backend/pygit2.py - About 6 hrs to fix

                      DulwichBackend has 48 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class DulwichBackend(BaseGitBackend):  # pylint:disable=abstract-method
                          """Dulwich Git backend."""
                      
                          # Dulwich progress will return messages equivalent to git CLI,
                          # our pbars should just display the messages as formatted by dulwich
                      Severity: Minor
                      Found in dvc/scm/git/backend/dulwich.py - About 6 hrs to fix

                        File context.py has 440 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import logging
                        import os
                        from abc import ABC, abstractmethod
                        from collections import defaultdict
                        from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence
                        Severity: Minor
                        Found in dvc/parsing/context.py - About 6 hrs to fix

                          GitPythonBackend has 45 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class GitPythonBackend(BaseGitBackend):  # pylint:disable=abstract-method
                              """git-python Git backend."""
                          
                              def __init__(  # pylint:disable=W0231
                                  self, root_dir=os.curdir, search_parent_directories=True
                          Severity: Minor
                          Found in dvc/scm/git/backend/gitpython.py - About 6 hrs to fix

                            File base.py has 422 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import itertools
                            import logging
                            import os
                            from concurrent.futures import ThreadPoolExecutor
                            from contextlib import suppress
                            Severity: Minor
                            Found in dvc/objects/db/base.py - About 6 hrs to fix

                              BaseGitBackend has 44 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class BaseGitBackend(ABC):
                                  """Base Git backend class."""
                              
                                  @abstractmethod
                                  def __init__(self, root_dir=os.curdir, search_parent_directories=True):
                              Severity: Minor
                              Found in dvc/scm/git/backend/base.py - About 6 hrs to fix

                                File stage.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import fnmatch
                                import logging
                                import os
                                import typing
                                from contextlib import suppress
                                Severity: Minor
                                Found in dvc/repo/stage.py - About 5 hrs to fix

                                  File repo.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import logging
                                  import os
                                  import threading
                                  from contextlib import suppress
                                  from itertools import takewhile
                                  Severity: Minor
                                  Found in dvc/fs/repo.py - About 5 hrs to fix

                                    File __init__.py has 384 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    """Manages Git."""
                                    
                                    import logging
                                    import os
                                    import re
                                    Severity: Minor
                                    Found in dvc/scm/git/__init__.py - About 5 hrs to fix

                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                      if args.path:
                                          pkg = pathlib.Path(args.path)
                                      else:
                                          pkgs = list(path.glob("*.pkg"))
                                          if not pkgs:
                                      Severity: Major
                                      Found in scripts/fpm/notarize.py and 1 other location - About 4 hrs to fix
                                      scripts/fpm/sign.py on lines 25..37

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 84.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                      if args.path:
                                          pkg = pathlib.Path(args.path)
                                      else:
                                          pkgs = list(path.glob("*.pkg"))
                                          if not pkgs:
                                      Severity: Major
                                      Found in scripts/fpm/sign.py and 1 other location - About 4 hrs to fix
                                      scripts/fpm/notarize.py on lines 33..45

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 84.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language