in libmozdata/FileStats.py [0:0]
def get_info(self, guilty_only=False):
"""Get info
Args:
guilty_only(Optional[bool]): if True then return only info if we have a guilty set of patches
Returns:
dict: info
"""
last = self.get_last_patches()
if guilty_only and not last:
return None
info = self.get_static_info()
if last: # we have a 'guilty' set of patches
stats = {}
last_author = None
for patch in last:
author = patch["user"]
if not last_author:
last_author = author
stats[author] = stats[author] + 1 if author in stats else 1
info["guilty"] = {
"main_author": utils.get_best(stats) if stats else None,
"last_author": last_author,
"patches": last,
}
bugs = self.hi.get(self.path)["bugs"]
bi = BZInfo(bugs) if bugs else None
if bi:
# find out the good person to query for a needinfo
info["needinfo"] = bi.get_best_collaborator()
comp_prod = bi.get_best_component_product()
if comp_prod:
info["infered_component"] = comp_prod[1] + "::" + comp_prod[0]
info["bugs"] = len(bugs)
return info