iterative/dvc

View on GitHub
dvc/ui/__init__.py

Summary

Maintainability
C
1 day
Test Coverage

File __init__.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from contextlib import contextmanager, nullcontext
from typing import (
    TYPE_CHECKING,
    Any,
    Callable,
Severity: Minor
Found in dvc/ui/__init__.py - About 3 hrs to fix

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

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

      Function write_json has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def write_json(  # noqa: PLR0913
      Severity: Major
      Found in dvc/ui/__init__.py - About 1 hr to fix

        Function table has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def table(
        Severity: Major
        Found in dvc/ui/__init__.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 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 error_write has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def error_write(
            Severity: Minor
            Found in dvc/ui/__init__.py - About 45 mins to fix

              Function prompt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def prompt(
                      self,
                      text: str,
                      choices: Optional[Iterable[str]] = None,
                      password: bool = False,
              Severity: Minor
              Found in dvc/ui/__init__.py - About 35 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_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def write_json(  # noqa: PLR0913
                      self,
                      data: Any,
                      indent: Optional[int] = None,
                      highlight: Optional[bool] = None,
              Severity: Minor
              Found in dvc/ui/__init__.py - About 25 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 table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def table(
                      self,
                      data: "TableData",
                      headers: Optional["Headers"] = None,
                      markdown: bool = False,
              Severity: Minor
              Found in dvc/ui/__init__.py - About 25 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

              There are no issues that match your filters.

              Category
              Status