File dvc.py
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
import errno
import functools
import ntpath
import os
import posixpath
Function ls
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def ls(self, path, detail=True, dvc_only=False, **kwargs): # noqa: C901
key = self._get_key_from_relative(path)
repo, dvc_fs, subkey = self._get_subrepo_info(key)
dvc_infos = {}
- Read upRead up
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
_DVCFileSystem
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class _DVCFileSystem(AbstractFileSystem):
cachable = False
root_marker = "/"
def __init__( # noqa: PLR0913
Function _info
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _info( # noqa: C901, PLR0912
self, key, path, ignore_subrepos=True, check_ignored=True
):
repo, dvc_fs, subkey = self._get_subrepo_info(key)
- Read upRead up
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 __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__( # noqa: PLR0913
Function du
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def du(self, path, total=True, maxdepth=None, withdirs=False, **kwargs):
if maxdepth is not None:
raise NotImplementedError
sizes = {}
- Read upRead up
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 _merge_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _merge_info(repo, key, fs_info, dvc_info):
from . import utils
ret = {"repo": repo}
- Read upRead up
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 _info
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _info( # noqa: C901, PLR0912
Function du
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def du(self, path, total=True, maxdepth=None, withdirs=False, **kwargs):