iterative/dvc

View on GitHub

Showing 517 of 578 total issues

Function collect_active has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def collect_active(
    repo: "Repo",
    baseline_revs: Collection[str],
    **kwargs,
) -> dict[str, list["ExpRange"]]:
Severity: Minor
Found in dvc/repo/experiments/collect.py - About 45 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 targets_view has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def targets_view(
Severity: Minor
Found in dvc/repo/index.py - About 45 mins to fix

    Function worktree_view_by_remotes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def worktree_view_by_remotes(
        index: "Index",
        targets: Optional["TargetType"] = None,
        push: bool = False,
        **kwargs: Any,
    Severity: Minor
    Found in dvc/repo/worktree.py - About 45 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 add has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def add(
    Severity: Minor
    Found in dvc/repo/stage.py - About 45 mins to fix

      Function _download_studio has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _download_studio(
              repo_url: str,
              name: str,
              version: Optional[str] = None,
              stage: Optional[str] = None,
      Severity: Minor
      Found in dvc/repo/artifacts.py - About 45 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 _exp_range_rows has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _exp_range_rows(
      Severity: Minor
      Found in dvc/repo/experiments/show.py - About 45 mins to fix

        Function push_refspec has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def push_refspec(
        Severity: Minor
        Found in dvc/repo/experiments/utils.py - About 45 mins to fix

          Function download has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def download(
          Severity: Minor
          Found in dvc/repo/artifacts.py - About 45 mins to fix

            Function collect_rev has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def collect_rev(
            Severity: Minor
            Found in dvc/repo/experiments/collect.py - About 45 mins to fix

              Function _collect_specific_target has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def _collect_specific_target(
                  loader: "StageLoad",
                  target: str,
                  with_deps: bool,
                  recursive: bool,
              Severity: Minor
              Found in dvc/repo/stage.py - About 45 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 _revisions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def _revisions(repo, revs, experiment):
                  revisions = revs or []
                  if experiment and len(revisions) == 1:
                      baseline = repo.experiments.get_baseline(revisions[0])
                      if baseline:
              Severity: Minor
              Found in dvc/repo/plots/diff.py - About 45 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_repo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def from_repo(
                      cls,
                      repo: "Repo",
                      rev: Optional[str] = None,
                      param_deps: bool = False,
              Severity: Minor
              Found in dvc/repo/experiments/serialize.py - About 45 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 add has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def add(
              Severity: Minor
              Found in dvc/repo/datasets.py - About 45 mins to fix

                Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(  # noqa: PLR0915, PLR0913
                        self,
                        root_dir: Optional[str] = None,
                        fs: Optional["FileSystem"] = None,
                        rev: Optional[str] = None,
                Severity: Minor
                Found in dvc/repo/__init__.py - About 45 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 init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def init(self, *, scm=False, dvc=False, subdir=False):
                        from dvc.repo import Repo
                        from dvc.scm import Git
                
                        assert not scm or not hasattr(self, "scm")
                Severity: Minor
                Found in dvc/testing/tmp_dir.py - About 45 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 _update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _update(
                        self,
                        dirname: str,
                        ignore_trie: Trie,
                        dnames: Optional["list"],
                Severity: Minor
                Found in dvc/ignore.py - About 45 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 resolve has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def resolve(
                Severity: Minor
                Found in dvc/parsing/context.py - About 45 mins to fix

                  Function imp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def imp(
                      self,
                      url,
                      path,
                      out=None,
                  Severity: Minor
                  Found in dvc/repo/imp.py - About 45 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 _dump has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _dump(data, stream):
                      old_params = data[_PARAMS_KEY]
                      new_params = {
                          key: value
                          for key, value in data.items()
                  Severity: Minor
                  Found in dvc/utils/serialize/_py.py - About 45 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 read_param_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def read_param_file(
                      fs: "FileSystem",
                      path: str,
                      key_paths: Optional[list[str]] = None,
                      flatten: bool = False,
                  Severity: Minor
                  Found in dvc/dependency/param.py - About 45 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