def METHOD_NAME(self):
    # function cumulative bb coverage
    # key: function address
    # values: [total basic blocks covered, xrefs to function]
    fun_cov = {f.start: [0, 0] for f in self.view.functions}
    fun_xrefs = sorted(
        [(f, self.view.get_code_refs(f.start)) for f in self.view.functions],
        key=lambda x: len(x[1]),
    )
    for f, xrefs in fun_xrefs:
        if not f.basic_blocks:
            continue
        cov = len(
            (set([b.start for b in f.basic_blocks]).intersection(self.tv.cov_bb))
        ) / float(len(set(f.basic_blocks)))
        fun_cov[f.start][0] += cov
        for xref_f in xrefs:
            fun_cov[xref_f.function.start][0] += cov
            fun_cov[xref_f.function.start][1] += 1
    for f, xrefs in fun_xrefs:
        cov = str((fun_cov[f.start][0] * 100.0) / (fun_cov[f.start][1] + 1))
        cov += "% cumulative BB coverage"
        f.set_comment(f.start, "Function Stats: \n" + cov)
        for xref in xrefs:
            self.tv.set_comment_at_xref(xref, cov)