iterative/dvc

View on GitHub
dvc/ui/__init__.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function write has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def write(
        self,
        *objects: Any,
        style: str = None,
        sep: str = None,
Severity: Minor
Found in dvc/ui/__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 write_json has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def write_json(
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 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: Iterable[str] = None, password: bool = False
              ) -> Optional[str]:
                  while True:
                      try:
          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 table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def table(
                  self,
                  data: "TableData",
                  headers: "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