Function _find_object_for_path
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
def _find_object_for_path(self, path):
if not self.content_object:
return None
if isinstance(path, binary_type):
Function remove
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def remove(self, path):
path, name = self._get_path_components(path)
obj = self._find_object_for_path(path)
if isinstance(obj, dict):
try:
Function write
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def write(self, offset, data):
content = self.content_provider.get(self.path)
if content is None:
return SFTP_OK if self.content_provider.put(self.path, data) else SFTP_NO_SUCH_FILE
Avoid too many return
statements within this function.
return False
Function put
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def put(self, path, data):
path, name = self._get_path_components(path)
obj = self._find_object_for_path(path)
if isinstance(obj, dict):
obj[name] = data