iterative/dvc

View on GitHub
dvc/testing/path_info.py

Summary

Maintainability
C
7 hrs
Test Coverage

URLInfo has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class URLInfo(_BasePath):
    DEFAULT_PORTS = {"http": 80, "https": 443, "ssh": 22, "hdfs": 0}

    def __init__(self, url):
        p = urlparse(url)
Severity: Minor
Found in dvc/testing/path_info.py - About 2 hrs to fix

    File path_info.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # pylint: disable=protected-access
    import os
    import pathlib
    import posixpath
    from typing import Callable
    Severity: Minor
    Found in dvc/testing/path_info.py - About 2 hrs to fix

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

          def from_parts(
      Severity: Major
      Found in dvc/testing/path_info.py - About 1 hr to fix

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

            def from_parts(
        Severity: Minor
        Found in dvc/testing/path_info.py - About 45 mins to fix

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

              def _fill_parts(self, scheme, host, user, port, path):
          Severity: Minor
          Found in dvc/testing/path_info.py - About 35 mins to fix

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

                def from_parts(
                    cls,
                    scheme=None,
                    host=None,
                    user=None,
            Severity: Minor
            Found in dvc/testing/path_info.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

            There are no issues that match your filters.

            Category
            Status