Errors detected in .deepsource.toml
.
239 ref_cache = {} # 'ref/tags/<tag>' -> hexsha
240 # This code is the same that is executed for each tag in gitpython,
241 # we excute it only once for all tags.
242 for hexsha, ref in git.TagReference._iter_packed_refs(repo):243 gitobject = git.Object.new_from_sha(repo, hex_to_bin(hexsha))
244 if gitobject.type == 'commit':
245 ref_cache[ref] = str(gitobject)
144 """Sort results according to their score and returns results as list."""
145 sorted_results = [
146 {
147 'type': hit._nested.field,148 source_key: hit._source.to_dict(),
149 'highlight': hit.highlight.to_dict() if hasattr(hit, 'highlight') else {}
150 }
128
129 if obj_ids:
130 kwargs = {
131 'app_label': HTMLFile._meta.app_label,132 'model_name': HTMLFile.__name__,
133 'document_class': str(PageDocument),
134 'objects_id': obj_ids,
44
45 if index_name:
46 # Hack the index name temporarily for reindexing tasks
47 old_index_name = document._doc_type.index 48 document._doc_type.index = index_name
49 log.info('Replacing index name %s with %s', old_index_name, index_name)
50
54 if index_name:
55 log.info('Undoing index replacement, settings %s with %s',
56 document._doc_type.index, old_index_name)
57 document._doc_type.index = old_index_name 58
59
60@app.task(queue='web')
Accessing a protected member (a member prefixed with _
) of a class from outside that class is not recommended, since the creator of that class did not intend this member to be exposed. If accesing this attribute outside of the class is absolutely needed, refactor it such that it becomes part of the public interface of the class.
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
r = Rectangle(4, 8)
area = r._height * r._width
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
def area():
return self._height * self._width
r = Rectangle(4, 8)
area = r.area()