iterative/dvc

View on GitHub
dvc/repo/experiments/executor/manager/base.py

Summary

Maintainability
B
4 hrs
Test Coverage

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

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 from_stash_entries has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def from_stash_entries(
Severity: Minor
Found in dvc/repo/experiments/executor/manager/base.py - About 35 mins to fix

    Function _collect_executor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _collect_executor(self, repo, executor, exec_result) -> Dict[str, str]:
            # NOTE: GitPython Repo instances cannot be re-used
            # after process has received SIGINT or SIGTERM, so we
            # need this hack to re-instantiate git instances after
            # checkpoint runs. See:
    Severity: Minor
    Found in dvc/repo/experiments/executor/manager/base.py - About 25 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

    There are no issues that match your filters.

    Category
    Status