iterative/dvc

View on GitHub

Showing 536 of 578 total issues

Function transfer has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def transfer(
Severity: Minor
Found in dvc/output.py - About 45 mins to fix

    Function _show_results has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _show_results(self, result):
            if not result.match and not self.args.non_matching:
                return
    
            if self.args.details:
    Severity: Minor
    Found in dvc/commands/check_ignore.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 display has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def display(cls, name: str, dataset: "Dataset", action: str = "Adding"):
            from dvc.ui import ui
    
            assert dataset.lock
    
    
    Severity: Minor
    Found in dvc/commands/dataset.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 _show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _show(self, status, indent=0):
            ind = indent * self.STATUS_INDENT
    
            if isinstance(status, str):
                ui.write(f"{ind}{status}")
    Severity: Minor
    Found in dvc/commands/status.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 split_file_meta_from_cloud has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def split_file_meta_from_cloud(entry: dict) -> dict:
        if remote_name := entry.pop(Meta.PARAM_REMOTE, None):
            remote_meta = {}
            for key in (S3_PARAM_CHECKSUM, HDFS_PARAM_CHECKSUM, Meta.PARAM_VERSION_ID):
                if value := entry.pop(key, None):
    Severity: Minor
    Found in dvc/output.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 checkout has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def checkout(
            self,
            force: bool = False,
            progress_callback: "Callback" = DEFAULT_CALLBACK,
            relink: bool = False,
    Severity: Minor
    Found in dvc/output.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self):
            from dvc.repo.experiments.show import tabulate
    
            try:
                exps = self.repo.experiments.show(
    Severity: Minor
    Found in dvc/commands/experiments/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 _find_parser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_parser(parser, cmd_cls):
        defaults = parser._defaults
        if not cmd_cls or cmd_cls == defaults.get("func"):
            parser.print_help()
            raise DvcParserError
    Severity: Minor
    Found in dvc/cli/parser.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

    Consider simplifying this complex logical expression.
    Open

            if (change.old and change.old.isdir and not change.old.hash_info) or (
                change.new and change.new.isdir and not change.new.hash_info
            ):
                continue
    
    
    Severity: Major
    Found in dvc/repo/diff.py - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if remote is not None and remote_config is not None:
              conf = erepo.get("config") or {}
      
              core = conf.get("core") or {}
              core["remote"] = remote
      Severity: Major
      Found in dvc/repo/imp.py - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if exc.context_mark is not None and (
                        exc.problem is None
                        or exc.problem_mark is None
                        or exc.context_mark.name != exc.problem_mark.name
                        or exc.context_mark.line != exc.problem_mark.line
        Severity: Major
        Found in dvc/utils/strictyaml.py - About 40 mins to fix

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

          def loads_from(
          Severity: Minor
          Found in dvc/stage/__init__.py - About 35 mins to fix

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

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

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

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

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

                    def fetch_exps(
                Severity: Minor
                Found in dvc/repo/experiments/executor/base.py - About 35 mins to fix

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

                      def transfer(
                  Severity: Minor
                  Found in dvc/stage/__init__.py - About 35 mins to fix

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

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

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

                      def run_stage(stage, dry=False, force=False, run_env=None, **kwargs):
                      Severity: Minor
                      Found in dvc/stage/run.py - About 35 mins to fix

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

                            def update(
                        Severity: Minor
                        Found in dvc/stage/__init__.py - About 35 mins to fix

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

                          def merge_patterns(flavour, pattern_a, prefix_a, pattern_b, prefix_b):
                          Severity: Minor
                          Found in dvc/pathspec_math.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language