iterative/dvc

View on GitHub

Showing 536 of 578 total issues

URLInfo has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class URLInfo(_BasePath):
    DEFAULT_PORTS: ClassVar[dict[str, int]] = {
        "http": 80,
        "https": 443,
        "ssh": 22,
Severity: Minor
Found in dvc/testing/path_info.py - About 2 hrs to fix

    Function restore has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def restore(self, stage, run_cache=True, pull=False, dry=False):  # noqa: C901
            from .serialize import to_single_stage_lockfile
    
            if not _can_hash(stage):
                raise RunCacheNotFoundError(stage)
    Severity: Minor
    Found in dvc/stage/cache.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 a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def commit(
            cls,
            scm: "Git",
            exp_hash: str,
            exp_name: Optional[str] = None,
    Severity: Minor
    Found in dvc/repo/experiments/executor/base.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 update has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def update(  # noqa: C901
        self,
        targets=None,
        rev=None,
        recursive=False,
    Severity: Minor
    Found in dvc/repo/update.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 build_graph has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_graph(stages, outs_trie=None):
        """Generate a graph by using the given stages on the given directory
    
        The nodes of the graph are the stage's path relative to the root.
    
    
    Severity: Minor
    Found in dvc/repo/graph.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 _diff has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def _diff(old, new, data_keys, with_missing=False):
        from dvc_data.index.diff import ADD, DELETE, MODIFY, RENAME
        from dvc_data.index.diff import diff as idiff
    
        ret: "dict[str, list[dict]]" = {
    Severity: Minor
    Found in dvc/repo/diff.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 run has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self):
            name_only = self.args.name_only
            sha_only = self.args.sha_only
            git_remote = self.args.git_remote
            if sha_only and git_remote:
    Severity: Minor
    Found in dvc/commands/experiments/ls.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 _info has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def _info(  # noqa: C901, PLR0912
            self, key, path, ignore_subrepos=True, check_ignored=True
        ):
            repo, dvc_fs, subkey = self._get_subrepo_info(key)
    
    
    Severity: Minor
    Found in dvc/fs/dvc.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

    File vega.py has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import os
    from collections.abc import Iterable
    from typing import Any, Optional, Union
    
    from funcy import first, last
    Severity: Minor
    Found in dvc/render/converter/vega.py - About 2 hrs to fix

      Config has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Config(dict):
          """Class that manages configuration files for a DVC repo.
      
          Args:
              dvc_dir (str): optional path to `.dvc` directory, that is used to
      Severity: Minor
      Found in dvc/config.py - About 2 hrs to fix

        Function rich_print has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def rich_print(  # noqa: PLR0913
        Severity: Major
        Found in dvc/ui/__init__.py - About 2 hrs to fix

          Function fetch has 17 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def fetch(  # noqa: PLR0913
          Severity: Major
          Found in dvc/repo/fetch.py - About 2 hrs to fix

            Function used_objs has 17 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def used_objs(  # noqa: PLR0913
            Severity: Major
            Found in dvc/repo/__init__.py - About 2 hrs to fix

              Function collect_rev has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def collect_rev(
                  repo: "Repo",
                  rev: str,
                  param_deps: bool = False,
                  force: bool = False,
              Severity: Minor
              Found in dvc/repo/experiments/collect.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 get_exact_name has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_exact_name(self, revs: Iterable[str]) -> dict[str, Optional[str]]:
                      """Returns preferred name for the specified revision.
              
                      Prefers tags, branches (heads), experiments in that order.
                      """
              Severity: Minor
              Found in dvc/repo/experiments/__init__.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 build_outs_graph has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def build_outs_graph(graph, outs_trie):
                  import networkx as nx
              
                  from dvc.dependency import DatasetDependency
              
              
              Severity: Minor
              Found in dvc/repo/graph.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 _build_rows has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def _build_rows(
                  baseline_states: Iterable["ExpState"],
                  *,
                  all_headers: Iterable[str],
                  fill_value: Optional[str],
              Severity: Minor
              Found in dvc/repo/experiments/show.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 imp_url has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def imp_url(  # noqa: PLR0913
                  self: "Repo",
                  url,
                  out=None,
                  erepo=None,
              Severity: Minor
              Found in dvc/repo/imp_url.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 _build_out_changes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def _build_out_changes(index, changes):
                  from dvc_data.index.checkout import MODIFY
              
                  out_keys = []
                  for out in index.outs:
              Severity: Minor
              Found in dvc/repo/checkout.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 _ast_assign_to_dict has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def _ast_assign_to_dict(assign, only_self_params=False, lineno=False):  # noqa: PLR0912
                  result = {}
              
                  if isinstance(assign, ast.AnnAssign):
                      name = _get_ast_name(assign.target, only_self_params)
              Severity: Minor
              Found in dvc/utils/serialize/_py.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

              Severity
              Category
              Status
              Source
              Language