MCPcopy Index your code
hub / github.com/python/mypy / _report_any_exprs

Method _report_any_exprs

mypy/report.py:278–294  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

276 f.write(footer_str + "\n")
277
278 def _report_any_exprs(self) -> None:
279 total_any = sum(num_any for num_any, _ in self.counts.values())
280 total_expr = sum(total for _, total in self.counts.values())
281 total_coverage = 100.0
282 if total_expr > 0:
283 total_coverage = (float(total_expr - total_any) / float(total_expr)) * 100
284
285 column_names = ["Name", "Anys", "Exprs", "Coverage"]
286 rows: list[list[str]] = []
287 for filename in sorted(self.counts):
288 num_any, num_total = self.counts[filename]
289 coverage = (float(num_total - num_any) / float(num_total)) * 100
290 coverage_str = f"{coverage:.2f}%"
291 rows.append([filename, str(num_any), str(num_total), coverage_str])
292 rows.sort(key=lambda x: x[0])
293 total_row = ["Total", str(total_any), str(total_expr), f"{total_coverage:.2f}%"]
294 self._write_out_report("any-exprs.txt", column_names, rows, total_row)
295
296 def _report_types_of_anys(self) -> None:
297 total_counter: collections.Counter[int] = collections.Counter()

Callers 1

on_finishMethod · 0.95

Calls 8

_write_out_reportMethod · 0.95
sumFunction · 0.85
floatClass · 0.85
sortedFunction · 0.85
strClass · 0.85
valuesMethod · 0.80
appendMethod · 0.80
sortMethod · 0.80

Tested by

no test coverage detected