iterative/dvc

View on GitHub

Showing 536 of 578 total issues

Function show has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def show(
    repo: "Repo",
    targets: Optional[list[str]] = None,
    stages: Optional[list[str]] = None,
    outs_only: bool = False,
Severity: Minor
Found in dvc/repo/metrics/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 _rebuild has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _rebuild(idx, path, fs, cb):
    from dvc_data.index import DataIndex, DataIndexEntry, Meta

    new = DataIndex()
    items = list(idx.items())
Severity: Minor
Found in dvc/repo/push.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 collect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

def check_missing(repo, rev=None, max_size=None, types=None):
    from dvc_data.index import StorageKeyError

    with repo.switch(rev or "workspace"):
        idx = repo.index.targets_view(None, max_size=max_size, types=types)
Severity: Minor
Found in dvc/repo/cache.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 group_definitions_by_id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def group_definitions_by_id(
    definitions: dict[str, dict],
) -> dict[str, tuple[str, dict]]:
    """
    Format ID and extracts plot_definition for each plot.
Severity: Minor
Found in dvc/utils/plots.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 test_init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def test_init(bench_dvc, tmp_dir, scm):
    def _cleanup_dir():
        for item in tmp_dir.iterdir():
            if item.is_dir():
                if item.name != ".git":
Severity: Minor
Found in dvc/testing/benchmarks/cli/commands/test_init.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 _collapse_widths has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _collapse_widths(  # type: ignore[override]
        self,
        widths: list[int],
        wrapable: list[bool],
        max_width: int,
Severity: Minor
Found in dvc/utils/table.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 make_dataset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def make_dataset(request, bench_config, tmp_dir, dvc_bench_git_repo):
    def _make_dataset(
        dvcfile=False, files=True, cache=False, commit=False, remote=False
    ):
        from dvc.repo import Repo
Severity: Minor
Found in dvc/testing/benchmarks/fixtures.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 resolve_rev has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def resolve_rev(scm: Union["Git", "NoSCM"], 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 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 _merge_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _merge_data(s_list):
    d: dict[str, dict] = defaultdict(dict)
    for key in s_list:
        if isinstance(key, str):
            d[key].update({})
Severity: Minor
Found in dvc/output.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 write has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def write(
Severity: Major
Found in dvc/ui/__init__.py - About 1 hr to fix

    Function remove has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def remove(  # noqa: C901, PLR0912
    Severity: Major
    Found in dvc/repo/experiments/remove.py - About 1 hr to fix

      Function _diff has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function imp_db has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function _download_studio has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Consider simplifying this complex logical expression.
              Open

                      if (
                          _remote
                          and (_remote.worktree or _remote.fs.version_aware)
                          and (revs or all_branches or all_tags or all_commits)
                      ):
              Severity: Major
              Found in dvc/repo/push.py - About 1 hr to fix

                Function ls has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function test_filesystem has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def test_filesystem(
                  Severity: Major
                  Found in dvc/testing/api_tests.py - About 1 hr to fix

                    Function iter_revs has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def iter_revs(
                    Severity: Major
                    Found in dvc/scm.py - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language