iterative/dvc

View on GitHub

Showing 547 of 589 total issues

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

    def download(self, to: "Output", jobs: Optional[int] = None):
        from dvc.fs import LocalFileSystem

        files = super().download(to=to, jobs=jobs)
        if not isinstance(to.fs, LocalFileSystem):
Severity: Minor
Found in dvc/dependency/repo.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 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 _get_odb has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _get_odb(
    Severity: Minor
    Found in dvc/cachemgr.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 _get has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

        def debugtools(args: Optional["Namespace"] = None, **kwargs):
            kw = vars(args) if args else {}
            kw.update(kwargs)
        
            with ExitStack() as stack:
        Severity: Minor
        Found in dvc/_debug.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 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 get has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

              def run(self):
                  from dvc.exceptions import InvalidArgumentError
                  from dvc_render.vega_templates import TEMPLATES
          
                  try:
          Severity: Minor
          Found in dvc/commands/plots.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 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 metrics_table has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            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

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

            def _log_exceptions(exc: Exception) -> Optional[int]:
                """Try to log some known exceptions, that are not DVCExceptions."""
                from dvc.utils import error_link, format_link
            
                if isinstance(exc, OSError):
            Severity: Minor
            Found in dvc/cli/__init__.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 _build_tree_structure has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _build_tree_structure(
            Severity: Minor
            Found in dvc/commands/ls/__init__.py - About 45 mins to fix

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

                  def get_obj(
                      self, filter_info: Optional[str] = None, **kwargs
                  ) -> Optional["HashFile"]:
                      obj: Optional[HashFile] = None
                      if self.obj:
              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

              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 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
                  Severity
                  Category
                  Status
                  Source
                  Language