iterative/dvc

View on GitHub
dvc/repo/experiments/collect.py

Summary

Maintainability
C
1 day
Test Coverage

File collect.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import itertools
import os
from collections.abc import Collection, Iterable, Iterator
from dataclasses import fields
from datetime import datetime
Severity: Minor
Found in dvc/repo/experiments/collect.py - About 3 hrs to fix

    Function collect_rev has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def collect_rev(
        repo: "Repo",
        rev: str,
        param_deps: bool = False,
        force: bool = False,
    Severity: Minor
    Found in dvc/repo/experiments/collect.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 collect has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

      def collect_queued(
          repo: "Repo",
          baseline_revs: Collection[str],
          **kwargs,
      ) -> dict[str, list["ExpRange"]]:
      Severity: Minor
      Found in dvc/repo/experiments/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 collect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def collect(
          repo: "Repo",
          revs: Union[list[str], str, None] = None,
          all_branches: bool = False,
          all_tags: bool = False,
      Severity: Minor
      Found in dvc/repo/experiments/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 _collect_baseline has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def _collect_baseline(
          repo: "Repo",
          baseline_rev: str,
          **kwargs,
      ) -> Iterator["ExpRange"]:
      Severity: Minor
      Found in dvc/repo/experiments/collect.py - About 55 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 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 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

        There are no issues that match your filters.

        Category
        Status