iterative/dvc

View on GitHub

Showing 399 of 443 total issues

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

import logging
import os
from collections.abc import Mapping, Sequence
from copy import deepcopy
from typing import (
Severity: Minor
Found in dvc/parsing/__init__.py - About 3 hrs to fix

    Function drop_duplicates has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def drop_duplicates(
            self,
            axis: str = "rows",
            subset: Optional[Iterable[str]] = None,
            ignore_empty: bool = True,
    Severity: Minor
    Found in dvc/compare.py - About 3 hrs 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 dropna has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def dropna(
            self,
            axis: str = "rows",
            how="any",
            subset: Optional[Iterable[str]] = None,
    Severity: Minor
    Found in dvc/compare.py - About 3 hrs 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

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

    import argparse
    import logging
    from itertools import chain, filterfalse
    from typing import TYPE_CHECKING, Dict, Iterable, List
    
    
    Severity: Minor
    Found in dvc/commands/stage.py - About 3 hrs to fix

      Function push has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      def push(
          repo,
          git_remote: str,
          exp_names: Union[Iterable[str], str],
          all_commits=False,
      Severity: Minor
      Found in dvc/repo/experiments/push.py - About 3 hrs 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 pull has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      def pull(
          repo,
          git_remote: str,
          exp_names: Union[Iterable[str], str],
          all_commits=False,
      Severity: Minor
      Found in dvc/repo/experiments/pull.py - About 3 hrs 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 _clone_default_branch has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      def _clone_default_branch(url, rev, for_write=False):
          """Get or create a clean clone of the url.
      
          The cloned is reactualized with git pull unless rev is a known sha.
          """
      Severity: Minor
      Found in dvc/external_repo.py - About 3 hrs 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

      File dvcfile.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import contextlib
      import logging
      import os
      from typing import TYPE_CHECKING, Any, Callable, Tuple, TypeVar, Union
      
      
      Severity: Minor
      Found in dvc/dvcfile.py - About 3 hrs to fix

        Index has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Index:
            def __init__(
                self,
                repo: "Repo",  # pylint: disable=redefined-outer-name
                fs: "FileSystem" = None,
        Severity: Minor
        Found in dvc/repo/index.py - About 3 hrs to fix

          Function _output_paths has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

          def _output_paths(repo, targets):
              from dvc.fs import LocalFileSystem
              from dvc_data.stage import stage as ostage
          
              on_working_fs = isinstance(repo.fs, LocalFileSystem)
          Severity: Minor
          Found in dvc/repo/diff.py - About 3 hrs 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 info has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              def info(self, path, **kwargs):
                  fs, fs_path, dvc_fs, dvc_path = self._get_fs_pair(path)
          
                  repo = dvc_fs.repo if dvc_fs else self.repo
                  dvcignore = repo.dvcignore
          Severity: Minor
          Found in dvc/fs/dvc.py - About 3 hrs 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 run has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              def run(self):
                  from pathlib import Path
          
                  from dvc.render.match import match_renderers
                  from dvc_render import render_html
          Severity: Minor
          Found in dvc/commands/plots.py - About 3 hrs 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 push has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def push(
              self,
              targets=None,
              jobs=None,
              remote=None,
          Severity: Minor
          Found in dvc/repo/push.py - About 2 hrs 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 _calculate_column_widths has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              def _calculate_column_widths(
                  self, console: "Console", options: "ConsoleOptions"
              ) -> List[int]:
                  """Calculate the widths of each column, including padding, not
                  including borders.
          Severity: Minor
          Found in dvc/utils/table.py - About 2 hrs 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_experiments has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          def show_experiments(
              all_experiments,
              keep=None,
              drop=None,
              pager=True,
          Severity: Minor
          Found in dvc/commands/experiments/show.py - About 2 hrs 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 _merge_params has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          def _merge_params(s_list):
              d = defaultdict(list)
              default_file = ParamsDependency.DEFAULT_PARAMS_FILE
          
              # figure out completely tracked params file, and ignore specific keys
          Severity: Minor
          Found in dvc/dependency/__init__.py - About 2 hrs 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 __pretty_exc__ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              def __pretty_exc__(self, **kwargs: Any) -> None:
                  from ruamel.yaml.error import MarkedYAMLError
          
                  exc = self.exc.__cause__
          
          
          Severity: Minor
          Found in dvc/utils/strictyaml.py - About 2 hrs 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 iter_revs has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          def iter_revs(
              scm: "Git",
              revs: Optional[List[str]] = None,
              num: int = 1,
              all_branches: bool = False,
          Severity: Minor
          Found in dvc/scm.py - About 2 hrs 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_diff has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              def _show_diff(diff, hide_missing=False):
                  """
                  Given a diff structure, generate a string of paths separated
                  by new lines and grouped together by their state.
          
          
          Severity: Minor
          Found in dvc/commands/diff.py - About 2 hrs 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 _exec_attached has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def _exec_attached(self, repo: "Repo", jobs: Optional[int] = 1):
                  import signal
                  from concurrent.futures import (
                      CancelledError,
                      ProcessPoolExecutor,
          Severity: Minor
          Found in dvc/repo/experiments/executor/manager/base.py - About 2 hrs 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