iterative/dvc

View on GitHub
dvc/repo/commit.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function commit_2_to_3 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def commit_2_to_3(repo: "Repo", dry: bool = False):
    """Force-commit all legacy outputs to use DVC 3.0 hashes."""
    from dvc.dvcfile import ProjectFile
    from dvc.ui import ui

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

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

    Function _migrateable_dvcfiles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _migrateable_dvcfiles(view: "IndexView") -> set[str]:
        from dvc.dvcfile import ProjectFile
    
        migrated = set()
        for stage, filter_info in view._stage_infos:
    Severity: Minor
    Found in dvc/repo/commit.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 commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def commit(
        self,
        target=None,
        with_deps=False,
        recursive=False,
    Severity: Minor
    Found in dvc/repo/commit.py - About 35 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