iterative/dvc

View on GitHub

Showing 529 of 589 total issues

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 download has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def download(
    fs: "FileSystem", fs_path: str, to: str, jobs: Optional[int] = None
) -> list[tuple[str, str, Optional[dict]]]:
    from dvc.scm import lfs_prefetch

Severity: Minor
Found in dvc/fs/__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 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 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 _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

        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 _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

            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 ls_tree has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def ls_tree(
                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 read has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def read(
                    Severity: Major
                    Found in dvc/api/data.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

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

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

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

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

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

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

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

                              def show_experiments(
                              Severity: Major
                              Found in dvc/commands/experiments/show.py - About 1 hr to fix

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

                                    def _update_params(self, params: dict[str, list[str]]):
                                        """Update param files with the provided `Hydra Override`_ patterns.
                                
                                        Args:
                                            params: Dict mapping paths to `Hydra Override`_ patterns,
                                Severity: Minor
                                Found in dvc/repo/experiments/queue/base.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 write has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def write(
                                        self,
                                        *objects: Any,
                                        style: Optional[str] = None,
                                        sep: Optional[str] = None,
                                Severity: Minor
                                Found in dvc/ui/__init__.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 collect_active_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def collect_active_data(
                                        self,
                                        baseline_revs: Optional[Collection[str]],
                                        fetch_refs: bool = False,
                                        **kwargs,
                                Severity: Minor
                                Found in dvc/repo/experiments/queue/tempdir.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

                                Severity
                                Category
                                Status
                                Source
                                Language