def report(self, morfs, outfile=None):
self.find_code_units(morfs)<EOL>max_name = max([len(cu.name) for cu in self.code_units] + [<NUM_LIT:5>])<EOL>fmt_name = "<STR_LIT>" % max_name<EOL>fmt_err = "<STR_LIT>"<EOL>header = (fmt_name % "<STR_LIT:Name>") + "<STR_LIT>"<EOL>fmt_coverage = fmt_name + "<STR_LIT>"<EOL>if self.branches:<EOL><INDENT>header += "<STR_LIT>"<EOL>fmt_coverage += "<STR_LIT>"<EOL><DEDENT>width100 = Numbers.pc_str_width()<EOL>header += "<STR_LIT>" % (width100+<NUM_LIT:4>, "<STR_LIT>")<EOL>fmt_coverage += "<STR_LIT>" % (width100+<NUM_LIT:3>,)<EOL>if self.config.show_missing:<EOL><INDENT>header += "<STR_LIT>"<EOL>fmt_coverage += "<STR_LIT>"<EOL><DEDENT>rule = "<STR_LIT:->" * len(header) + "<STR_LIT:\n>"<EOL>header += "<STR_LIT:\n>"<EOL>fmt_coverage += "<STR_LIT:\n>"<EOL>if not outfile:<EOL><INDENT>outfile = sys.stdout<EOL><DEDENT>outfile.write(header)<EOL>outfile.write(rule)<EOL>total = Numbers()<EOL>for cu in self.code_units:<EOL><INDENT>try:<EOL><INDENT>analysis = self.coverage._analyze(cu)<EOL>nums = analysis.numbers<EOL>args = (cu.name, nums.n_statements, nums.n_missing)<EOL>if self.branches:<EOL><INDENT>args += (nums.n_branches, nums.n_missing_branches)<EOL><DEDENT>args += (nums.pc_covered_str,)<EOL>if self.config.show_missing:<EOL><INDENT>args += (analysis.missing_formatted(),)<EOL><DEDENT>outfile.write(fmt_coverage % args)<EOL>total += nums<EOL><DEDENT>except KeyboardInterrupt:                   <EOL><INDENT>raise<EOL><DEDENT>except:<EOL><INDENT>report_it = not self.config.ignore_errors<EOL>if report_it:<EOL><INDENT>typ, msg = sys.exc_info()[:<NUM_LIT:2>]<EOL>if typ is NotPython and not cu.should_be_python():<EOL><INDENT>report_it = False<EOL><DEDENT><DEDENT>if report_it:<EOL><INDENT>outfile.write(fmt_err % (cu.name, typ.__name__, msg))<EOL><DEDENT><DEDENT><DEDENT>if total.n_files > <NUM_LIT:1>:<EOL><INDENT>outfile.write(rule)<EOL>args = ("<STR_LIT>", total.n_statements, total.n_missing)<EOL>if self.branches:<EOL><INDENT>args += (total.n_branches, total.n_missing_branches)<EOL><DEDENT>args += (total.pc_covered_str,)<EOL>if self.config.show_missing:<EOL><INDENT>args += ("<STR_LIT>",)<EOL><DEDENT>outfile.write(fmt_coverage % args)<EOL><DEDENT>return total.pc_covered<EOL>
Writes a report summarizing coverage statistics per module.

        `outfile` is a file object to write the summary to.