iterative/dvc

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

Summary

Maintainability
B
5 hrs
Test Coverage

Function _resolve_exp_by_name has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _resolve_exp_by_name(
    repo: "Repo",
    exp_names: Union[str, List[str]],
    commit_ref_dict: Dict["ExpRefInfo", str],
    queued_ref_dict: Dict[int, str],
Severity: Minor
Found in dvc/repo/experiments/remove.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 _get_queued_index_by_names has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _get_queued_index_by_names(
    repo,
    exp_name_set: Set[str],
) -> Mapping[str, Optional[int]]:
    from scmrepo.exceptions import RevError as InternalRevError
Severity: Minor
Found in dvc/repo/experiments/remove.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 remove has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def remove(
Severity: Major
Found in dvc/repo/experiments/remove.py - About 50 mins to fix

    Function _resolve_exp_by_name has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _resolve_exp_by_name(
    Severity: Minor
    Found in dvc/repo/experiments/remove.py - About 35 mins to fix

      Function _resolve_exp_by_baseline has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _resolve_exp_by_baseline(
      Severity: Minor
      Found in dvc/repo/experiments/remove.py - About 35 mins to fix

        Function remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def remove(
            repo: "Repo",
            exp_names: Union[None, str, List[str]] = None,
            rev: Optional[str] = None,
            all_commits: bool = False,
        Severity: Minor
        Found in dvc/repo/experiments/remove.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

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

        def _resolve_exp_by_baseline(
            repo,
            rev: str,
            num: int,
            commit_ref_dict: Dict["ExpRefInfo", str],
        Severity: Minor
        Found in dvc/repo/experiments/remove.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