iterative/dvc

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

Summary

Maintainability
D
1 day
Test Coverage

Function _collect_experiment_commit has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

def _collect_experiment_commit(
    repo,
    exp_rev,
    stash=False,
    sha_only=True,
Severity: Minor
Found in dvc/repo/experiments/show.py - About 5 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 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

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

def _collect_experiment_branch(
    res, repo, branch, baseline, onerror: Optional[Callable] = None, **kwargs
):
    from dvc.scm import resolve_rev

Severity: Minor
Found in dvc/repo/experiments/show.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 _collect_experiment_commit has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Avoid deeply nested control flow statements.
      Open

                          if name:
                              break
                  if not name:
      Severity: Major
      Found in dvc/repo/experiments/show.py - About 45 mins to fix

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

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

          There are no issues that match your filters.

          Category
          Status