iterative/dvc

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

Summary

Maintainability
B
4 hrs
Test Coverage

Function _collect_vars has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def _collect_vars(repo, params) -> Dict:
    from dvc.fs.git import GitFileSystem

    vars_params: Dict[str, Dict] = defaultdict(dict)
    rel_to_root = relpath(repo.root_dir)
Severity: Minor
Found in dvc/repo/params/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 _read_params has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _read_params(
    repo,
    params,
    params_fs_paths,
    deps=False,
Severity: Minor
Found in dvc/repo/params/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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Wontfix

def show(repo, revs=None, targets=None, deps=False, onerror: Callable = None):
    if onerror is None:
        onerror = onerror_collect
    res = {}

Severity: Minor
Found in dvc/repo/params/show.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

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

def _read_params(
Severity: Minor
Found in dvc/repo/params/show.py - About 35 mins to fix

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

    def _gather_params(repo, rev, targets=None, deps=False, onerror=None):
    Severity: Minor
    Found in dvc/repo/params/show.py - About 35 mins to fix

      Function show has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Wontfix

      def show(repo, revs=None, targets=None, deps=False, onerror: Callable = None):
      Severity: Minor
      Found in dvc/repo/params/show.py - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status