iterative/dvc

View on GitHub
dvc/scm.py

Summary

Maintainability
B
5 hrs
Test Coverage

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 resolve_rev has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def resolve_rev(scm: "Git", rev: str) -> str:
    from scmrepo.exceptions import RevError as InternalRevError

    from dvc.repo.experiments.utils import fix_exp_head

Severity: Minor
Found in dvc/scm.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 iter_revs has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def iter_revs(
Severity: Major
Found in dvc/scm.py - About 50 mins to fix

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

        def update_git(self, event: "GitProgressEvent") -> None:
            phase, completed, total, message, *_ = event
            if phase:
                message = (phase + " | " + message) if message else phase
            if message:
    Severity: Minor
    Found in dvc/scm.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

    There are no issues that match your filters.

    Category
    Status