iterative/dvc

View on GitHub

Showing 445 of 487 total issues

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

    def _load_infos(self) -> Generator[Tuple[str, "BaseExecutor"], None, None]:
        import json
        from urllib.parse import urlparse

        from ..base import ExecutorInfo
Severity: Minor
Found in dvc/repo/experiments/executor/manager/base.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 show has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

    def _remove_done_tasks(
        celery_queue: "LocalCeleryQueue",
        queue_entries: Iterable[Optional["QueueEntry"]],
    ):
        """Remove done tasks.
    Severity: Minor
    Found in dvc/repo/experiments/queue/remove.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 format has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def format(self, record):
            record.message = record.getMessage()
            msg = self.formatMessage(record)
    
            if record.levelname == "INFO":
    Severity: Minor
    Found in dvc/logger.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 write_json has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

          def write(
              self,
              *objects: Any,
              style: str = None,
              sep: str = None,
      Severity: Minor
      Found in dvc/ui/__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

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

      def validate_prompts(
          repo: "Repo", key: str, value: str
      ) -> Union[Any, Tuple[Any, str]]:
          from dvc.ui.prompt import InvalidResponse
      
      
      Severity: Minor
      Found in dvc/repo/experiments/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

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

          def _get_repo_dirs(
              self,
              root_dir: str = None,
              fs: "FileSystem" = None,
              uninitialized: bool = False,
      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

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

      def fetch(
          self,
          targets=None,
          jobs=None,
          remote=None,
      Severity: Minor
      Found in dvc/repo/fetch.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 _collect_paths has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def _collect_paths(
          repo: "Repo",
          targets: Iterable[str],
          recursive: bool = False,
          rev: str = None,
      Severity: Minor
      Found in dvc/repo/collect.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 make_tmp_dir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def make_tmp_dir(tmp_path_factory, request, worker_id):
          def make(
              name, *, scm=False, dvc=False, subdir=False
          ):  # pylint: disable=W0621
              from shutil import copytree, ignore_patterns
      Severity: Minor
      Found in dvc/testing/fixtures.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 imp_url has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def imp_url(
          self,
          url,
          out=None,
          fname=None,
      Severity: Minor
      Found in dvc/repo/imp_url.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 brancher has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        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 add_parser has 31 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 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 init has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

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

                def pull(
                Severity: Major
                Found in dvc/repo/experiments/pull.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/__init__.py - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language