iterative/dvc

View on GitHub

Showing 536 of 578 total issues

Function du has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def du(self, path, total=True, maxdepth=None, withdirs=False, **kwargs):
        if maxdepth is not None:
            raise NotImplementedError

        sizes = {}
Severity: Minor
Found in dvc/fs/dvc.py - About 1 hr 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 diff_table has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

def diff_table(
Severity: Major
Found in dvc/compare.py - About 1 hr to fix

    Function test_file has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def test_file(self, tmp_dir, dvc, run_copy, remote_version_aware):
            (stage,) = tmp_dir.dvc_gen("foo", "foo")
            run_copy("foo", "foo_copy", name="copy")
    
            assert dvc.push()
    Severity: Minor
    Found in dvc/testing/remote_tests.py - About 1 hr to fix

      Function add_parser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def add_parser(subparsers, parent_parser):
          PLOTS_HELP = "Commands to visualize and compare plot data."
      
          plots_parser = subparsers.add_parser(
              "plots",
      Severity: Minor
      Found in dvc/commands/plots.py - About 1 hr to fix

        Function __init__ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(  # noqa: PLR0913
                self,
                stage,
                path,
                info=None,
        Severity: Minor
        Found in dvc/output.py - About 1 hr to fix

          Function table has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def table(
          Severity: Major
          Found in dvc/ui/__init__.py - About 1 hr to fix

            Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in dvc/repo/experiments/executor/base.py - About 1 hr to fix

              Function push has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def push(
              Severity: Major
              Found in dvc/repo/experiments/push.py - About 1 hr to fix

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

                    def reproduce(
                Severity: Major
                Found in dvc/repo/experiments/executor/base.py - About 1 hr to fix

                  Function update has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def update(  # noqa: C901
                  Severity: Major
                  Found in dvc/repo/update.py - About 1 hr to fix

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

                    def checkout(  # noqa: C901
                    Severity: Major
                    Found in dvc/repo/checkout.py - About 1 hr to fix

                      Function open has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def open(  # noqa: A001
                      Severity: Major
                      Found in dvc/api/data.py - About 1 hr to fix

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

                        def imp(
                        Severity: Major
                        Found in dvc/repo/imp.py - About 1 hr to fix

                          Function get has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def get(
                          Severity: Major
                          Found in dvc/repo/get.py - About 1 hr to fix

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

                                def from_parts(
                            Severity: Major
                            Found in dvc/testing/path_info.py - About 1 hr to fix

                              Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(
                              Severity: Major
                              Found in dvc/fs/callbacks.py - About 1 hr to fix

                                Function _get_done_result has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def _get_done_result(
                                        self, entry: QueueEntry, timeout: Optional[float] = None
                                    ) -> Optional["ExecutorResult"]:
                                        from celery.exceptions import TimeoutError as _CeleryTimeout
                                
                                
                                Severity: Minor
                                Found in dvc/repo/experiments/queue/celery.py - About 1 hr 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 sync_import has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def sync_import(stage, dry=False, force=False, jobs=None, no_download=False):
                                    """Synchronize import's outs to the workspace."""
                                    logger.info("Importing '%s' -> '%s'", stage.deps[0], stage.outs[0])
                                    if dry:
                                        return
                                Severity: Minor
                                Found in dvc/stage/imports.py - About 1 hr 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 _mark_inactive_tasks_failure has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def _mark_inactive_tasks_failure(
                                        self, remained_entries: dict[QueueEntry, str]
                                    ) -> None:
                                        remained_revs: list[str] = []
                                        running_ids = self._get_running_task_ids()
                                Severity: Minor
                                Found in dvc/repo/experiments/queue/celery.py - About 1 hr 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_root has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def find_root(cls, root=None, fs=None) -> str:
                                        from dvc.fs import LocalFileSystem, localfs
                                
                                        fs = fs or localfs
                                        root = root or os.curdir
                                Severity: Minor
                                Found in dvc/repo/__init__.py - About 1 hr 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